SpamAssassin in a box local.cf customization
Idea shared by Steve Reid - February 20, 2015 at 8:18 AM
Proposed
Here is my config:
 
#    Rescore some rules
#
# score        HTML_IMAGE_ONLY_02          3.5
# score        FORGED_IMS_TAG              2.5
score     ALL_TRUSTED             0
score     RCVD_IN_NIX_SPAM        0 1.5 0 1.5
score     RCVD_IN_HOSTKARMA_WL        0 0 0 0
score        RCVD_IN_HOSTKARMA_NO        0.2
score        RCVD_IN_HOSTKARMA_BR        0.2
score        KHOP_SC_CIDR24            0.3
score        KHOP_SC_TOP_CIDR8        0.3
score        NORMAL_HTTP_TO_IP        0.5
score        LOTS_OF_MONEY                0.2
score     RCVD_IN_DNSWL_NONE         0 0 0 0
score        RP_MATCHES_RCVD            0
score        BAYES_00                0
score        RCVD_IN_DNSWL_NONE        0
score        RCVD_IN_MSPIKE_H3        0
score        BAYES_100                2.8
score        BAYES_90                2.5
score        BAYES_80                2.3
score        BAYES_70                2.0
score        BAYES_60                1.8
score        BAYES_50                1.5
score        BAYES_40                1.3
score        BAYES_30                1.0
score        BAYES_20                0.8
score        BAYES_10                0.3
score        JAM_PHARMACY_BD                2.0
score        JAM_DO_STH_HERE                0.5
score        MIME_HTML_ONLY                1.5
score        DIET_1                    1.5
score        RAZOR2_CHECK                2.0
score        T_LOTS_OF_MONEY                1.0
score        FROM_12LTRDOM                0.5
score        FRT_TODAY2                1.0
score        JAM_SMALL_FONT_SIZE            1.0
score        RCVD_IN_DNSWL_LOW            0.0
score        JAM_REPLACED_I_BD            1.0
score        JAM_LONG_LINK                1.0
score        JAM_LOAN_BD                1.0
 
 
Not sure if anyone else has customizations they can share?

2 Replies

Reply to Thread
1
I was told that this file will get overwritten with an update of SpamAssassin in a box. Supposedly any file in the same folder with .cf will get loaded. I just make a backup.
0
SmarterMail 13.3
 
Hi, friends. I've been working with my local.cf file. I find that when I implement Steve Reid's configuration, SmarterMail refuses to start, and gives me a series of abstruse connection errors. The full local.cf file is below. What do you think I am doing wrong?
 
Is there a place where one can simply download an optimized local.cf file for SAIB?
 
Thank you as always for any advice.
 
Eric
 
local.cf:
 
# This is the right place to customize your installation of SpamAssassin.
#
# See 'perldoc Mail::SpamAssassin::Conf' for details of what can be
# tweaked.
#
# Only a small subset of options are listed below
#
###########################################################################
#   Add *****SPAM***** to the Subject header of spam e-mails
#
# rewrite_header Subject *****SPAM*****

#   Save spam messages as a message/rfc822 MIME attachment instead of
#   modifying the original message (0: off, 2: use text/plain instead)
#   IMPORTANT: Do not enable report_safe when using JAM Software products!!!
report_safe 0

#   Set which networks or hosts are considered 'trusted' by your mail
#   server (i.e. not spammers)
#
# trusted_networks 212.17.35.

#   Set file-locking method (flock is not safe over NFS, but is faster)
#
# lock_method flock

#   Set the threshold at which a message is considered spam (default: 5.0)
#
# required_score 5.0

#   Use Bayesian classifier (default: 1)
#
# use_bayes 1

#   Bayesian classifier auto-learning (default: 1)
#
# bayes_auto_learn 0
#    This is the directory and filename for Bayes databases. Several
#    databases will be created, with this as the base directory and
#    filename, with _toks, _seen, etc. appended to the base.
#
bayes_path C:\ProgramData\JAM Software\spamdService\sa-bayes\bayes
#    With "bayes_auto_learn_on_error" turned on, autolearning will be
#    performed only when a bayes classifier had a different opinion from
#    what the autolearner is now trying to teach it (i.e. it made an
#    error in judgement). This strategy may or may not produce better
#    future classifications, but usually works very well, while also
#    preventing unnecessary overlearning and slows down database growth.
bayes_auto_learn_on_error 1

