我在任何电子邮件中都没有收到bayes分数,尽管我尽了最大的努力,但似乎没有贝氏过滤。我不是Linux和spamassassin专家,所以我要求一些帮助。Spamassassin Bayes无法正常工作
我已经建立了在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的,但最主要的还是服务作为根运行时,孩子似乎是正确产卵。以下是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
我的贝叶斯数据库存在于根:
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的日志的完整片段,而工作显然为根:
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 <[email protected]> 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=<[email protected]>,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 <[email protected]hresultsnewinfo.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=<[email protected]hresultsnewinfo.com>,autolearn=no autolearn_force=no
Fri Mar 3 13:01:31 2017 [10093] info: prefork: child states: II
问题是bayes数据库在/root/.spamassassin中,并且子进程无法访问它?它应该在哪里,还是其他的东西?在我有限的知识结束这一点。任何帮助赞赏。
我的回答如下解决。 –