Postfix queue(郵件隊列) 管理

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 -execrm-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-execrm-f{} \;

9. 列出所有問題郵件

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

10. 刪除超過5天的問題郵件的退信記錄

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

11. 複雜用法:利用grep得到特定的郵件ID,再刪除,如:

$ mailq |grep-B1"[email protected]"|cut-f1-d!> deletionIDs" $ cat deletionIDs | postsuper -d -

From:http://www.tigerdad.cn/postfix-queue-mail-queue-management.html


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章