Postfix repairing and fixing cheatsheet

Article was written on 18th may 2015

Linux is fun. Configuring services on Linux is fun. Fixing problems and trying to find wrong settings in Linux is fun. Err — screw that, who am I kidding.

Finding problems when setting up certain services in Linux can be quite difficult, specially when you are trying to fix any mail-service related problems. This is why, years ago, I created a cheat sheet for future myself should I ever encounter certain mail-service related problems. Now I wish to share this cheat sheet with all of you.

Following article can help you find and fix up the problems with the Postfix mail service in Linux operating systems.

Cheat sheet for Postfix troubleshooting

One of the most often problems I ever have encountered with Postfix, and it’s companions such as Courier, is that user cannot authenticate / login into server for receiver or sending emails. Often mail clients simply state: “Cannot login” or “Wrong password or credentials” or something like this on the category “That does not help me a s*hit”. Here is the checklist to go through when receiving postfix/courier authentication problems.

Getting good diagnostics tools

One good way to find problems is using MUTT (apt-get install if missing) and run command mutt -f imap://localhost/

Other good diagnostic tool is installing web-mail software, such as Squirrelmail

If you are using database solution, check that the directory (maildir) is correct and with TRAILINGslash, otherwise all your mail may go to a single file instead of multiple files in the mail directory.

Does the actual directory even exists? Are you sure? Doublecheck name and location!

Does the mail directories and files have the correct owner and ground?

Owner and group for all virtual mailboxes and their files as well as directories should be postfix:postfix so the Postfix can handle them.

Check the owner with ls -l /var/mail/virtual .. and any needed subdirs. User and group should be postfix:postfix

You can fix this quickly using command chown -R postfix:postfix /var/mail/virtual

Is the UID and GID number (User ID and Group ID) correct in Postfix settings?

Number of UID represents user’s number as well as GID represents group’s number. As Postfix needs to handle the mail, both directories and files as well as configuration should all point that Postfix owns all and users all.

Check /var/log/mail.log log-file with nano or tail command. Use tail -f /var/log/mail.log to keep it running

Check /var/log/syslog main system log for errors

Google it. If these cheat sheet instructions do not help, try googling the error. It always helps because there most certainly has been someone having same issues as you long before you even thought of installing Postfix into use 🙂

Hope this cheat sheets helps with your problems. Feel free to add link to this article if this helps you 🙂