master exit time has arrived! (re: outbound messages stuck on OS X with Postfix)

July 21st, 2011

Nerd bulletin! If you’re an OS X user, and you’re using the version of Postfix that came with your operating system, and you are seeing log messages similar to this one once per minute in mail.log:


Jul 21 16:08:39 snowy postfix/master[6565]: daemon started -- version 2.4.3, configuration /etc/postfix
Jul 21 16:08:39 snowy postfix/qmgr[6567]: DE1D92E78E75: from=, size=3602201, nrcpt=9 (queue active)
Jul 21 16:09:39 snowy postfix/master[6565]: master exit time has arrived

… then you’re not alone! Many people are reporting the “master exit time has arrived” messages, which seem to be just unwanted log noise. But if, between “daemon started” and “master exit,” you are seeing the same e-mail message logged over and over, then you and I are partners in digital miscommunication. Outbound e-mail is getting stuck.

Today I suffered from, investigated and solved this problem. Here’s a quick fix you can try:

  • Edit /System/Library/LaunchDaemons/org.postfix.master.plist , using a text editor, Apple’s Property List Editor (if you have the Developer Tools installed), or whatever other tool you prefer for editing XML. You need to change the third string under “ProgramArguments” from “60” to some larger number, like “600”.
  • Open a Terminal window and type the following magical incantations, providing your password when requested:

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

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

    That tells OS X to re-read the file you just edited.

  • Now watch mail.log (in the Console application) and see if anything improves.

Basically, it’s quite possible that your postfix mail daemon was unable to deliver a message because that message takes longer than sixty seconds to deliver but Apple was only allowing it sixty seconds. if you followed the instructions above, you just granted it ten minutes.

In today’s internet, an e-mail message rarely takes sixty seconds to deliver, but it can certainly happen. Even ten minutes is not technically impossible, but it’s more likely indicative of some other serious problem, whereas the sixty second timeout could be due to a large attachment, a slow internet connection, a sluggish remote server, or some combination of those. If that’s your problem, then your mail messages will seem to just vanish as if successfully sent, while in fact they never leave your computer.

Apple really screwed the pooch here. Sixty is a nice round number, but in this context it has no other redeeming qualities. I don’t understand why Apple felt they needed to put a limit on run time; I don’t know if Postfix even has one by default. In the various online support forums, only OS X users are reporting this error. (I’m running Leopard; I’m not sure which other OS version have this problem.)

Why am I even sending mail this way? Well, I activated Postfix because I have a mailing list of friends who want to hear from me, but my boneheaded ISP won’t allow me to send to more than 25 addresses per hour, 75 per day, through their SMTP servers. It’s their way of preventing spam by also preventing legitimate mail.

I solved that problem by configuring Mail.app to send outbound messages to the local Postfix daemon on my laptop. Postfix then looks up the MX records for each address and connects directly to each recipient’s mail server to deliver each message. (FYI, if you want to do this you’ll also have to do some other technical stuff to reassure the internet that your host is a legitimate source of mail from your domain. This is how smart people prevent spam.)

And all of that has worked great, up until this recent problem with some outgoing messages not out-going. I only spotted it when, due to a local network failure, the messages finally bounced back with DNS errors. They both had large attachments, but they were both the sort of legitimate, high-quality, amusing yet poignant e-mail messages that the internet has come to expect from mykle.com .

In closing, I’d like to whine about how Postfix sucks. But you don’t want to read that, do you? Suffice it to say, the “-e” flag (for “exit time”) to the postfix master daemon could also be called the “-f” flag (for “fail to deliver messages, bounce them, or even report an error.”) Qmail, to my knowledge, does not offer this feature.

4 Responses to “master exit time has arrived! (re: outbound messages stuck on OS X with Postfix)”

  1. David Says:

    Ah, thanks! This makes sense–those messages have been spamming my logs for years now. I finally decided to get off my butt and google and now I can fix them.

  2. Line Says:

    Or the following changes worked for me:

    Remove the following two elements from /System/Library/LaunchDaemons/org.postfix.master.plist:

    -e
    60
    This will stop it exiting after 60 seconds.

    Add the following element as a child of the … element in the same plist file:

    KeepAlive

    Reload the file:

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

    postfix should now be running as a daemon.
    C.f:
    http://apple.stackexchange.com/questions/32228/whats-the-correctly-way-to-make-postfix-run-permanently-on-lion-not-server

  3. mykle Says:

    Thanks! Yes, that’s basically the same fix. Either up the number of seconds to the -e flag, or remove the flag and its argument entirely.

  4. florian Says:

    Thank you – even now with Mountain Lion Server I experienced the same issue – still “only” 60 seconds.

Leave a Reply