Fromfilter is a sendmail filter written using the libmilter API. It is currently beeing developed for the UoA arm of the EDUNET project. What it does is check and fix different errors in the From headers of outgoing mail. It queries an LDAP server for information regarding the uid that has been authenticated with sendmail AUTH. It can be used to prohibit impersonation and misrepresentation from the inside of an organisation.
Fromfilter is written using a literate programming tool called noweb. Literate programming is a way of programming for humans as well as for other programs. It was pioneered by Donald E. Knuth with the CWEB literate programming system for C. I preffer using Norman Ramsey's noweb for it's simplicity and extensibility.
You can download the full source and documentation from this location (426K .tar.gz).
From a single source file, fromfilter.nw, C code and documentation is generated. The documentation can be in print form or in web (html) form. The code is still readable by humans (although one is much better of reading the source documentation).
You might have use for the Makefile.
The html documentation consists of a single html file.
From the noweb source file, using the notangle tool, several C files are generated which you can find here
To compile the program some other files are needed. First a header, config.h, exists for some easy configurations. Then the rfc822 parser routines are contained in rfc822.c andrfc822.h. These two files were lifted from the mutt source. Some trivial modifications were made, but because of how nicely written they were they fit easily in any program. Thanks to the mutt coders!