问题原文
原帖链接 · Extra Sauce · CC BY-SA 3.0
We use postfix on a CentOS server to accept incoming mail, then do some filtering, then send the message on to our real mail server where we will pickup the mail. The postfix server sometimes has long delays when it tries to send to our real mail server. We will see delivery logs like this:
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 omitted]>, relay=server.example.com[x.x.x.x]: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)
We haven't been able to discover at this point what the "(queue active)" message means in this situation. What is the cause of the "(queue active)" message, and why does that cause delays in the message over 1000 seconds?
社区高分解答
原帖链接 · pmarkoulidakis · CC BY-SA 3.0
We haven't been able to discover at this point what the "(queue active)"
Postfix maintains queues for the pending mails, "queue active" indicates there are mails in the queue.
To see queued mails issue:
sudo mailq
or
sudo postqueue -p
What is the cause of the "(queue active)" message.
Messages are queued due to delivery errors. Such errors can be: DNS error, a full mailbox or nonexistent mail recipient.
why does that cause delays in the message over 1000 seconds
Queue times are configured in main.cf file. According to postfix documentation
The minimal time between attempts to deliver a deferred message; prior to Postfix 2.4 the default value was 1000s.
If 1000sec is too long for you, you can change the timer. I advise you to read the entire postfix tuning-guide before making any changes.
Finally you can Flush the queue(force postfix to immediately process the queue) by using
sudo postqueue -f
or
sudo postfix flush
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
