0

Running spamassassin locally on mail system is causing load issues. On another system which uses Exim as an MTA shipping mail off to an array of external spamassassin systems was just a one line change in config and they were queried round-robin.

Now on a new postfix setup the transport for spamscanning looks like this in /etc/postfix/master.cf:

smtpd pass - - - - 200 smtpd -o content_filter=spamassassin

and the definition for spamassassin also in /etc/postfix/master.cf is:

spamassassin unix - n n - - pipe user=debian-spamd argv=/usr/bin/spamc -f -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}

I would like to get the load off of this system but cannot seem to find any documentation specifically for postfix transports for external spamassassin. The closest I have come was something I found in postfix docs http://www.postfix.org/FILTER_README.html under Advanced Content Filter Example which caused me to try editing the transport line to:

smtpd pass - - - - 200 smtpd -o content_filter=scan:<ExternalIP>:<ExternalPort>

However this rendered transport unavailable.

1 Answers1

0
spamassassin unix  -       n       n       -       -       pipe
  user=debian-spamd argv=/usr/bin/spamc -d <external_host1>,<external_host2>,<external_host3> -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}

This worked although it isn't round robin, just failover.

Also man spamc

Configuration File

The above command-line switches can also be loaded from a configuration file.

The format of the file is similar to the SpamAssassin rules files; blank lines and lines beginning with "#" are ignored. Any space-separated words are considered additions to the command line, and are prepended. Newlines are treated as equivalent to spaces. Existing command line switches will override any settings in the configuration file.

If the -F switch is specified, that file will be used. Otherwise, "spamc" will attempt to load spamc.conf in "SYSCONFDIR" (default: /etc/mail/spamassassin). If that file doesn't exist, and the -F switch is not specified, no configuration file will be read.

Example:

# spamc global configuration file

# connect to "server.example.com", port 783
-d server.example.com
-p 783

is a thing.