投げ銭

★当サイトへの投げ銭(PayPal)★

LINK


(無償、寄付歓迎) logo
世界中で使われるISO標準オフィスソフト(MSオフィス互換)

★LibreOfficeの導入事例★
詳細について

人気の投稿(1ヶ月間)

Ad

Ad

投げ銭

★当サイトへの投げ銭(PayPal)★

2016年2月16日火曜日

【Postfix 2.6.6 x86_64】Postfixで溜まっているキューを再配送あるいは削除する【Linux CentOS 6.7 64bit minimal】

Postfixにおいて、送信に失敗したメールはキューに保留され、送信がリトライされる。

送信不能なメールであれば、/var/log/maillog に、送信失敗記録をしばらくは残し続けることになる。

これは、Postfixの再起動でも解放されない。

キューを再配送あるいはすべて削除するには各々次のようにコマンドを実行する。



○念のためにキューを確認した。
mailq
-Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
xxxxxxxxx      326 Tue Feb 16 11:11:11  sendfrom@example.com
(connect to exsample.com:587: Connection timed out)
                                         sendto@example.com

<すべてのキューを再配送する場合>
# postqueue -f


<全てのキューを削除する場合>
(注意!)
# postsuper -d ALL
postsuper: Deleted: 7 messages


○再度、キューを確認した。
#  mailq
Mail queue is empty


◆複数インスタンスでPostfixが動作している場合

代わりに次のコマンドを用いる。


○指定したインスタンスが扱うキューの一覧を得る。

# postqueue -c /etc/postfix-dept-transfer -p
-Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
7E1CD369EB2E      292 Sat May  1 19:00:00  mailto@example.com
(connect to smtp.server.example.com[192.168.1.120]:25: Connection timed out)
                                         envelope-to@example.com

○指定したインスタンスが扱うキューのうち指定したキューを消去する

# postsuper -c /etc/postfix-dept-transfer -d 7E1CD369EB2E
postsuper: 7E1CD369EB2E: removed
postsuper: Deleted: 1 message

○指定したインスタンスが扱う全てのキューを消去する

# postsuper -c /etc/postfix-dept-transfer -d ALL



以上



<参考>
・Flush the Postfix mail queue to force retry
< http://www.networkinghowtos.com/howto/flush-the-postfix-mail-queue-to-force-retry/ > 2016年5月6日

・[Linux][postfix] postfix にてキューにたまったメールの削除方法
< http://blog.kaburk.com/tools/postfix-mailq-delete.html > 2016年2月16日

・POSTQUEUE(1)
< http://www.postfix.org/postqueue.1.html > 2016年3月9日

投げ銭

★当サイトへの投げ銭(PayPal)★

Ad

Ad