#   Set headers which may provide inappropriate cues to the Bayesian
#   classifier
#
bayes_ignore_header x-spam-status
bayes_ignore_header x-spam-checker-version
bayes_ignore_header X-Spam-Status
bayes_ignore_header x-spam-report
bayes_ignore_header x-process
bayes_ignore_header x-backup
bayes_ignore_header X-MS-Exchange-Organization-PCL
bayes_ignore_header X-MS-Exchange-Organization-SCL
bayes_ignore_header x-ms-exchange-organization-AuthSource
bayes_ignore_header X-MS-Exchange-Organization-AuthAs
bayes_ignore_header X-MS-Exchange-Organization-OriginalArrivalTime
bayes_ignore_header X-MS-Exchange-Forest-ArrivalHubServer
bayes_ignore_header X-MS-Exchange-Organization-OriginalClientIPAddress
bayes_ignore_header X-MS-Exchange-Organization-OriginalServerIPAddress
bayes_ignore_header X-MS-Exchange-Organization-MessageDirectionality
bayes_ignore_header X-MS-Exchange-Organization-Cross-Premises-Headers-Processed
# If the score is smaller that this, email will be automatically
# learned as nonspam. The threshold can be negative.
bayes_auto_learn_threshold_nonspam 0.05
# If the score is larger than this, email will be automatically
# learned as spam.
bayes_auto_learn_threshold_spam 11.0
# TextCat - language guesser (also defined in v310.pre, but not activated)
# Note: You have to specify ok_languages in order to make Textcat score spam
#
loadplugin Mail::SpamAssassin::Plugin::TextCat
#    Shortcircuit - stop evaluation early if high-accuracy rules fire
#
loadplugin Mail::SpamAssassin::Plugin::Shortcircuit
#
#   strongly-whitelisted mails are *really* whitelisted now, if the
#   shortcircuiting plugin is active, causing early exit to save CPU load.
#
shortcircuit USER_IN_WHITELIST       on
shortcircuit USER_IN_DEF_WHITELIST   on
shortcircuit USER_IN_ALL_SPAM_TO     on
shortcircuit SUBJECT_IN_WHITELIST    on
#   the opposite; blacklisted mails can also save CPU
shortcircuit USER_IN_BLACKLIST       on
shortcircuit USER_IN_BLACKLIST_TO    on
shortcircuit SUBJECT_IN_BLACKLIST    on
#   if you have taken the time to correctly specify your "trusted_networks",
#   this is another good way to save CPU
# shortcircuit ALL_TRUSTED             on
#   and a well-trained bayes DB can save running rules, too
# shortcircuit BAYES_99                spam
# shortcircuit BAYES_00                ham
#    Some JAM customized Shortcircuit configuration
#    
#    Set Bayes_99 priority higher so it hits more early ( => less RBL checks )
priority BAYES_99                   -850
#     
#     Allow rules to be defined in user_prefs
#
allow_user_rules 1
#    Replace default headers through more formatted output
#
clear_headers
add_header all Checker-Version SpamAssassin _VERSION_ (_SUBVERSION_) * on _HOSTNAME_ * at _DATE_
add_header all Status _YESNO_, score=_SCORE_, hits=_HITS_, required=_REQD_, autolearn=_AUTOLEARN_, shortcircuit=_SC_
add_header spam Level _STARS(*)_
add_header all Report _REPORT_

#    Google uses DKIM so this should only whitelist real google mails
#
whitelist_auth adwords-noreply@google.com   
whitelist_auth googlealerts-noreply@google.com
def_whitelist_from_spf *@jam-software.de
def_whitelist_from_spf *@jam-software.com

# DNSBL of German publisher heise (http://www.heise.de/ix/nixspam/)
header NIX_SPAM  eval:check_rbl('nix-spam',
'ix.dnsbl.manitu.net')
describe NIX_SPAM Listed in NIX_SPAM DNSBL (heise.de)
tflags NIX_SPAM  net
score NIX_SPAM  1.2
 

#    Rescore some rules
#
# score        HTML_IMAGE_ONLY_02          3.5
# score        FORGED_IMS_TAG              2.5
score     ALL_TRUSTED             0
score     RCVD_IN_NIX_SPAM        0 1.5 0 1.5
score     RCVD_IN_HOSTKARMA_WL        0 0 0 0
score        RCVD_IN_HOSTKARMA_NO        0.2
score        RCVD_IN_HOSTKARMA_BR        0.2
score        KHOP_SC_CIDR24            0.3
score        KHOP_SC_TOP_CIDR8        0.3
score        NORMAL_HTTP_TO_IP        0.5
score        LOTS_OF_MONEY                0.2
score     RCVD_IN_DNSWL_NONE         0 0 0 0
score        RP_MATCHES_RCVD            0
score        BAYES_00                0
score        RCVD_IN_DNSWL_NONE        0
score        RCVD_IN_MSPIKE_H3        0
score        BAYES_100                2.8
score        BAYES_90                2.5
score        BAYES_80                2.3
score        BAYES_70                2.0
score        BAYES_60                1.8
score        BAYES_50                1.5
score        BAYES_40                1.3
score        BAYES_30                1.0
score        BAYES_20                0.8
score        BAYES_10                0.3
score        JAM_PHARMACY_BD                2.0
score        JAM_DO_STH_HERE                0.5
score        MIME_HTML_ONLY                1.5
score        DIET_1                    1.5
score        RAZOR2_CHECK                2.0
score        T_LOTS_OF_MONEY                1.0
score        FROM_12LTRDOM                0.5
score        FRT_TODAY2                1.0
score        JAM_SMALL_FONT_SIZE            1.0
score        RCVD_IN_DNSWL_LOW            0.0
score        JAM_REPLACED_I_BD            1.0
score        JAM_LONG_LINK                1.0
score        JAM_LOAN_BD                1.0
 

Reply to Thread