Home -- Tutorials -- Quickies -- Manual Pages -- Search -- Feedback -- About The Site -- Forum
Sendmail Mail Filters (Milters) Only on Specific Ports or IPs
added 6.25.2005 -- no source information provided


If you are using Sendmail 8.13.x, which is the default on FreeBSD 5.4 (and some earlier versions as well), you can attach sendmail mail filters / milters to specific daemons running on different ports or IP addresses.

This is very handy if you want to be able to have incoming mail delivered to your external IP address go through spamass-milter for SpamAssassin or another milter for a virus scanner, but not have outbound mail scanned. SpamAssassin and spamass-milter are both available through FreeBSD ports.

For the SpamAssassin milter, I use these line in my .mc file.

INPUT_MAIL_FILTER(`spamassassin', `S=local:/var/run/spamass-milter.sock, F=, T=C:15m;S:4m;R:4m;E:10m')
define(`confINPUT_MAIL_FILTERS', `spamassassin')


Then I can say something like this to make SpamAssassin not run on localhost and my internal IP which is 172.20.1.1.

DAEMON_OPTIONS(`Addr=127.0.0.1, Name=IPv4, Family=inet, InputMailFilters=')
DAEMON_OPTIONS(`Addr=172.20.1.1, Name=IPv4, Family=inet, InputMailFilters=')
DAEMON_OPTIONS(`Name=IPv4, Family=inet, InputMailFilters=spamassassin')


This same setup should work for any other milter, such as clamav or mimedefang.

Good luck!
© Copyright 1998-2012 VANGEYN.Net, unless otherwise noted.