Main menu

Delete mailq postfix or sendmail

It’s a most command issue with local mail servers on Linux that you find a large mail queue of email. Many services and programs having email feature at default. Sometime they or some spammer script send tons of emails through your email server and you need to clean all of them just in one click. Here we will see How can you  permanently delete all e-mail messages in postfix or sendmail queues.

you can list all message which are not delivered by command

 # mailq

To delete these all queued mail

# postfix flush

in sendmail your can try to resend these emails and flush them

# sendmail -q

or can menaully delete all mail by

# rm -rvf /var/mqueue/*

To remove all mails from postfix  mail queue :

# postsuper -d ALL

To remove all mails in the postfix  deferred queue, enter :

# postsuper -d ALL deferred