How to Blacklist or Whitelist in SPAMASSASSIN

Locked
User avatar
george
Posts: 87
Joined: Fri 3. Jan 2020, 05:53
Location: AUSTRALIA

How to Blacklist or Whitelist in SPAMASSASSIN

Post by george »

As this is a common query with regards to spam, I thought it worthy of a post.
It is quite easy to blacklist or whitelist ANY email address, or an entire domain, using SpamAssassin.

All the details can be found on this page, in section "WHITELIST AND BLACKLIST OPTIONS":
https://spamassassin.apache.org/full/3. ... _Conf.html

These options can be added to the SpamAssassin configuration file, to get the job done.

How To

Edit the config file:

Code: Select all

/etc/spamassassin/local.cf

Add your blacklist/whitelist options at the end:

Code: Select all

# WHITELIST AND BLACKLIST OPTIONS
blacklist_from spameri@tiscali.it *@site.ru
whitelist_auth *@host.domain.com *@mydomain.com admin@systools.com

Restart spamassassin:

Code: Select all

service spamassassin restart
service spamassassin status

Notice I used "whitelist_auth" above. This is a great option to assure your own emails (sent) are never marked as spam. This problem may occur when sending test emails between domains, for example.

whitelist_auth
Used to specify addresses which send mail that is often tagged (incorrectly) as spam. This is different from whitelist_from and whitelist_from_rcvd in that it first verifies that the message was sent by an authorized sender for the address, before whitelisting.

All added customisations made to the Spamassassin configuration file, are retained through upgrades. Many options are available...

Enjoy!


---
Mod-Edit: This can be achived with KeyHelp >= 21.3 out of the box via the "Email server settings".
User avatar
george
Posts: 87
Joined: Fri 3. Jan 2020, 05:53
Location: AUSTRALIA

Re: How to Blacklist or Whitelist in SPAMASSASSIN

Post by george »

I still found some email from "root@host.domain.com", was being marked as spam - even when using "whitelist_auth". After further reading of the Spamassassin doc (linked above), I discovered "all_spam_to". This rule guarantees delivery to the address TO:

Code: Select all

all_spam_to  root@host.domain.com
Locked