Amavis到Postfix转发

我有一个后缀的邮件服务器,并希望使用amavis进行垃圾邮件和病毒检测。 我按照这个教程添加amavis到我的正在运行的邮件服务器。 我添加到/etc/postfix/main.cf:

content_filter = smtp-amavis:[127.0.0.1]:10024 

和我的/etc/postfix/master.cf像这样locking:

 smtp inet n - - - - smtpd submission inet n - - - - smtpd -v -o syslog_name=postfix/submission -o smtpd_tls_security_level=encrypt -o smtpd_sasl_type=dovecot -o smtpd_sasl_path=private/auth -o smtpd_sasl_security_options=noanonymous -o smtpd_sasl_auth_enable=yes -o smtpd_client_restrictions=permit_sasl_authenticated,reject pickup unix n - - 60 1 pickup -o content_filter= -o receive_override_options=no_header_body_checks cleanup unix n - - - 0 cleanup qmgr unix n - n 300 1 qmgr #qmgr unix n - n 300 1 oqmgr 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 # -o smtp_helo_timeout=5 -o smtp_connect_timeout=5 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 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} smtp-amavis 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 ##### Amavis inbound properties ###### 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_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 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 

postconf的输出-n:

 append_dot_mydomain = no biff = no config_directory = /etc/postfix content_filter = smtp-amavis:[127.0.0.1]:10024 inet_interfaces = all inet_protocols = all local_recipient_maps = $virtual_mailbox_maps mailbox_size_limit = 0 mydestination = mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 myorigin = mydomain.com readme_directory = no recipient_delimiter = smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination smtpd_sasl_auth_enable = yes smtpd_sasl_path = private/auth smtpd_sasl_type = dovecot smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3 smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtpd_use_tls = yes virtual_mailbox_domains = mydomain.com virtual_mailbox_maps = ldap:/etc/postfix/virtual/ldap-maps.cf virtual_transport = lmtp:unix:private/dovecot-lmtp 

我尝试发送的所有电子邮件都会获得延迟的日志信息:

  Jan 19 10:28:51 mydomain postfix/smtp[2035]: BB27526F73: to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, delay=2.7, delays=0.13/0.01/0/2.5, dsn=4.5.0, status=deferred (host 127.0.0.1[127.0.0.1] said: 451 4.5.0 id=00944-02 - Temporary MTA failure on relaying, From MTA() during fwd-connect (Negative greeting: at (eval 134) line 479.): id=00944-02 (in reply to end of DATA command)) 

如果我要延期邮件,它将被交付。 但是,在同一个问题得到同样地位之前,没有排队的所有新邮件。

有没有人有任何想法如何解决这个问题?

编辑:这是我的日志还有更多的行日志后重新邮件:

 Jan 19 13:45:13 mydomain postfix/smtpd[2361]: fatal: unexpected command-line argument: ### Jan 19 13:45:14 mydomain postfix/master[2014]: warning: process /usr/lib/postfix/smtpd pid 2361 exit status 1 Jan 19 13:45:14 mydomain postfix/master[2014]: warning: /usr/lib/postfix/smtpd: bad command startup -- throttling Jan 19 13:45:14 mydomain amavis[943]: (00943-06) (!)FWD from <[email protected]> -> <[email protected]>, 451 4.5.0 From MTA() during fwd-connect (Negative greeting: at (eval 134) line 479.): id=00943-06 Jan 19 13:45:14 mydomain amavis[943]: (00943-06) Blocked MTA-BLOCKED {TempFailedInbound}, [xxx.xxx.xxx.xxx]:50237 [xxx.xxx.xxx.xxx] <[email protected]> -> <[email protected]>, Queue-ID: 53094271AF, Message-ID: <[email protected]>, mail_id: eK3SxABQEng1, Hits: 1.438, size: 608, 2797 ms Jan 19 13:45:14 mydomain postfix/smtp[2357]: 53094271AF: to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, delay=2.9, delays=0.12/0.01/0/2.8, dsn=4.5.0, status=deferred (host 127.0.0.1[127.0.0.1] said: 451 4.5.0 id=00943-06 - Temporary MTA failure on relaying, From MTA() during fwd-connect (Negative greeting: at (eval 134) line 479.): id=00943-06 (in reply to end of DATA command)) Jan 19 13:45:16 mydomain postfix/submission/smtpd[2355]: auto_clnt_close: disconnect private/tlsmgr stream Jan 19 13:45:16 mydomain postfix/submission/smtpd[2355]: rewrite stream disconnect Jan 19 13:45:24 mydomain postfix/postsuper[2364]: Requeued: 1 message Jan 19 13:45:49 mydomain postfix/pickup[2293]: 00D21271BA: uid=107 from=<[email protected]> orig_id=53094271AF Jan 19 13:45:49 mydomain postfix/cleanup[2348]: 00D21271BA: message-id=<[email protected]> Jan 19 13:45:49 mydomain postfix/qmgr[2018]: 00D21271BA: from=<[email protected]>, size=727, nrcpt=1 (queue active) Jan 19 13:45:49 mydomain dovecot: lmtp(2369): Connect from local Jan 19 13:45:49 mydomain dovecot: lmtp(2369, [email protected]): wlQ8AX38vFRBCQAAXzmN0w: msgid=<[email protected]>: saved mail to INBOX Jan 19 13:45:49 mydomain postfix/lmtp[2368]: 00D21271BA: to=<[email protected]>, relay=mydomain.localdomain[private/dovecot-lmtp], delay=38, delays=38/0.01/0/0.01, dsn=2.0.0, status=sent (250 2.0.0 <[email protected]> wlQ8AX38vFRBCQAAXzmN0w Saved) Jan 19 13:45:49 mydomain dovecot: lmtp(2369): Disconnect from local: Successful quit Jan 19 13:45:49 mydomain postfix/qmgr[2018]: 00D21271BA: removed 

哦,我觉得很愚蠢

发现了错误。 masegaloeh thx为您的暗示和遗憾的每个人浪费时间的原因,我的愚蠢…

我只是在我的master.cf中放置了一个错误的评论,我在这里发布内容之前删除了,所以我的原始master.cf文件locking如下:

 ##### Amavis inbound properties ###### 127.0.0.1:10025 inet n - n - - smtpd ### stupid commend :( -o content_filter= -o local_recipient_maps= 

Thia maillog线

  Jan 19 13:45:13 mydomain postfix/smtpd[2361]: fatal: unexpected command-line argument: ### 

清楚地指出了master.cf语法上的错误。 你已经在你的答案中证实了这一点。 在这一部分中,我将试图解释为什么邮件通过时,你要求他们。

当你发送命令postsuper - r消息时,postfix将把邮件移动到maildrop队列。 然后pickup守护进程将“挑选”它并尝试传递它。 另一方面,您在拾取过程中禁用amavis content_filter(通过master.cf)。 所以,重复邮件不会经过amavis,因此不会遭受类似上面的错误信息。