我想实现一个邮件服务器与后缀+ policyd / amavis + mysql白/黑名单查找。
问题是,我想他们之间有“中间”队列,如果其中一个失败,电子邮件不被拒绝,并保持队列,直到失败点恢复。
我的想法如下:
postfix(25) – > queue – > mysql白/黑名单查找(RBL) – >队列 – > policyd(10031)/ amavis(10014) – > queue – > dspam(sock) – > postfix(10025)/ relay
有了这个想法,如果其中一个“中间”点失败,我不会丢失任何电子邮件,所有的问题都会留在队列中。
我的configuration是:main.cf
... transport_maps = ldap:/etc/postfix/perditionMailhost_ldap content_filter = amavisd-new:[127.0.0.1]:10024 ... smtpd_recipient_restrictions = reject_invalid_hostname, check_client_access mysql:/etc/postfix/client_whitelist check_sender_access mysql:/etc/postfix/sender_whitelist check_recipient_access mysql:/etc/postfix/recipient_whitelist reject_rbl_client multi.uribl.com, reject_rbl_client dsn.rfc-ignorant.org, reject_rbl_client dul.dnsbl.sorbs.net, reject_rbl_client list.dsbl.org, reject_rbl_client sbl-xbl.spamhaus.org, reject_rbl_client bl.spamcop.net, reject_rbl_client dnsbl.sorbs.net, reject_rbl_client cbl.abuseat.org, reject_rbl_client ix.dnsbl.manitu.net, reject_rbl_client combined.rbl.msrbl.net, reject_rbl_client rabl.nuclearelephant.com, check_policy_service inet:127.0.0.1:10031, permit_mynetworks, reject smtpd_end_of_data_restrictions = check_policy_service inet:127.0.0.1:10031 smtpd_helo_required = yes disable_vrfy_command = yes invalid_hostname_reject_code = 554 non_fqdn_reject_code = 554 ...
master.cf
smtp inet n - n - 200 smtpd -v pickup fifo n - n 60 1 pickup cleanup unix n - n - 0 cleanup qmgr fifo n - n 300 1 qmgr tlsmgr unix - - n 1000? 1 tlsmgr rewrite unix - - n - - trivial-rewrite bounce unix - - n - 0 bounce defer unix - - n - 0 bounce trace unix - - n - 0 bounce verify unix - - n - 1 verify flush unix n - n 1000? 0 flush proxymap unix - - n - - proxymap proxywrite unix - - n - 1 proxymap smtp unix - - n - - smtp amavisd-new unix - - n - 2 smtp -o smtp_data_done_timeout=1200s -o disable_dns_lookups=yes relay unix - - n - - smtp -o smtp_fallback_relay= -o disable_dns_lookups=yes showq unix n - n - - showq error unix - - n - - error retry unix - - n - - error discard unix - - n - - discard local unix - nn - - local virtual unix - nn - - virtual lmtp unix - - n - - lmtp anvil unix - - n - 1 anvil scache unix - - n - 1 scache 127.0.0.1:10025 inet n - n - - smtpd -o content_filter= -o local_recipient_maps= -o relay_recipient_maps= -o smtpd_restriction_classes= -o smtpd_client_restrictions= -o smtpd_helo_restrictions= -o smtpd_sender_restrictions= -o smtpd_recipient_restrictions=permit_mynetworks,reject -o mynetworks=127.0.0.0/8 -o strict_rfc821_envelopes=yes
任何帮助如何做到这一点? 甚至,我不确定是否有可能。
感谢和问候。
你需要一个额外的postfix smtp实例,为中间队列监听不同的端口。
处理应该是这样的:
amavisd注入电子邮件到中间新的smtp进程,监听某个端口,例如11025.你需要在amavisdconfiguration中设置: $forward_method = 'smtp:[127.0.0.1]:1025'; 中间的smtp应该有content_filer指令,指向dspam,
127.0.0.1:11025 inet n - n - - smtpd -o content_filter=dspam: