因为我的新项目,我刚刚开始与垃圾邮件进行斗争。 我将解释这个系统的结构。
我们有Postfix作为中继服务器上的MTA和新鲜的Spamassasian和Policyd(v2 Cluebringer)插件。 这些工作正常,并在日志文件中产生良好的输出。
我在这个模式中的问题,我怎么能知道哪个插件正在工作?
为什么我想学习这个:
最好的祝福。
postconf -M
smtp inet n - - - - smtpd -o content_filter=spamassassin pickup unix n - - 60 1 pickup cleanup unix n - - - 0 cleanup qmgr unix n - n 300 1 qmgr tlsmgr unix - - - 1000? 1 tlsmgr rewrite unix - - - - - trivial-rewrite bounce unix - - - - 0 bounce defer unix - - - - 0 bounce trace unix - - - - 0 bounce verify unix - - - - 1 verify flush unix n - - 1000? 0 flush proxymap unix - - n - - proxymap proxywrite unix - - n - 1 proxymap smtp unix - - - - - smtp relay unix - - - - - smtp showq unix n - - - - showq error unix - - - - - error retry unix - - - - - error discard unix - - - - - discard local unix - nn - - local virtual unix - nn - - virtual lmtp unix - - - - - lmtp anvil unix - - - - 1 anvil scache unix - - - - 1 scache spamassassin unix - nn - - pipe user=spamd argv=/usr/bin/spamc -f -e /usr/sbin/sendmail -oi -f ${sender} ${recipient} policy-spf unix - nn - - spawn user=nobody argv=/usr/sbin/postfix-policyd-spf-perl maildrop unix - nn - - pipe flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient} uucp unix - nn - - pipe flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient) ifmail unix - nn - - pipe flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient) bsmtp unix - nn - - pipe flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient scalemail-backend unix - nn - 2 pipe flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension} mailman unix - nn - - pipe flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py ${nexthop} ${user}
postconf -n
alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases append_dot_mydomain = no biff = no config_directory = /etc/postfix inet_interfaces = all mailbox_command = procmail -a "$EXTENSION" mailbox_size_limit = 0 mydestination = localdomain, localhost, localhost.localdomain, localhost myhostname = UNKNOWN mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128, ~~~RELAY SERVER IP~~~ readme_directory = no recipient_delimiter = + relayhost = smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) smtpd_end_of_data_restrictions = check_policy_service inet:127.0.0.1:10031, permit_mynetworks smtpd_recipient_restrictions = check_policy_service inet:127.0.0.1:10031, permit_mynetworks smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtpd_use_tls = yes
在你的configuration上面,你有Spamassassin和Policyd(v2 Cluebringer)。
由于这种configuration,电子邮件被送到了Policyd
smtpd_end_of_data_restrictions = check_policy_service inet:127.0.0.1:10031
这意味着后缀将发送电子邮件到端口10031侦听的Policyd。您可以在此页面find有关check_policy_service参数: Postfix SMTP访问策略委派
另一方面,您使用这一行configuration向SpamAssassin发送电子邮件
smtp inet n - - - - smtpd -o content_filter=spamassassin
你可以在Postfix After-Queue内容filter上find这个设置。
那么,附加的顺序是什么?
这里是后缀filter的简化图
email ---> smtpd ---> check_policy_service ---> qmgr ---> SpamAssasin
Policyd(通过check_policy_service )无法访问电子邮件的标题和正文,因此您可以首先进行轻量级检查。 postfix在邮件排队之后,postfix会把它传递给spamassassin。