0

I've been looking everywhere for a solution but didn't find.

What I need is to whitelist some recipient addresses so they won't ever go to the spamassassin filtering.

In my master.cf in postfix I have this:

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

Thanks in advance.

Rikudou_Sennin
  • 1,189
  • 9
  • 23

2 Answers2

2

From https://spamassassin.apache.org/full/3.4.x/doc/Mail_SpamAssassin_Conf.html

whitelist_to user@example.com

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 filtered. 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:

    To
    Cc
    Apparently-To
    Delivered-To
    Envelope-Recipients
    Apparently-Resent-To
    X-Envelope-To
    Envelope-To
    X-Delivered-To
    X-Original-To
    X-Rcpt-To
    X-Real-To
Rob W
  • 315,396
  • 71
  • 752
  • 644
1

Open this file: /etc/spamassassin/local.cf and add this line:

whitelist_from abc@def.com

That will whitelist the address. To blacklist an address just use

blacklist_from abc@def.com

Also, I'm running Ubuntu, and they also include a file in the same location, 65_debian.cf. You can add that there as well.

Make sure this plugin is uncommented:

ifplugin Mail::SpamAssassin::Plugin::Shortcircuit

whitelist_from abc@def.com

...

endif

All your whitelist/blacklist rules along with custom scores and rules should fall within these lines.

Andy Lester
  • 81,480
  • 12
  • 93
  • 144
Lazloman
  • 1,079
  • 3
  • 20
  • 42