Blacklist domains/mail addresses in SpamAssassin

Edit /etc/spamassassin/v320.pre

Uncomment the Shortcircuit line to enable it:

loadplugin Mail::SpamAssassin::Plugin::Shortcircuit

Edit /etc/spamassassin/local.cf

Add these lines to local.cf file:

ifplugin Mail::SpamAssassin::Plugin::Shortcircuit
shortcircuit USER_IN_BLACKLIST on
shortcircuit USER_IN_BLACKLIST_TO on
shortcircuit SUBJECT_IN_BLACKLIST on
endif # Mail::SpamAssassin::Plugin::Shortcircuit

Include your blacklist file into local.cf:

include /etc/spamassassin/blacklist.cf

Edit /etc/spamassassin/blacklist.cf

Add this line to block all emails from domain.com

blacklist_from *@domain.com

Add this line to block addr@domain2.com

blacklist_from addr@domain2.com

You can add multiple domains and email accounts to block them.

Reload amavis

service amavis force-reload

Revision #1
Created Mon, Jul 1, 2019 11:19 AM by Tamas Toth
Updated Mon, Jul 1, 2019 11:20 AM by Tamas Toth