差異處

這裏顯示兩個版本的差異處。

連向這個比對檢視

tech:mailtool [2014/06/21 09:11] – 建立 jonathantech:mailtool [2018/08/20 15:36] (目前版本) Jonathan Tsai
行 1: 行 1:
 +====== 整理處理 sendmail / postfix 的工具 ======
 +===== 刪除與搬移 mqueue 信件 =====
 +==== postfix ====
 +  * 主要是使用 postsuper 這指令
 +    - 刪除所有在 Queue 中的郵件 <code sh>
 +postsuper -d ALL
 +</code>
 +    - 刪除還再重試發送的郵件 <code sh>
 +postsuper -d ALL deferred
 +</code>
 +  * 參考網址 : https://blog.miniasp.com/post/2008/03/24/How-to-delete-undelivered-email-in-Postfix.aspx
  
 +==== sendmail ====
 +  * 下載 qtool.pl 工具<code sh>
 +su - root
 +wget http://www.cyberciti.biz/files/perl/qtool.pl.txt
 +mv qtool.pl.txt qtool.pl
 +chmod a+x qtool.pl
 +</code>
 +  * 查看 mail queue <code sh>
 +mailq
 +</code><file>
 +[root@kvm-mail ~]# mailq
 +                /var/spool/mqueue (7 requests)
 +-----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient-----------
 +s5KFWHYA005580      713 Fri Jun 20 23:32 <>
 +                 (Deferred: Connection timed out with dialup-62-11-236-182.cli)
 +                                         <run.payroll.invoice@dialup-62-11-236-
 +:
 +s5I7HYV3002743      580 Wed Jun 18 15:20 <[email protected]>
 +                 (Deferred: Connection timed out with mailx.tcommerce.de.)
 +                                         [email protected]
 +s5I7HYV7002743        1 Wed Jun 18 15:20 <[email protected]>
 +                 (readqf: cannot open ./dfs5I7HYV7002743: No such file or dire)
 +                                         <[email protected]>
 +                Total requests: 7
 +
 +</file>
 +  * 查看 s5I7HYV3002743 信件內容 <code sh>
 +cat /var/spool/mqueue/dfs5I7HYV3002743 
 +</code>
 +  * 確認要刪除 s5I7HYV3002743  <code sh>
 +./qtool.pl -d /var/spool/mqueue/s5I7HYV3002743
 +</code>
 +  * 再透過 mailq 可以看到這筆已經消失
 +  * 參考網址 : http://www.cyberciti.biz/faq/linux-unix-bsd-clear-sendmail-queue/
 +
 +
 +{{tag>sendmail postfix mail 郵件}}