10.4: Create a persistent postfix

May 15, '05 10:05:00AM

Contributed by: jargon

I run a local postfix on my machine, and in 10.3, I had to modify /etc/hostconfig to tell the OS to run postfix upon boot. I upgraded to Tiger today, and it would no longer start upon boot. 10.4 relies on launchd for crond, as well as a bunch of service launching. Stock, postfix is set to run every minute if there are any files in /var/spool/postfix/maildrop. But I like a livelier postfix.

The plist that is configuring postfix under launchd is called org.postfix.master.plist, located in /System/Library/LaunchDaemons. You can either run the Property List Editor as root and remove the two ProgramArguments entries for -e and 60, as well as the whole QueueDirectories field, or just use su or sudo and replace the file with this plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>Label</key>
        <string>org.postfix.master</string>
        <key>Program</key>
        <string>/usr/libexec/postfix/master</string>
        <key>ProgramArguments</key>
        <array>
                <string>master</string>
        </array>
</dict>
</plist>

After this , you can either just restart, or reload the service like so:
% sudo launchctl stop org.postfix.master
% sudo launchctl unload /System/Library/LaunchDaemons/org.postfix.master.plist
% sudo launchctl load /System/Library/LaunchDaemons/org.postfix.master.plist
% sudo launchctl start org.postfix.master
[robg adds: Sorry for the scrolling DIV area, but it's the best way I've thought of to handle long rows of text that can't be broken in short code snippets (any other ideas?). To use the sample code, just click once in the box, select all, and copy...]

Comments (3)


Mac OS X Hints
http://hints.macworld.com/article.php?story=2005050302075588