我已将 Postfix 配置为将所有电子邮件发送到智能主机,它可以正常工作数周。但是它时不时地停止工作并在日志中显示诸如此类的消息(前两行是最后一次成功发送,后两行是第一条失败的消息):
Nov 24 20:05:30 nextcloud postfix/smtp[443568]: 3882C1B5D8A: to=<xxxxxx>, relay=relay.grnet.gr[83.212.2.185]:587, delay=2.3, delays=1.3/0/0.02/1, dsn=2.0.0, status=sent (250 OK id=1oyGbJ-0001PM-H2)
Nov 24 20:05:30 nextcloud postfix/qmgr[193834]: 3882C1B5D8A: removed
Nov 24 20:44:43 nextcloud postfix/postfix-script[1563]: warning: symlink leaves directory: /etc/postfix/./makedefs.out
Nov 24 20:44:46 nextcloud postfix/postfix-script[1751]: warning: /var/spool/postfix/etc/resolv.conf and /etc/resolv.conf differ
Nov 24 20:44:46 nextcloud postfix/postfix-script[1772]: starting the Postfix mail system
Nov 24 20:44:46 nextcloud postfix/master[1774]: daemon started -- version 3.4.13, configuration /etc/postfix
Nov 24 21:05:19 nextcloud postfix/smtpd[4252]: warning: dict_nis_init: NIS domain name not set - NIS lookups disabled
Nov 24 21:05:19 nextcloud postfix/smtpd[4252]: connect from localhost[127.0.0.1]
Nov 24 21:05:19 nextcloud postfix/smtpd[4252]: E76A51B5819: client=localhost[127.0.0.1]
Nov 24 21:05:20 nextcloud postfix/cleanup[4257]: E76A51B5819: message-id=<[email protected]>
Nov 24 21:05:20 nextcloud postfix/smtpd[4252]: disconnect from localhost[127.0.0.1] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5
Nov 24 21:05:20 nextcloud postfix/qmgr[1776]: E76A51B5819: from=<xxxxxx>, size=37076, nrcpt=1 (queue active)
Nov 24 21:05:21 nextcloud postfix/smtp[4258]: E76A51B5819: to=<xxxxxx>, relay=none, delay=0.36, delays=0.33/0.03/0/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for name=relay.grnet.gr type=MX: Host not found, try again)
后来就一直保持这个状态(有一次卡了大概三个星期才发现);所有消息都失败并保留在队列中。当我重新启动它时,它再次工作,发送所有延迟的消息,并愉快地工作,直到下一次问题出现。
如何将其配置为具有弹性且不需要重新启动?
我在 Ubuntu 20.04 中使用 Postfix 3.4.13。这是/etc/postfix/main.cf
:
myorigin = /etc/mailname
biff = no
compatibility_level = 3
relayhost = relay.grnet.gr:587
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
inet_interfaces = loopback-only
virtual_alias_maps = hash:/etc/postfix/virtual
masquerade_domains = grnet.gr