Clearning Postfix mail queue

Clearing all the mails in Postfix Mail Queue

If you encounter massive spam mails in the plesk mail queue, just execute the command to clear all the mails in the mail queue (make sure that you have figured out the spammer on the server before executing the command otherwise the spam mails will start filling the mail queue again and again).

1 -> Ssh the server as root.

2 – > Stop the postfix mail server to avoid mail queue crash.

/etc/init.d/postfix stop

3 -> Execute the following command :

# for i in `mailq|grep ‘@’ |awk {‘print $1’}|grep -v ‘@’`; do postsuper -d $i ; done

4 -> Now check the mail queue using the following command and make sure no mails inside the queue.


5 -> Start the postfix server again.

Tags : Clearning mails in plesk postfix , How to clear mails in plesk postfix , Clearing spams in plesk mail queue