cf/README for sendmail 8.12.3

Eric Allman of the Sendmail Consortium

Adding New Mail Filters

Sendmail supports mail filters to filter incoming SMTP messages according to the "Sendmail Mail Filter API" documentation. These filters can be configured in your mc file using the two commands:

MAIL_FILTER(`name', `equates') INPUT_MAIL_FILTER(`name', `equates')

The first command, MAIL_FILTER(), simply defines a filter with the given name and equates. For example:

MAIL_FILTER(`archive', `S=local:/var/run/archivesock, F=R')

This creates the equivalent entry:

Xarchive, S=local:/var/run/archivesock, F=R

The INPUT_MAIL_FILTER() command performs the same actions as MAIL_FILTER but also populates the m4 variable ` confINPUT_MAIL_FILTERS' with the name of the filter such that the filter will actually be called by sendmail.

For example, the two commands:

INPUT_MAIL_FILTER(`archive', `S=local:/var/run/archivesock, F=R')
INPUT_MAIL_FILTER(`spamcheck', `S=inet:2525@localhost, F=T')

are equivalent to the three commands:

   MAIL_FILTER(`archive', `S=local:/var/run/archivesock, F=R')
MAIL_FILTER(`spamcheck', `S=inet:2525@localhost, F=T')
define(`confINPUT_MAIL_FILTERS', `archive, spamcheck')

In general, INPUT_MAIL_FILTER() should be used unless you need to define more filters than you want to use for `confINPUT_MAIL_FILTERS'.

Note that setting `confINPUT_MAIL_FILTERS' after any INPUT_MAIL_FILTER() commands will clear the list created by the prior INPUT_MAIL_FILTER() commands.