35

I can start Postfix temporarily with:

$ sudo launchctl
launchd% start org.postfix.master

However, Console.app shows that it only runs for a short time:

26/11/11 2:00:55.710 PM postfix/master: master exit time has arrived

I think the file /System/Library/LaunchDaemons/org.postfix.master.plist needs to be updated to make Postfix run permanently, but I haven't found the answer yet.

What's the correct way of getting Postfix starting at boot time and running permanently?

Update In order to edit the file as recommended by the selected answer, I first converted it to XML.

plutil  -convert xml1 /System/Library/LaunchDaemons/org.postfix.master.plist

Then just edited it with Vim:

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

I had issues trying to get Xcode to edit the file.

35

The following changes worked for me:

  1. 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.

  2. Add the following element as a child of the <dict>...</dict> element in the same plist file:

    <key>KeepAlive</key>
    <true/>
    
  3. 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:

  1. Copying /System/Library/LaunchDaemons/org.postfix.master.plist to /Library/LaunchDaemons/org.postfix.custom.plist, changing org.postfix.master to org.postfix.custom and then unloading and loading as above.
  2. 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.

  • 1
    Worked for me on Mavericks, but I had to put the full file path in to load it: sudo launchctl load /System/Library/LaunchDaemons/org.postfix.master.plist – rich Apr 9 '14 at 16:55
  • 1
    There was a cd /System/Library/LaunchDaemons line in there before the unload and load that may have been missed. I inlined the full path to make it clearer. – Jim Stewart Jun 22 '15 at 19:58
  • 2
    @mjturner - disable the sip? nope nope nope... Much better is just to create a new .plist that you own in /Library/LaunchDaemons/ – Chris Withers Nov 28 '16 at 7:21
  • 1
    @mjturner - yeah, that's weird. I didn't get any notification, and it's a bit sad. Care to make the same edit? – Chris Withers Nov 29 '16 at 9:59
  • 3
    @mjturner On High Sierra, org.postfix.master.plist is renamed to com.apple.postfix.master.plist. Maybe you may want to add that to the answer. – Utku Dec 19 '17 at 0:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .