7.配置Amavis, ClamAV, and SpamAssassin

不管现实多么惨不忍睹,都要持之以恒地相信,这只是黎明前短暂的黑暗而已。不要惶恐眼前的难关迈不过去,不要担心此刻的付出没有回报,别再花时间等待天降好运。真诚做人,努力做事!你想要的,岁月都会给你。7.配置Amavis, ClamAV, and SpamAssassin,希望对大家有帮助,欢迎收藏,转发!站点地址:www.bmabk.com,来源:原文

7.配置Amavis, ClamAV, and SpamAssassin
添加用户:

[plain] view plaincopy

- adduser clamav amavis  
- adduser amavis clamav

编辑/etc/amavis/conf.d/15-content_filter_mode文件配置内容过滤模式

[plain] view plaincopy

use strict;  
   
#You can modify this file to re-enable SPAM checking through spamassassin  
#and to re-enable antivirus checking.  
   
#  
#Default antivirus checking mode  
#Please note, that anti-virus checking is DISABLED by  
#default.  
#If You wish to enable it, please uncomment the following lines:  
   
@bypass_virus_checks_maps = (                        //13行
   \%bypass_virus_checks, \@bypass_virus_checks_acl, \$bypass_virus_checks_re);  
   
#  
#Default SPAM checking mode  
#Please note, that anti-spam checking is DISABLED by  
#default.  
#If You wish to enable it, please uncomment the following lines:  
   
@bypass_spam_checks_maps = (                          //24行
   \%bypass_spam_checks, \@bypass_spam_checks_acl, \$bypass_spam_checks_re);  
   
1;  # ensure a defined return

现在通过编辑 /etc/default/spamassassin的这些行来激活SpamAssassin :

[plain] view plaincopy

8行
#Change to one to enable spamd  
ENABLED=1

[plain] view plaincopy

31行
#Cronjob  
#Set to anything but 0 to enable the cron job to automatically update  
#spamassassin’s rules on a nightly basis  
CRON=1

重启相关服务

[plain] view plaincopy

service amavis restart  
service spamassassin restart 

mailserv@mail:/etc/dovecot/conf.d$ sudo service spamassassin stop
Stopping SpamAssassin Mail Filter Daemon: spamd.
mailserv@mail:/etc/dovecot/conf.d$ sudo service spamassassin start
Starting SpamAssassin Mail Filter Daemon: spamd.

8.配置postfix

先添加几个新文件让postfix用mysql来管理

vi /etc/postfix/mysql_virtual_alias_domainaliases_maps.cf

[plain] view plaincopy

user = mail  
password = mailpassword  
hosts = 127.0.0.1  
dbname = mail  
query = SELECT goto FROM alias,alias_domain  
WHERE alias_domain.alias_domain = ‘%d’  
AND alias.address=concat(‘%u’, ‘@’, alias_domain.target_domain)  
AND alias.active = 1

vi /etc/postfix/mysql_virtual_alias_maps.cf

[plain] view plaincopy

user = mail  
password = mailpassword  
hosts = 127.0.0.1  
dbname = mail  
table = alias  
select_field = goto  
where_field = address  
additional_conditions = and active = ‘1’

vi /etc/postfix/mysql_virtual_domains_maps.cf

[plain] view plaincopy

user = mail  
password = mailpassword  
hosts = 127.0.0.1  
dbname = mail  
table = domain  
select_field = domain  
where_field = domain  
additional_conditions = and backupmx = ‘0’ and active = ‘1’

vi /etc/postfix/mysql_virtual_mailbox_domainaliases_maps.cf

[plain] view plaincopy

user = mail  
password = mailpassword  
hosts = 127.0.0.1  
dbname = mail  
query = SELECT maildir FROM mailbox, alias_domain  
WHERE alias_domain.alias_domain = ‘%d’  
AND mailbox.username=concat(‘%u’, ‘@’, alias_domain.target_domain )  
AND mailbox.active = 1

vi /etc/postfix/mysql_virtual_mailbox_maps.cf

[plain] view plaincopy

user = mail  
password = mailpassword  
hosts = 127.0.0.1  
dbname = mail  
table = mailbox  
select_field = CONCAT(domain, ‘/’, local_part)  
where_field = username  
additional_conditions = and active = ‘1’

创建/etc/postfix/header_checks,添加一些头信息

[plain] view plaincopy

/^Received:/                 IGNORE  
/^User-Agent:/               IGNORE  
/^X-Mailer:/                 IGNORE  
/^X-Originating-IP:/         IGNORE  
/^x-cr-[a-z]*:/              IGNORE  
/^Thread-Index:/             IGNORE

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

文章由极客之音整理,本文链接:https://www.bmabk.com/index.php/post/160532.html

(0)
飞熊的头像飞熊bm

相关推荐

发表回复

登录后才能评论
极客之音——专业性很强的中文编程技术网站,欢迎收藏到浏览器,订阅我们!