
The sendmail mail filter api (milter) is designed to allow third-party programs access to mail messages as they are being processed in order to filter meta-information (headers) and content.
the debian sendmail package is built to support libmilter.
this is the libmilter static library and include files for development.
the documentation on building a milter is in the sendmail-doc package.