我在任何電子郵件中都沒有收到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中,並且子進程無法訪問它?它應該在哪裏,還是其他的東西?在我有限的知識結束這一點。任何幫助讚賞。
我的回答如下解決。 –