Different spamassasin rules for inbound and outbound emails

Mark Martinec Mark.Martinec+amavis at ijs.si
Tue Oct 25 19:05:14 CEST 2011


> Is it possible to have different spamassassin rules for inbound and
> outbound emails?
> My objective is that I do not want to scan all outbound emails with
> full default SA rules, just a couple of rules hand written for the
> purpose. I have policy bank setup for inbound and outbound emails, but
> could not find a way to scan outbound emails with SA with a different
> rule set.

Sort of. Starting with amavisd 2.7.0 you can load SpamAssassin's
'user preferences' config file on top of a site-wide configuration.
The filename is provided by @sa_userconf_maps, so it can choose
a filename based on a recipient's e-mail address, but is also a
member of policy banks.

So you can have for example (using a 'constant' pseudo-lookup table):

$policy_bank{'PROXY-ORIGINATING'} = {
  originating => 1,
  sa_userconf_maps =>
    [ '/usr/local/etc/mail/spamassassin/user_config_originating' ],

and perhaps also a:

$policy_bank{'REGULAR-MX'} = {
  sa_userconf_maps =>
    [ '/usr/local/etc/mail/spamassassin/user_config_inbound' ],

Switching between configurations is rather expensive as SpamAssassin
needs to save and then restore current settings.

The @sa_userconf_maps (and related @sa_username_maps) are
documented in 2.7.0 release notes.


More information about the amavis-users mailing list