使用者工具

網站工具


tech:mailtool

整理處理 sendmail / postfix 的工具

刪除與搬移 mqueue 信件

postfix

sendmail

  • 下載 qtool.pl 工具
    su - root
    wget http://www.cyberciti.biz/files/perl/qtool.pl.txt
    mv qtool.pl.txt qtool.pl
    chmod a+x qtool.pl
  • 查看 mail queue
    mailq
    [[email protected] ~]# 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)
                                             <[email protected]
    :
    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
    
  • 查看 s5I7HYV3002743 信件內容
    cat /var/spool/mqueue/dfs5I7HYV3002743 
  • 確認要刪除 s5I7HYV3002743
    ./qtool.pl -d /var/spool/mqueue/s5I7HYV3002743
  • 再透過 mailq 可以看到這筆已經消失
tech/mailtool.txt · 上一次變更: 2018/08/20 15:36 由 Jonathan Tsai