Troubleshooting postfix server issues

From Notes_Wiki
Revision as of 16:19, 26 August 2014 by Saurabh (talk | contribs) (Created page with "<yambe:breadcrumb>Postfix_server_configuration|Postfix server configuration</yambe:breadcrumb> =Troubleshooting postfix server issues= ==Deleting all emails from defer, defer...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

<yambe:breadcrumb>Postfix_server_configuration|Postfix server configuration</yambe:breadcrumb>

Troubleshooting postfix server issues

Deleting all emails from defer, deferred, etc. queues

If accidentally someone has created a SMTP relay server which relays all emails, then spammers will try to abuse this server to send emails to a large number of other victims. In such cases postfix queue defer and deferred will grow very large as destination mail server will try to block postfix. This can be checked using:

du -sh /var/spool/postfix/*

and if size of defer and deferred is in GBs then there is some serious problem. Now 'postqueue -p | more' can help in seeing that the problem is really due to spammers. Once it is verified that accidental free RELAY is the problem, the queues can be emptied by deleting all defer and deferred emails using:

postsuper -d ALL defer
postsuper -d ALL deferred

Please note that some legitimate email, if deferred for some unfortunate reason, is also present in any of these two queues then that would also get deleted. I do not have good way around this apart from going into various postfix spool folders and trying to delete files with find and grep combination while avoiding deleting useful emails.