您的位置:首页 > 产品设计 > UI/UE

Postfix queue(邮件队列) 管理

2013-11-18 10:43 381 查看
From time
to time
the mail queue may get filled up. This may be due to network problems or misconfiguration.
For instance,
if you botch (typo)
the relayhost parameter,
the mail will be undeliverable.
The first thing to do is fix
the problem, meaning get
the network back online, or fix
the configuration.

1. try and deliver the mail from the queue(强制发送队列中的邮件):

$ postfix flush or $ postqueue -f

2. check mail queue size (查看队列大小):

$ mailq | wc -l

3. list mails in queue (查看队列中的邮件):

$ postqueue -p or $ mailq

4.put all deferred mail “on hold” so that no attempt is made to deliver it(暂缓发送队列中的问题邮件):

$ postsuper -h ALL deferred

5. release mail that was put “on hold”(解除暂缓发送):

$ postsuper -H ALL deferred

6. purge all deferred emails from the queue without delivering (删除队列中问题的邮件):

$ postsuper -d ALL deferred $ find /var/spool/postfix/deferred -type f -exec rm -vf {} \;

7. purge specific email from the queue by specifying its message ID (按邮件ID删除队列中的邮件):

$ postsuper -d 0C0FF240F2

8. 删除已经三天未发出的邮件

$ find /var/spool/postfix/deferred -type f -mtime +3 -exec rm -f {} \;

9. 列出所有问题邮件

$ find /var/spool/postfix/deferred -type f \ -exec ls -l --time-style=+%Y-%m-%d_%H:%M:%S {} \;

10. 删除超过5天的问题邮件的退信记录

$ find /var/spool/postfix/defer -type f -mtime +5 -exec rm -f {} \;

11. 复杂用法:利用grep得到特定的邮件ID,再删除,如:

$ mailq | grep -B 1 "Hotconcerts@gmail.com" | cut -f 1 -d ! > deletionIDs" $ cat deletionIDs | postsuper -d -

From:http://www.tigerdad.cn/postfix-queue-mail-queue-management.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: