7、修改postfix的配置,让它能调用amavisd,以实现病毒及垃圾邮件的过滤

1vi /etc/postfix/master.cf
在文末添加如下内容:
##########################################
# service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (yes) (never) (100)
#
#################################################
amavisfeed unix - - n - 2 smtp
-o smtp_data_done_timeout=1200
-o smtp_send_xforward_command=yes
-o disable_dns_lookups=yes
-o max_use=20
#
127.0.0.1:10025 inet n - n - - smtpd
-o content_filter=
-o smtpd_delay_reject=no
-o smtpd_client_restrictions=permit_mynetworks,reject
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,reject
-o smtpd_data_restrictions=reject_unauth_pipelining
-o smtpd_end_of_data_restrictions=
-o smtpd_restriction_classes=
-o mynetworks=127.0.0.0/8
-o smtpd_error_sleep_time=0
-o smtpd_soft_error_limit=1001
-o smtpd_hard_error_limit=1000
-o smtpd_client_connection_count_limit=0
-o smtpd_client_connection_rate_limit=0
-o receive_override_options=no_header_body_checks,no_unknown_recipient_checks,no_milters
-o local_header_rewrite_clients=
说明:注意每行“-o”前的空格;
 
2#vi /etc/postfix/main.cf
在文末添加如下行:
content_filter=amavisfeed:[127.0.0.1]:10024
 

8、让postfix重新加载主配置文件,并查看启动情况

#service postfix stop
#service postfix start 

9、查看amavisd是否在监听10024端口,并测试服务启动情况:

# netstat -nltp |grep 10024
tcp        0      0 127.0.0.1:10024             0.0.0.0:*                   LISTEN      30744/amavisd (mast

10postfix重新加载配置文件后将授权并激活"127.0.0.1:10025"端口,一个正常的服务连接应该类同下面

# netstat -nltp |grep 10025
tcp        0      0 127.0.0.1:10025             0.0.0.0:*                   LISTEN      30712/master
 
 
后续会贴出来关于过滤垃圾邮件或者其他功能的相关文章.