Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am loading spamassassin user_prefs using user_scores_* sql-functions.

There are many users in my system who don't want to use spamassassin at all. Is there an option to do so?

I know I could set the required_score to something really high, but the scanning would be an unnecessary waste of resources then

share|improve this question
depends on how you call spamassassin. usually you have some type of "glue" between the mailserver and spamassassin. configure this glue to skip SA for these users. – Gryphius May 28 '13 at 13:14
Well, spamassassin is being invoked by postfix using the content_filter option. I would need to create an extra wrapper between postfix and spamassassin. However, as spamassassin fetches the user preferences from the database anyway, to have spamassassin directly decide whether it should scan or not. – Zulakis May 28 '13 at 14:15
I am not really sure why anyone would mark this question as off topic or non-constructive. Please atleast leave a reason if you do so. I am ofcourse willing to improve my question if it's not good enough. – Zulakis May 28 '13 at 14:25
@Zulakis any reason why my answer wouldn't be valid? – NickW May 28 '13 at 15:53

1 Answer 1

Well, you could use this short circuit:

If the given address appears as a recipient
in the message headers (Resent-To, To, Cc, obvious envelope recipient,
etc.) the mail will be whitelisted. Useful if you're deploying
SpamAssassin system-wide, and don't want some users to have their mail
Same format as whitelist_from. There are three levels of
To-whitelisting, whitelist_to, more_spam_to and all_spam_to. Users in
the first level may still get some spammish mails blocked, but users
in all_spam_to should never get mail blocked.

The headers checked for whitelist addresses are as follows: if
Resent-To or Resent-Cc are set, use those; otherwise check all
addresses taken from the following set of headers:

share|improve this answer
Hi there, thanks for your answer. The reason I am struggling with this is that most of the mentioned headers can be faked quite easily. As spamassassin is invoked with the username of the recipient anyway (as necessary for user based settings. this is even with aliases expanded already), it should probably use this one and not some maybe bogus headers. – Zulakis May 28 '13 at 23:12
Also, if sending mail to multiple recipients, the mail is not being filtered if only one single whitelisted person is in To or Cc. This is far from what I am looking for. As I already said before, spamassassin must be invoked with the -u argument anyway which specifies exactly one final recipient. This is what should be used for this setting. – Zulakis May 28 '13 at 23:17
You realize that mail to multiple recipients is actually multiple mails, and treated as so by any MTA? – NickW May 29 '13 at 8:24
Anyhow, you should really just install amavisd-new and set up SQL user preferences, in that manner the mail will actually be sent to spamassassin or not, not sent to spamassassin to not be scanned. – NickW May 29 '13 at 8:46
Yeah. I suppose you mean to use transport_maps and have a 'non-filtering' transport with -o content_filter= or what's your idea? – Zulakis May 5 at 12:19

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.