Sunday, August 14, 2011

Postfix issues on OS X Lion

After recently installing a fresh copy of Lion (thanks TUAW for this lovely article: Mac 101: Creating a recovery disk using Recovery Disk Assistant) I've encountered some issues using Postfix as an SMTP server.

After an hour of researching I finally resolved my issue. Here are the steps I went through to fix it:

1. First, I looked in the postfix mail log to see if there were log messages indicating a problem:

> less /var/log/mail.log

And found this message:

fatal: open /etc/postfix/submit.cred: No such file or directory

2. To resolve this, I created the /etc/postfix/submit.cred file (must use sudo):

> sudo touch /etc/postfix/submit.cred

3. After creating the file, I then reloaded postfix:

> sudo postfix reload

4. After reloading, I checked the log file again and saw this message:

fatal: unsafe ownership or permissions on /etc/postfix/submit.cred: uid/gid/mode are 0/0/644 should be 0/0/0600

5. Next, I changed the ownership permissions on the submit.cred file and then reloaded postfix again:

> sudo chmod 600 /etc/postfix/submit.cred; sudo postfix reload

6. After reloading, I noticed a warning in the log file:

warning: no valid hostport|username|password entries in /etc/postfix/submit.cred

7. Finally, I edited the submit.cred file and added the following:

localhost|username|password

* change 'username' and 'password' appropriately.

8. I then reloaded postfix for a final time:

> sudo postfix reload

Hopefully this works you too!

No comments: