我们在CentOS服务器上使用postfix来接收收到的邮件,然后做一些过滤,然后把邮件发送到我们真正的邮件服务器,在那里我们将收取邮件。 后缀服务器在尝试发送到我们真实的邮件服务器时,有时会有很长的延迟。 我们将看到像这样的交付日志:
Sep 01 10:09:52 <hostname> postfix/pickup[18057]: 4mGC2s3EdYa3LNN4: uid=12345 from=<sender-email> orig_id=4oGC2h1ZU4a3LNLd Sep 01 10:09:52 <hostname> postfix/cleanup[28788]: 4mGC2s3EdYa3LNN4: message-id=<id> Sep 01 10:09:53 <hostname> postfix/qmgr[28730]: 4mGC2s3EdYa3LNN4: from=<sender-email>, size=8874, nrcpt=1 (queue active) Sep 01 10:12:44 <hostname> postfix/qmgr[24361]: 4mGC2s3EdYa3LNN4: from=<sender-email>, size=8874, nrcpt=1 (queue active) Sep 01 10:15:49 <hostname> postfix/qmgr[20098]: 4mGC2s3EdYa3LNN4: from=<sender-email>, size=8874, nrcpt=1 (queue active) Sep 01 10:17:50 <hostname> postfix/qmgr[29129]: 4mGC2s3EdYa3LNN4: from=<sender-email>, size=8874, nrcpt=1 (queue active) Sep 01 10:20:09 <hostname> postfix/qmgr[30381]: 4mGC2s3EdYa3LNN4: from=<sender-email>, size=8874, nrcpt=1 (queue active) Sep 01 10:22:05 <hostname> postfix/qmgr[15028]: 4mGC2s3EdYa3LNN4: from=<sender-email>, size=8874, nrcpt=1 (queue active) Sep 01 10:25:11 <hostname> postfix/qmgr[12533]: 4mGC2s3EdYa3LNN4: from=<sender-email>, size=8874, nrcpt=1 (queue active) Sep 01 10:28:33 <hostname> postfix/qmgr[30857]: 4mGC2s3EdYa3LNN4: from=<sender-email>, size=8874, nrcpt=1 (queue active) Sep 01 10:30:16 <hostname> postfix/qmgr[21858]: 4mGC2s3EdYa3LNN4: from=<sender-email>, size=8874, nrcpt=1 (queue active) Sep 01 10:32:41 <hostname> postfix/smtp[26435]: 4mGC2s3EdYa3LNN4: to=<[email protected]>, relay=server.example.com[xxxx]:25, delay=1379, delays=1234/132/3.5/9.6, dsn=2.0.0, status=sent (250 OK) Sep 01 10:32:41 <hostname> postfix/qmgr[12857]: 4mGC2s3EdYa3LNN4: from=<sender-email>, size=8874, nrcpt=1 (queue active)
在这种情况下,我们还没有能够发现“(排队主动)”信息的含义。 “(队列主动)”消息的原因是什么?为什么会在1000秒内造成消息延迟?
我们现在还没有发现什么“(队列主动)”
Postfix维护待处理邮件的队列,“queue active”表示队列中有邮件。
要查看排队的邮件问题:
sudo mailq
要么
sudo postqueue -p
“(队列激活)”消息的原因是什么?
邮件由于传递错误而排队。 这样的错误可能是:DNS错误,完整邮箱或不存在的邮件收件人。
为什么这会导致超过1000秒的消息延迟
队列时间在main.cf文件中configuration。 根据postfix 文档
尝试发送推迟消息之间的最短时间; 在Postfix 2.4之前,默认值是1000s。
如果1000秒太长,您可以更换计时器。 我build议您在进行任何更改之前阅读整个postfix 调优指南 。
最后你可以通过使用刷新队列(强制postfix来立即处理队列)
sudo postqueue -f
要么
sudo postfix flush