Tuesday, March 02, 2010

How to show the Postfix log file of MAMP PRO

In this older post we already showed how to send mail with MAMP PRO. But sometimes things are not working like they should. This can depend on several issues:
  • Faulty configuration
  • Dispatcher ISP denies to send the email
  • Recipient ISP denies reception of the email
If you want to figure out why things are not working you can have a look at the log files. Every action by Postfix will be logged to "/private/var/log/mail.log". The "private" folder is invisible and can be found under the root directory of your hard drive.

The most comfortable way to show the log file is using the Console.app.
  1. Open Console.app
  2. Choose View -> Show Log List
  3. Open the folder "FILES" in the Log List
  4. Open the folder "/private/var/log"
  5. Click the mail.log entry in the Log List
  6. On the right side of the window you can see the content of the Postfix log file.

If you prefer the use of the terminal just follow these steps:
  1. Open the Terminal.app (Applications/Utilities)
  2. Enter the following prompt and hit Enter

    tail -f /private/var/log/mail.log

  3. You can now read the Postfix log file within the Terminal. The log file keeps updating as new entries apply.

  4. Press "Ctrl + c" to stop the process
If you want to open the Postfix log file with a text editor, you have to make the file visible:
  1. Open the Terminal.app (Applications/Utilities)
  2. Enter the following and hit Enter

    defaults write com.apple.finder AppleShowAllFiles -boolean true

  3. Restart the Finder by enter the following and hit Enter

    Killall Finder

  4. Open the file "/private/var/log/mail.log" with your editor.

No matter which way you are choosing, you always get important information about Postfix. If you find the value "status=sent" your email was sent successfully. If you find the value "status=deferred" your email was not sent. The reasons for this can be versatile and it would be to much to cover them up at this place.