A PHP script run on a localhost development machine, needs to send 53 mail messages. After having sent 37 messages, sending stops. The postfix queue is not empty yet. The remaining messages will be sent as soon as a new sendmail command is issued or postfix is started manually.
This Mac OS X 10.6 (snow leopard) php.ini has the default configuration for sendmail, except for
mail.add_x_header = Off. /etc/postfix/main.cf has a relayhost configured.
/System/Library/LaunchDaemons/org.postfix.master.plist contains in the section:
<key>AbandonProcessGroup</key> <true/> <key>Label</key> <string>org.postfix.master</string> <key>Program</key> <string>/usr/libexec/postfix/master</string> <key>ProgramArguments</key> <array> <string>master</string> <string>-e</string> <string>60</string> </array> <key>QueueDirectories</key> <array> <string>/var/spool/postfix/maildrop</string> </array>
The issue is that postfix quits (is stopped) before the queued messages are all sent to the relayhost.
One workaround, not a solution, is to increase
120 and then issue a reload of the launchd plist (
$ sudo launchctl unload /System/Library/LaunchDaemons/org.postfix.master.plist;sudo launchctl load /System/Library/LaunchDaemons/org.postfix.master.plist).
How to correctly fix postfix/launchd to prevent the postfix/master process from quitting before all sendmail submitted items are sent/relayed and keep postfix only running OnDemand (not always)?