Fix for postfix in Mac OS X 10.8 Mountain Lion

After installing OS X 10.8 Mountain Lion, a few things in our web development environment stopped working (namely Apache with multiple vhosts, BIND/wildcard DNS, Phusion Passenger and the rmagick2 gem, and postfix).

The reason being is that Apple overwrites all of the configuration files that those tools rely on (although the old ones are all backed up with an appended ~previous, so fixing is relatively straightforward). We rely on postfix for sending mail locally via smtp using PHP’s mail() (i.e. sendmail) or Rails’ ActionMailer.

Here is a quick fix to get postfix working again in Mountain Lion:

Open Terminal (found in Applications/Utilities) and type:

sudo nano /System/Library/LaunchDaemons/org.postfix.master.plist

Replace the plist contents with (the first two lines are omitted here):

Save the file by pressing the key combination Ctrl+X, Ctrl+Y.

Unload/reload the plist:

sudo launchctl unload /System/Library/LaunchDaemons/org.postfix.master.plist```  
sudo launchctl load /System/Library/LaunchDaemons/org.postfix.master.plist

That should be it. Any emails you might have had queued up should now be sent almost immediately.

Update: If postfix is still not working, check the log file in /var/log/mail.log for the error:
sendmail: fatal: chdir /Library/Server/Mail/Data/spool: No such file or directory.

To fix this, run the following commands in Terminal:

sudo mkdir -p /Library/Server/Mail/Data/spool
sudo /usr/sbin/postfix set-permissions
sudo /usr/sbin/postfix start
Categories: Tips, Mac OS
Your browser does not support SVG

Thanks for contacting us, we'll be in touch shortly!

Let's Talk Details.

A few questions to help us get the ball rolling