我在Debian Squeeze上使用Dovecot,Postfix和AMaViSbuild立了一个邮件服务器,在workaround.org上的教程(Debian Squeeze的ISPmail教程) 。 它使用虚拟域并将域,电子邮件地址和帐户存储在MySQL数据库中。
一切工作正常 – 除了我错过了一些电子邮件标题。
(使用“真正的”垃圾邮件和通过sendmail [email protected] < /usr/share/doc/spamassassin/examples/sample-spam.txt使用GTUBE sendmail [email protected] < /usr/share/doc/spamassassin/examples/sample-spam.txt )
但垃圾邮件让他们的主题发生了变化。 所以我把所有东西都弄对了,不是吗?
如何在我的邮件中find缺less的标题?
这里我的AMaViSconfiguration文件( /etc/amavis/conf.d/50-user )
use strict; # # Place your configuration directives here. They will override those in # earlier files. # # See /usr/share/doc/amavisd-new/ for documentation and examples of # the directives you can use in this file # # see <http://workaround.org/ispmail/squeeze/content-scanning-amavis> $sa_spam_subject_tag = '*** SPAM *** '; $final_spam_destiny = D_PASS; $sa_tag_level_deflt = -9999; # add spam info headers if at, or above that level $sa_tag2_level_deflt = 6.31; # add 'spam detected' headers at that level @lookup_sql_dsn = ([ 'DBI:mysql:database=mailserver;host=127.0.0.1;port=3306', 'mailuser', 'password' ]); $sql_select_policy = 'SELECT name FROM virtual_domains WHERE CONCAT("@",name) IN (%k)'; #------------ Do not modify anything below this line ------------- 1; # ensure a defined return
如果你需要更多的configuration文件,日志输出或其他东西,请在下面留言,我会用你需要的信息更新我的文章:-)
你检查了这个参数:@local_domains_acl
它在/etc/amavis/conf.d/05-domain_id上定义。 根据http://www.ijs.si/software/amavisd/上的Amavisd新文档:
没有垃圾邮件相关的标头插入? 这是一些原因:
检查这个命令的输出: head -n 1 /etc/mailname
如果您的域名不能精确到您的域名,Amavisd将不会对您的电子邮件标题进行任何更改。 如果您想要强制添加X-Spam- *标题,则可以添加如下内容: @local_domains_acl = ( "." ); 在/etc/amavis/conf.d/50-user上
(这真的是对以前的答案的评论,但声誉系统不会让我)
设置@local_domains_acl = ( "." )为我工作,但它似乎是一个相当钝的工具(即垃圾邮件处理所有邮件,进出)。 尝试了一些替代品,我最终发现,包括localhost也将帮助(我正在testing一个交付服务在同一个盒子)。 因此,在/etc/amavis/conf.d/50-user我有类似的东西:
@local_domains_acl = ( ".mydomain.example.org", "localhost" );
我看到添加了垃圾邮件头的邮件。
(我的testing设置是Ubuntu 14.04服务器,后缀,amaviz,spamassassin,都是从标准的Ubuntu软件库安装的。)
命令head -n 1 /etc/mailname必须是您的域,如example.com 。
如果输出类似mail.example.com , 那就是bug 。
所以,你可以通过修改文件/etc/amavis/conf.d/05-domain_id来解决这个/etc/amavis/conf.d/05-domain_id
解决scheme#1
在/etc/amavis/conf.d/05-domain_id :
更改:
chomp($mydomain = `head -n 1 /etc/mailname`);
至:
chomp($mydomain = `hostname -d`);
PS: hostname -d的输出必须是您的域名,例如example.com 。
最简单的解决scheme:
在/etc/amavis/conf.d/05-domain_id :
更改:
chomp($mydomain = `head -n 1 /etc/mailname`);
至:
$mydomain = "example.com";