Postfix郵件服務器可以在接收郵件時使用content_filter來掃描郵件(病毒,廣告等).通過整合一個集中化的電子郵件內容過濾器,比如amavis或mailscanner,Postfix可以利用單次調用來進行多個掃描.這非常好,但是有些過濾器很難或者幾乎不可能整合到一個集中化的過濾器中.這是一個問題,尤其是你的Postfix系統已經安裝了某些集中化的content_filter.我們能解決這個問題嗎,當然可以.這個文檔將給出許多可能的解決方案中的一種.你的步驟可能不一樣,根據你的配置而定.
在案例中,我們假設我們需要一個運行Postfix,Amavis(包含各種插件)和Avira MailGate的郵件系統.Postfix已經配置為使用Amavis系統作為content_filter.MailGate 不能通過Amavis進行整合,因此它要使用一個單獨的content_filter.
Amavis配置:Amavis監聽10026端口,然后通過10027端口進行轉發.
代碼如下 復制代碼 $inet_socket_port = 10026;forward_method => 'smtp:[127.0.0.1]:10027';
MailGate配置:MailGate監聽20024端口,然后通過20025端口進行轉發.
代碼如下 復制代碼 ListenAddress localhost port 20024ForwardTo SMTP: localhost port 20025
Postfix需要配置兩個過濾器.這可以通過串接過濾器:進入的郵件首先提交到Postfix Content_filter,(www.111cn.net然后Content_filter將掃描后的郵件傳給Postfix.掃描后的郵件再傳給第二個Content_filter.最后再送到用戶手中.我們的鏈是這樣的:Postfix > MailGate > Postfix > Amavisd-new >
更多詳細內容請查看:http://www.111cn.net/sys/linux/56556.htm
Postfix > Usermain.cf:
content_filter = smtp:127.0.0.1:20024master.cf
localhost:20025 inet n - n - - smtpd-o content_filter=smtp:127.0.0.1:10026127.0.0.1:10027 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=
就這樣,Postfix提交所有進來的郵件到20024端口的MailGate,MailGate再將掃描的結果傳回到20025的Postfix.Postfix在20025端口運行著一個額外的SMTP服務,這個服務也包含了一個content_filter,因此所有到達20025端口的郵件會再傳給10026端口.Amavis監聽著10026端口,因此郵件將被Aamavis掃描.掃描完成后Amavis將郵件傳送到10027端口.而在10027端口上運行著另外一個Postfix提供的SMTP服務,至此郵件到達鏈的終點,郵件將被郵遞給用戶.如果你需要關于這個話題的更多信息,請發郵件至robin.diederen@Gmail.com.111cn.net
另外一個配置樣例可能如下:
代碼如下 復制代碼 In main.cf:
# send email to amavisdcontent_filter = amavisd:[127.0.0.1]:10024In master.cf:
# amavisdamavisd unix - - n - 2 lmtp-o lmtp_data_done_timeout=1200s-o disable_dns_lookups=yes
# receive email from amavisd# and then send email to altermine127.0.0.1:10025 inet n - n - - smtpd-o content_filter=altermine
# receive email from 127.0.0.1:10025altermine unix - - n - 2 pipe...
# receive email from altermine127.0.0.1:20025 inet n - n - - smtpd-o content_filter=-o ...
整個流程為: postfix -> amavisd:[127.0.0.1]:10024 -> postfix -> altermine -> postfix -> user
新聞熱點
疑難解答