Как удалить письмо из очереди в postfix
Для просмотра всей очереди можно воспользоваться командой mailq
Для удаление используется команда postsuper -d <ID>
Пример использования:
admin@mail: /home/admin # mailq -Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient------- 12439A3B 6593 Tue Sep 13 10:13:16 a.user@mydomain.loc (host alt2.aspmx.l.google.com[173.194.72.26] said: 421-4.7.0 [212.20.35.227 15] Our system has detected that this message is 421-4.7.0 suspicious due to the very low reputation of the sending IP address. 421-4.7.0 To protect our users from spam, mail sent from your IP address has 421-4.7.0 been temporarily rate limited. Please visit 421 4.7.0 https://support.google.com/mail/answer/188131 for more information. t22si25223357pfi.209 - gsmtp (in reply to end of DATA command)) moa@domendst.ru 4AF70AA0 3123647 Tue Sep 13 11:08:39 n.user@mydomain.loc (maildir delivery failed: Sorry, the user's maildir has overdrawn his diskspace quota, please try again later.) i.hlistunova@domendst.ru ... ... -- 14215 Kbytes in 9 Requests.
Как удалить письмо из очереди postfix
Зная id письма удалить можно так:
admin@mail: /home/admin # postsuper -d 12439A3B
Если понадобится удалить все письма от определенного адресата, можно воспользоваться данным скриптом:
admin@mail: /home/admin # mailq|grep 'user@domen'|awk '{print "postsuper -d "$1}'|/bin/bash
Для удаления всей очереди используется ключ -d ALL
postsuper -d ALL
Для более подробного понимания man postsuper