我在任何电子邮件上都没有得到贝叶斯分数,尽管我尽了最大努力,但似乎没有贝叶斯过滤。我不是 linux 和 spamassassin 大师,所以我寻求帮助。
我在 local.cf 中建立了这些设置,试图让贝叶斯工作:
use_bayes 1
bayes_auto_learn 1
bayes_min_ham_num 100
bayes_auto_learn_threshold_nonspam -0.001
bayes_auto_learn_threshold_spam 6.0
allow_user_rules 0
add_header all Status _YESNO_, score=_SCORE_ required=_REQD_ tests=_TESTS_ autolearn=_AUTOLEARN_ version=_VERSION_
spamassassin 日志文件始终显示一个错误:
Fri Mar 3 12:36:27 2017 [10104] info: spamd: creating default_prefs: /root/.spamassassin/user_prefs
Fri Mar 3 12:36:27 2017 [10104] info: spamd: failed to create readable default_prefs: /root/.spamassassin/user_prefs
偶尔出现一个错误:
warn: plugin: eval failed: bayes: (in learn) locker: safe_lock: cannot create tmp lockfile /root/.spamassassin/bayes.lock.[mydomain.com].27903 for /root/.spamassassin/bayes.lock: Permission denied
/root/.spamassassin/user_prefs 确实存在,并且我已授予所有人权限以尝试解决此问题,但没有任何效果:
-rwxrwxrwx 1 root root 1273 Mar 1 14:46 user_prefs*
我的 spamd 启动命令明确将用户设置为 spamd,但主要服务仍以 root 身份运行,而子项似乎正常生成。这是 ps 输出:
root 10093 0.0 1.5 145988 66952 ? Ss 02:25 0:05 /usr/sbin/spamd --create-prefs --max-children=5 --username=spamd --helper-home-dir=/var/log/spamassassin/ --syslog=/var/log/spamassassin/spam .log -d --pidfile=/var/run/spamd.pid
spamd 10104 0.0 1.8 155348 75544 ? S 02:25 0:22 spamd child
spamd 23753 0.0 1.7 151732 72000 ? S 10:30 0:02 spamd child
我的贝叶斯数据库为 root 存在:
sa-learn --dump magic
0.000 0 3 0 non-token data: bayes db version
0.000 0 1727 0 non-token data: nspam
0.000 0 111 0 non-token data: nham
0.000 0 103812 0 non-token data: ntokens
0.000 0 1484629200 0 non-token data: oldest atime
0.000 0 1488559525 0 non-token data: newest atime
0.000 0 1488323169 0 non-token data: last journal sync atime
0.000 0 0 0 non-token data: last expiry atime
0.000 0 0 0 non-token data: last expire atime delta
0.000 0 0 0 non-token data: last expire reduction count
尽管我使用上面显示的阈值强制启用自动学习,但我所有的电子邮件标题都有这些:
autolearn=unavailable autolearn_force=no
或者
autolearn=no autolearn_force=no
最后,这是 spamassassin 日志的完整片段,显示它识别垃圾邮件,但未应用任何贝叶斯处理,而显然是以 root 身份工作:
Fri Mar 3 12:55:11 2017 [10104] info: spamd: connection from localhost [::1]:54673 to port 783, fd 6
Fri Mar 3 12:55:11 2017 [10104] info: spamd: creating default_prefs: /root/.spamassassin/user_prefs
Fri Mar 3 12:55:11 2017 [10104] info: spamd: failed to create readable default_prefs: /root/.spamassassin/user_prefs
Fri Mar 3 12:55:11 2017 [10104] info: spamd: processing message <5323541152335322929654419@lo.nbvc12345.xyz> for root:1010
Fri Mar 3 12:55:11 2017 [10104] info: spamd: identified spam (10.5/3.0) for root:1010 in 0.2 seconds, 8433 bytes.
Fri Mar 3 12:55:11 2017 [10104] info: spamd: result: Y 10 - HTML_FONT_LOW_CONTRAST,HTML_MESSAGE,MPART_ALT_DIFF,RCVD_IN_BRBL_LASTEXT,RCVD_IN_SBL_CSS,RDNS_NONE,T_REMOTE_IMAGE,URIBL_BLOCKED,URIBL_DBL_SPAM,URIBL_SBL,URIBL_SBL_A scantime=0.2,size=8433,user=root,uid=1010,required_score=3.0,rhost=localhost,raddr=::1,rport=54673,mid=<5323541152335322929654419@lo.nbvc12345.xyz>,autolearn=no autolearn_force=no
Fri Mar 3 12:55:11 2017 [10093] info: prefork: child states: II
这是它缺少垃圾邮件的完整片段,因为没有贝叶斯过滤:
Fri Mar 3 13:01:31 2017 [10104] info: spamd: connection from localhost [::1]:56926 to port 783, fd 6
Fri Mar 3 13:01:31 2017 [10104] info: spamd: creating default_prefs: /root/.spamassassin/user_prefs
Fri Mar 3 13:01:31 2017 [10104] info: spamd: failed to create readable default_prefs: /root/.spamassassin/user_prefs
Fri Mar 3 13:01:31 2017 [10104] info: spamd: processing message <sie819-8bh73y10780523sdgw_ds7fid385303272d2g-8h723se@email.searchresultsnewinfo.com> for root:1010
Fri Mar 3 13:01:31 2017 [10104] info: spamd: clean message (1.3/3.0) for root:1010 in 0.3 seconds, 8104 bytes.
Fri Mar 3 13:01:31 2017 [10104] info: spamd: result: . 1 - RDNS_NONE,URIBL_BLOCKED scantime=0.3,size=8104,user=root,uid=1010,required_score=3.0,rhost=localhost,raddr=::1,rport=56926,mid=<sie819-8bh73y10780523sdgw_ds7fid385303272d2g-8h723se@email.searchresultsnewinfo.com>,autolearn=no autolearn_force=no
Fri Mar 3 13:01:31 2017 [10093] info: prefork: child states: II
贝叶斯数据库在 /root/.spamassassin 并且子进程无法访问它的问题吗?它应该在哪里,或者是别的什么?在我有限的知识范围内。任何帮助表示赞赏。