Differences between revisions 7 and 8
Revision 7 as of 2014-03-17 11:29:29
Size: 2102
Editor: MikeBrown
Comment: unlink SpamAssassin
Revision 8 as of 2014-04-13 02:29:39
Size: 2130
Editor: MikeBrown
Comment: removed Gmail from DK/SPF whitelist example since spammers certainly do use Gmail accounts; use generic example instead
Deletions are marked like this. Additions are marked like this.
Line 51: Line 51:
whitelist_from_dk *@gmail.com
whitelist_from_spf *@gmail.com
whitelist_from_dk *@never-spams.example.org
whitelist_from_spf *@never-spams.example.org

Shortcircuiting Ruleset

The following is a sample ruleset which uses the SpamAssassin 3.2.0+ feature of short-circuiting, together with existing, reliable, hard-to-forge whitelist/blacklist rules, in order to reduce CPU load. It assumes you have enabled the Shortcircuit plugin in the v320.pre file.

To use this ruleset, save it as shortcircuit.cf in the same folder as local.cf.

# Shortcircuit config - supplements 60_shortcircuit.cf
# see <https://wiki.apache.org/spamassassin/ShortcircuitingRuleset>
# Note that these rules use a variety of normally-optional plugins; you need to
# enable the DK, DKIM, SPF, Shortcircuit, ClamAV, and VBounce plugins to use
# them.

ifplugin Mail::SpamAssassin::Plugin::Shortcircuit

# always log shortcircuit status
add_header all Status "_YESNO_, score=_SCORE_ required=_REQD_ tests=_TESTS_ shortcircuit=_SCTYPE_ autolearn=_AUTOLEARN_ version=_VERSION_"

# simple, non-network-based whitelists, locally-generated messages,
# messages via a trusted relay chain
priority SC_HAM -1000
shortcircuit SC_HAM ham
score SC_HAM -20

# simple, non-network based blacklists
priority SC_SPAM -950
shortcircuit SC_SPAM spam
score SC_SPAM 20

# slower, network-based whitelisting
priority SC_NET_HAM -500
shortcircuit SC_NET_HAM ham
score SC_NET_HAM -20

# bounce messages from non-whitelisted relays: unwanted, so treat as spam
# (requires whitelist_bounce_relays to be set in local.cf)
priority ANY_BOUNCE_MESSAGE -700
shortcircuit ANY_BOUNCE_MESSAGE spam

# ClamAV support: no need to scan viruses/malware
priority CLAMAV -900
shortcircuit CLAMAV spam
score CLAMAV 20

# add additional DK/SPF whitelists
whitelist_from_dk *@never-spams.example.org
whitelist_from_spf *@never-spams.example.org


ShortcircuitingRuleset (last edited 2014-04-13 02:29:39 by MikeBrown)