What's the correctly way to make Postfix run permanently on Lion (not server)
Solution 1:
The following changes worked for me:
-
Remove the following two elements from
/System/Library/LaunchDaemons/org.postfix.master.plist
:<string>-e</string> <string>60</string>
This will stop it exiting after 60 seconds.
-
Add the following element as a child of the
<dict>...</dict>
element in the same plist file:<key>KeepAlive</key> <true/>
-
Reload the file:
sudo launchctl unload /System/Library/LaunchDaemons/org.postfix.master.plist sudo launchctl load /System/Library/LaunchDaemons/org.postfix.master.plist
postfix should now be running as a daemon.
The above works on Mountain Lion, Mavericks, Yosemite and El Capitan. For systems that have System Integrity Protection (El Capitan and later) there are two options:
- Copying
/System/Library/LaunchDaemons/org.postfix.master.plist
to/Library/LaunchDaemons/org.postfix.custom.plist
, changingorg.postfix.master
toorg.postfix.custom
and then unloading and loading as above. - Disabling SIP (using
csrutil
), making the edits and then re-enabling SIP.
Note: With High Sierra and Mojave, the configuration file is com.apple.postfix.master.plist
instead of org.postfix.custom.plist
.