Postfix不重试发送延期电子邮件

我有一个运行的Postfix服务器,并有发送电子邮件被延迟的问题根本不重试。 它们出现在队列中,但从未处理。 如果我手动处理队列(通过pfqueue或postqueue -f),则电子邮件将正确传送。

那段时间mail.log的输出如下所示:

Oct 6 12:19:37 example postfix/pickup[19048]: 8031D405F5: uid=1000 from=<[email protected]> Oct 6 12:19:37 example postfix/cleanup[19049]: 8031D405F5: message-id=<[email protected]> Oct 6 12:19:37 example opendkim[1433]: 8031D405F5: DKIM-Signature field added (s=mail, d=example.de) Oct 6 12:19:37 example postfix/qmgr[1565]: 8031D405F5: from=<[email protected]>, size=984, nrcpt=1 (queue active) Oct 6 12:19:38 example postfix/smtp[19051]: 8031D405F5: to=<[email protected]>, relay=mx.xxx.net[xxx.xxx.xxx.xxx]:25, delay=1.2, delays=0.05/0.01/0.41/0.7, dsn=4.7.1, status=deferred (host mx.xxx.net[xxx.xxx.xxx.xxx] said: 451 4.7.1 Greylisted - try again in 300 seconds (in reply to RCPT TO command)) 

我有以下configuration运行(从postconf -n输出):

 alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases append_dot_mydomain = no biff = no bounce_queue_lifetime = 2h inet_interfaces = loopback-only inet_protocols = ipv4 mailbox_size_limit = 0 maximal_backoff_time = 15m maximal_queue_lifetime = 2h milter_default_action = accept milter_protocol = 2 minimal_backoff_time = 5m mydestination = example.com, localhost.example.com myhostname = example.com mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 myorigin = /etc/mailname non_smtpd_milters = inet:localhost:12301 queue_run_delay = 5m readme_directory = no recipient_delimiter = + relayhost = smtp_tls_security_level = may smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) smtpd_milters = inet:localhost:12301 smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination smtpd_tls_cert_file = /etc/letsencrypt/live/www.example.com/fullchain.pem smtpd_tls_key_file = /etc/letsencrypt/live/www.example.com/privkey.pem smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtpd_use_tls = yes 

我如何让Postfix自动重试队列?

谢谢!

在目标邮件服务器上使用灰名单可能会阻止电子邮件被及时传送(您的maximal_queue_lifetime设置为2h)。 我会恢复下面的值回到理智的默认值,并从那里调整。

来自: http : //www.postfix.org/TUNING_README.html

queue_run_delay=300s (默认值:300秒; Postfix 2.4:1000s之前)队列pipe理器扫描延迟邮件队列的频率。

minimal_backoff_time=300s (默认值:300秒; Postfix 2.4:1000s之前)消息不会被查看的最less时间,以及远离“死”目标的最less时间。

maximal_backoff_time=4000s (默认值:4000秒)传递失败后邮件不会被查看的最大时间量。

maximal_queue_lifetime=5d (默认值:5天)邮件在发送回无法投递之前,邮件在队列中保留多久。 为在第一次不成功传送尝试之后应立即返回的邮件指定0。

bounce_queue_lifetime=5d (默认:5天,可用于Postfix版本2.1和更高版本)MAILER-DAEMON消息在被认为无法传送之前,多长时间停留在队列中。 为只应尝试一次的邮件指定0。

我希望这有帮助。

在Postfix日志中有以下信息:

 Oct 6 13:57:51 xxx postfix[47965]: Postfix is running with backwards-compatible default settings Oct 6 13:57:51 xxx postfix[47965]: See http://www.postfix.org/COMPATIBILITY_README.html for details Oct 6 13:57:51 xxx postfix[47965]: To disable backwards compatibility use "postconf compatibility_level=2" and "postfix reload" 

我从来没有想过,但我决定添加compatibility_level=2到我的configuration文件。 此后队列pipe理器正常工作。

由于这是我所做的唯一改变,我相当确定这是造成问题的原因。 之前几次重启Postfix和服务器,所以一个简单的电力循环不是原因。

也许这对某个人有帮助。