Troubleshooting postfix server issues

From Notes_Wiki
Revision as of 02:37, 3 February 2015 by Saurabh (talk | contribs)

<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.


Message file too big issue

By default postfix limits emails to 10MB and mailboxes to 50MB. Postfix defaults can be seen using:

postconf -d | grep size

To allow unlimited email and mailbox size, we can use following commands:

sudo postconf -e mailbox_size_limit=0
sudo postconf -e message_size_limit=0
service postfix restart

These commands basically append the necessary configuration lines to /etc/postfix/main.cf file. After changing the configuration we can list the parameters which have non-default values using:

postconf -n | grep size


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