Any way to clear the Mail Queue Completely?

So it seems my SMTP service was hacked over the weekend, with someone deciding to use my server to send a whole lot of mail. I've shut down the service and locked down the security hole, but now I have a lot of mail sitting in the queue and it is taking hours to clear it all out by using the Maintenance tab. Is there a quicker, easier way to clear the queue?

XServe, Mac OS X (10.6.5)

Posted on Dec 15, 2010 11:36 AM

Reply
1 reply

Dec 15, 2010 11:47 AM in response to Kung Fu Jedi

Hi

Rather than using Server Admin it's generally agree to use the command line instead.

sudo mailq


This command flushes the mail queue

sudo postfix flush


To re-queue the mail queue

sudo postsuper -r ALL


Command to see what's in the mail queue

sudo postqueue -p


Command to delete everything in the mail queue

sudo postsuper -d ALL


If you've got lots in there it will take some time. You might benefit by stopping the mail service first:

sudo serveradmin stop mail


Use this command to restart the service afterwards:

sudo serveradmin start mail


If you've got a lot of mail in there it will take the time it takes. You will need some patience. This link discusses how you can secure your mail server:

http://osx.topicdesk.com/content/view/38/41/

Some friendly advice. Secure your server further by placing it behind a firewall. Only open ports required by the Mail Service. If you have to open ssh secure it by using ssh-keygens and disable sshd passwords. Beef up all your passwords.

My 2p.

Tony

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Any way to clear the Mail Queue Completely?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.