Ich habe meine /etc/spamassassin/local.cf
Spamassassin-Datei aktualisiert, um einige Punkteregeln zu aktualisieren. Doch selbst nach einem Neustart von Spamassassin (über den Dienst) wird der neue Punktestand nicht in Spam-E-Mails angezeigt. Tatsächlich scheint nichts in dieser Datei die Funktionsweise von Spamassassin zu beeinflussen.
Ich verwende Exim als MTA, aber das sollte keine Rolle spielen. Alle Pakete wurden über apt-get installiert und sind auf dem neuesten Stand für 14.04.
Ich habe zum Beispiel das hier:
score HTML_MESSAGE 2.0
definieren in /etc/spamassassin/local.cf
. Ich habe sowohl Exim als auch Spamassassin neu gestartet. spamassassing --lint
zeigt, dass in dieser Datei keine Fehler vorhanden sind. Dann bekam ich noch einen weiteren Spam mit diesem:
0.0 HTML_MESSAGE BODY: HTML included in message
Im Feld X-Spam-Report.
Ich habe es ausgeführt spamassassin -D < spam
und die Reihenfolge beim Laden der CFG-Dateien scheint falsch zu sein:
Jun 8 13:34:07.300 [21668] dbg: config: read file /etc/spamassassin/local.cf
...
Jun 8 13:34:07.600 [21668] dbg: config: read file /var/lib/spamassassin/3.004000/updates_spamassassin_org/50_scores.cf
...
Jun 8 13:34:07.787 [21668] dbg: config: read file /var/lib/spamassassin/3.004000/updates_spamassassin_org/73_sandbox_manual_scores.cf
Jun 8 13:34:07.788 [21668] dbg: config: fixed relative path: /var/lib/spamassas
sin/3.004000/updates_spamassassin_org/local.cf
...
Was ist los?
Basierend auf einem Kommentar vonCentimane: Ich habe es strace -f -e trace=file spamassassin -D < spam
mit demselben Ergebnis versucht: Spamassassin liest Systemdateien nach der Datei local.cf. Dadurch werden alle Punkteänderungen gelöscht.
Aus den Kommentaren geht hervor, dass hier die local.cf
Datei ist, die mehr oder weniger der Originaldatei entspricht.
# 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*****
add_header spam Flag _YESNOCAPS_
add_header all Checker-Version SpamAssassin _VERSION_ (_SUBVERSION_) on _HOSTNAME_
add_header all Status _YESNO_, score=_SCORE_ required=_REQD_ tests=_TESTS_ autolearn=_AUTOLEARN_ bayes=_BAYES_
add_header all Report _SUMMARY_
# Save spam messages as a message/rfc822 MIME attachment instead of
# modifying the original message (0: off, 2: use text/plain instead)
#
# report_safe 1
# 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
bayes_path /var/lib/spamassassin/bayes/bayes
bayes_file_mode 0777
# Bayesian classifier auto-learning (default: 1)
#
bayes_auto_learn 1
# Set headers which may provide inappropriate cues to the Bayesian
# classifier
#
bayes_ignore_header X-Bogosity
bayes_ignore_header X-Spam-Flag
bayes_ignore_header X-Spam-Status
# Some shortcircuiting, if the plugin is enabled
#
ifplugin Mail::SpamAssassin::Plugin::Shortcircuit
#
# default: strongly-whitelisted mails are *really* whitelisted now, if the
# shortcircuiting plugin is active, causing early exit to save CPU load.
# Uncomment to turn this on
#
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
blacklist_from wokfrance.com
blacklist_from brother-mailer.com
blacklist_from *.sd-soft.net
blacklist_from woifrance.com
blacklist_from adimacocl.net
blacklist_from bletspuranawyat.net
blacklist_from sd-soft.net
blacklist_from m1web-track.com
blacklist_from winntoniecline.net
blacklist_from kafod.org
blacklist_from *.kafod.org
blacklist_from [email protected]
blacklist_from *.bhlive.co.uk
blacklist_from *.regionasm.net
blacklist_from regionasm.net
## Tweaks.
score AC_BR_BONANZA 1.0
score ADMITS_SPAM 10.0
score A_HREF_TO_REMOVE 2.0
score DEAR_FRIEND 4.0
score FREEMAIL_FORGED_FROMDOMAIN 4.0
score FREEMAIL_FROM 1.0
score FROM_LOCAL_HEX 9.0
score HTML_MESSAGE 2.0
score RCVD_IN_MSPIKE_BL 2.0
score RCVD_IN_SORBS_WEB 2.0
score RCVD_IN_XBL 3.0
score RDNS_NONE 2.0
score SCVD_IN_DNSWL_BLOCKED 3.0
score T_DKIM_INVALID 1.0
score T_FREEMAIL_DOC_PDF 3.0
score T_REMOTE_IMAGE 3.0
score URIBL_BLOCKED 3.0
score URIBL_DBL_SPAM 3.0
score URIBL_JP_SURBL 3.0
score URIBL_WS_SURBL 3.0
endif # Mail::SpamAssassin::Plugin::Shortcircuit
Und die gesamte Ausgabe spamassassin -D
ist dafür zu groß. Die relevanten Zeilen stehen jedoch oben. Wenn Sie weitere Informationen wünschen, sagen Sie mir, wonach ich suchen soll, und ich werde es hinzufügen.
Antwort1
Das Problem ist, dass Sie dieHTML_MESSAGEPunktzahl innerhalb derKurzschlussPlugin. Aber dieses Plugin ist standardmäßig deaktiviert. Versuchen Sie, den Score in der letzten Zeile der Datei festzulegen, nach demKurzschluss endif
Anweisung:
# Some shortcircuiting, if the plugin is enabled
#
ifplugin Mail::SpamAssassin::Plugin::Shortcircuit
# [...]
endif # Mail::SpamAssassin::Plugin::Shortcircuit
score HTML_MESSAGE 2.0
Wenn Sie lieber dieAbkürzungPlugin, müssen Sie es auskommentieren aus dem/etc/spamassassin/v320.preDatei:
# Shortcircuit - stop evaluation early if high-accuracy rules fire
#
loadplugin Mail::SpamAssassin::Plugin::Shortcircuit
Antwort2
In der README-Datei für SpamAssassin wird die komplizierte Art und Weise beschrieben, wie SpamAssassin seine eigenen Datendateien liest.
Beginnen Sie mit dem Lesen bei Zeile 95: http://svn.apache.org/viewvc/spamassassin/branches/3.4/README?view=markup#l95
Wenn man das liest, scheint es, dass SpamAssassin, zumindest in der ursprünglichen, offiziellen Quelle, nicht liest aus
/etc/spamassassin/
überhaupt, sondern von
/etc/mail/spamassassin/
Versuchen Sie, Ihre Datei dorthin zu verschieben! :D
Antwort3
In meiner Standardeinstellung local.cf
lautet es:
# These values can be overridden by editing ~/.spamassassin/user_prefs.cf
# (see spamassassin(1) for details)
Haben Sie eine Spamassassin-Benutzerkonfigurationsdatei (~/.spamassassin/user_prefs.cf)?
Schauen Sie sich auch dieses Perldoc an:
perldoc Mail::SpamAssassin::Conf
ImNUTZERPREFERENZENAbschnitt, den ich gelesen habe:
BENUTZEREINSTELLUNGEN Die folgenden Optionen können sowohl in siteweiten („local.cf“) als auch in benutzerspezifischen („user_prefs“) Konfigurationsdateien verwendet werden, um anzupassen, wie SpamAssassin eingehende E-Mail-Nachrichten verarbeitet.