首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >垃圾邮件杀手不尊重local.cf

垃圾邮件杀手不尊重local.cf
EN

Unix & Linux用户
提问于 2017-05-22 13:56:27
回答 3查看 2.6K关注 0票数 4

我更新了我的/etc/spamassassin/local.cf垃圾邮件杀手文件,以更新一些得分规则。然而,即使在重新启动垃圾邮件(通过服务),新的分数没有显示在垃圾邮件。事实上,文件中似乎没有任何东西影响垃圾邮件杀手的工作方式。

我使用进出口作为我的MTA,但这不重要。所有软件包都是通过apt-get安装的,最新版本为14.04。

例如,我有这样的想法:

代码语言:javascript
复制
score HTML_MESSAGE 2.0

/etc/spamassassin/local.cf中定义。我重新启动了进出口公司和垃圾邮件杀手公司。spamassassing --lint显示在hat文件中没有错误。然后又收到了这样的垃圾邮件:

代码语言:javascript
复制
0.0 HTML_MESSAGE           BODY: HTML included in message

在“垃圾邮件报告”字段中。

我运行了spamassassin -D < spam,加载cfg文件的顺序似乎是错误的:

代码语言:javascript
复制
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
...

,怎么回事?

基于坎蒂曼的一条评论:我尝试了strace -f -e trace=file spamassassin -D < spam并得到了同样的结果: Spamassassin是在local.cf文件之后读取系统文件。因此,粉碎任何分数的变化。

从注释中可以看出,这里是local.cf文件,它或多或少是普通文件。

代码语言:javascript
复制
# 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 bhlivetickets@bhlive.co.uk
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

spamassassin -D的整个输出都太大了。然而,有关的线在上面。如果你想要更多的信息,告诉我要找什么,我会添加它。

EN

回答 3

Unix & Linux用户

回答已采纳

发布于 2017-05-31 07:47:35

问题是,您正在设置HTML_MESSAGE分数在短路插件内。但是默认情况下,这个插件是禁用的。在短路endif指令之后,尝试在文件的最后一行设置分数:

代码语言:javascript
复制
#   Some shortcircuiting, if the plugin is enabled
# 
ifplugin Mail::SpamAssassin::Plugin::Shortcircuit
# [...]
endif # Mail::SpamAssassin::Plugin::Shortcircuit

score HTML_MESSAGE 2.0

如果您希望启用Shortcuit插件,则需要从/etc/spamassassin/v320.prefile中取消注释:

代码语言:javascript
复制
# Shortcircuit - stop evaluation early if high-accuracy rules fire
# 
loadplugin Mail::SpamAssassin::Plugin::Shortcircuit
票数 5
EN

Unix & Linux用户

发布于 2017-05-25 22:35:06

SpamAssassin的自述文件讨论了SpamAssassin读取自己的数据文件的复杂方式。

开始阅读第95行:http://svn.apache.org/viewvc/spamassassin/branches/3.4/README?view=markup#l95

从阅读上看,似乎SpamAssassin,至少在最初的官方来源中,并没有从

代码语言:javascript
复制
/etc/spamassassin/

一点也不,而是从

代码语言:javascript
复制
/etc/mail/spamassassin/

试着把你的文件移到那里!

票数 2
EN

Unix & Linux用户

发布于 2017-05-29 15:35:53

在我的默认local.cf中,我读到:

代码语言:javascript
复制
# These values can be overridden by editing ~/.spamassassin/user_prefs.cf
# (see spamassassin(1) for details) 

您有用户spamassassin配置文件(~/.spamassassin/ user _prefs.cf)吗?

看看这个perldoc:

perldoc Mail::SpamAssassin::Conf

在“用户首选项”一节中,我读到:

用户首选项可以在站点范围("local.cf")和特定于用户的("user_prefs")配置文件中使用,以自定义SpamAssassin处理传入电子邮件的方式。

票数 0
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/366557

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档