amavis + SA不会将邮件标记为垃圾邮件

我正在运行Postfix + amavis + SpamAssassin。 消息正在通过,正如我所期望的那样,他们正在获得X-Spam-Score ,同时还有X-Spam-Status值,这意味着SA正在为他们做点什么。 不幸的是,amavis似乎并不想把它们标记为垃圾邮件,因为所有的邮件都是通过X-Spam-Flag: NO进入的X-Spam-Flag: NO

我现在正在看的示例消息具有以下标题:

 X-Virus-Scanned: Debian amavisd-new at magni X-Spam-Flag: NO X-Spam-Score: 11.733 X-Spam-Level: *********** X-Spam-Status: No, score=11.733 tests=[BAYES_99=3.5, HTML_MESSAGE=0.001, MIME_HTML_ONLY=1.457, RCVD_IN_BL_SPAMCOP_NET=1.96, RCVD_IN_PBL=0.905, RCVD_IN_SORBS_DUL=0.877, RCVD_IN_XBL=3.033] autolearn=no 

这是我的amavisd.conf文件:

 $mydomain = ""; $MYHOME = '/var/amavisd'; $TEMPBASE = "$MYHOME/tmp"; $inet_socket_port = 10024; $forward_method = 'smtp:127.0.0.1:10025'; $notify_method = $forward_method; # @local_domains_acl = qw( "." ); # you may want to use qw() to check all in and out $sa_tag_level_deflt = -999; # add spam info headers if at, or above that level $sa_tag2_level_deflt = 5.0; # add 'spam detected' headers at that level $sa_kill_level_deflt = 999; # triggers spam evasive actions $sa_debug = 1; $final_virus_destiny = D_DISCARD; # (defaults to D_BOUNCE) $final_banned_destiny = D_REJECT; # (defaults to D_BOUNCE) $final_spam_destiny = D_PASS; # (defaults to D_REJECT but we're tagging and passing) $spam_admin = "postmaster\@$mydomain"; $spam_lovers{lc("postmaster\@$mydomain")} = 1; $virus_admin = "postmaster\@$mydomain"; $QUARANTINEDIR = undef; $virus_quarantine_to = undef; #$spam_quarantine_to = 'spam-quarantine'; $remove_existing_spam_headers = 0; $sa_local_tests_only = 0; # (default: false) $SYSLOG_LEVEL = 'mail.err'; $DO_SYSLOG = 1; $log_level = 2; $enable_dkim_verification = 0; # @bypass_spam_checks_maps = (1); @lookup_sql_dsn = ( 'DBI:mysql:database=postfix;host=127.0.0.1;port=3306', '', '' ); $sql_select_policy = 'SELECT "Y" as local FROM aliases WHERE source IN (%k) UNION SELECT "Y" as local FROM users WHERE address IN (%k)'; 1; 

有任何想法吗?

更新:我一直坚持的消息:

 X-Spam-Flag: NO X-Spam-Score: 14.085 X-Spam-Level: ************** X-Spam-Status: No, score=14.085 tests=[BAYES_99=3.5, NO_DNS_FOR_FROM=1.496, RAZOR2_CF_RANGE_51_100=0.5, RAZOR2_CF_RANGE_E8_51_100=1.5, RAZOR2_CHECK=0.5, RCVD_IN_XBL=3.033, RDNS_NONE=0.1, URIBL_BLACK=1.955, URIBL_JP_SURBL=1.501] autolearn=no 

在邮件日志中有这个条目:

 mail.log.1:Sep 5 21:43:39 magni amavis[25486]: (25486-10) Passed CLEAN, [78.189.26.137] [88.206.193.68] <[email protected]> -> <gms8994>, Message-ID: <[email protected]>, mail_id: 4Moi5p2dOV-I, Hits: 14.085, size: 891, queued_as: AFF8C2C367, 1156 ms 

正如Dave Drager所build议的那样,我会试着阻止垃圾邮件,看看会发生什么。

UPDATE2:停止spamassassin,让amavis运行,刚刚得到这个消息:

 X-Spam-Flag: NO X-Spam-Score: 17.712 X-Spam-Level: ***************** X-Spam-Status: No, score=17.712 tests=[BAYES_99=3.5, FH_FROMEML_NOTLD=2.696, RAZOR2_CF_RANGE_51_100=0.5, RAZOR2_CF_RANGE_E8_51_100=1.5, RAZOR2_CHECK=0.5, RCVD_ILLEGAL_IP=1.908, RCVD_IN_SORBS_WEB=0.619, RCVD_IN_XBL=3.033, URIBL_BLACK=1.955, URIBL_JP_SURBL=1.501] autolearn=failed 

与这在日志中:

 mail.log:Sep 9 08:49:11 magni amavis[13604]: (13604-10) Passed CLEAN, [77.70.121.78] [77.70.121.78] <trfq@pc-2bb82028ef37> -> <[email protected]>, Message-ID: <[email protected]>, mail_id: Lg-rCSg9x0rr, Hits: 17.712, size: 844, queued_as: 8269D2BF6B, 2312 ms 

每@cite,我看着/etc/amavis/conf.d/50-user(我实际上正在运行debian)。 它是空的。 我将configuration从/etc/amavis/amavisd.conf移到了50个用户,然后重新启动,现在邮件被标记为X-Spam-Flag: YES 。 要点引用。

您需要提供更详细的日志logging输出来解决这个问题:停止amavisd并以debugging模式重新启动它( amavisd debug ,在Debian / Ubuntu上它可能是amavisd-new debug ,但是因为你提到你configurationamavisd与amavisd.conf而不是/etc/amavis/conf.d/50-user ,我想你不在Debian / Ubuntu上)。 当你这样做的时候,你可能想要在你的邮件服务器的外部接口上禁用邮件服务器的Postfix SMTP端口25监听器(你总是可以在本地提交邮件)否则你可能会得到一些太多的日志,所以把它们放在/etc/postfix/master.cf并取消注释相应的条目(不要忘记postfix reload )。

此外,为了避免$sa_debug屏幕,请暂时从amavisd.conf移除$sa_debug设置,但如果找不到问题的原因(并尝试检查自动学习失败的原因),请重新启用它。

还有两个关于你的configuration的评论,这些评论与你的问题没有什么关系:

  1. $sa_kill_level_deflt设置$sa_kill_level_deflt $sa_tag2_level_deflt – 无论如何,您的最终垃圾邮件命运是D_PASS
  2. 设置$sa_tag_level_defltundef

针对Dave的评论:amavisd-new默认情况下不使用spamd,所以重新启动spamd是毫无意义的。 而且,你无法修改amavisd-new从Spamassassin的configuration中处理给定内容类别的消息(这里是:CC_SPAM)。

检查Amavis日志。 我发现,如果Spamassassin已经在运行(使用不同的configuration文件,具有不同的variables集),那么Amavis发送给Spamassassin的值可能不起作用。 我想你会发现Spamassassin正在运行,Amavis正在使用它,而不是为它产生自己的进程。 试着杀死Spamassassin,看Amavis是否开始使用上面提到的variables(因为它会产生自己的进程)。