Fix for postfix not launching reliably at boot time

Gerben Wierda gerben.wierda at
Sun Nov 29 11:02:09 UTC 2020

I think I shared this before, but I’m not certain so I am doing so now (again).

The MacPorts postfix master process will not launch reliably at boot if it is set up with ‘port load postfix’. The reason for the unreliable boot is that macOS during boot for about 60 seconds or so claims port 25 (and 587) because it launches its own postfix, then quickly kills it. When Apple’s postfix master launches first (there is no control in launchd what launches first) this can block the MacPorts version, which then fails. 

By changing /etc/postfix/ of Apple’s postfix the boot by MacPorts launches reliably.

This means patching Apple’s files, which I frown upon, but I’m still using Mojave and I think Apple updates leave alone and macOS itself doesn’t really use postfix, it is a leftover. I don’t know if this is still possible in later versions of macOS. If it isn’t because Apple has locked these down, a more intelligent startup command could be written that works around this macOS behaviour.

< smtp      inet  n       -       n       -       1       postscreen
< smtpd     pass  -       -       n       -       -       smtpd
> # GW: Commented postscreen, smtpd commands as Apple's postfix master gets run for 60 sec at boot
> #smtp      inet  n       -       n       -       1       postscreen
> #smtpd     pass  -       -       n       -       -       smtpd
< submission inet n       -       n       -       -       smtpd
<   -o smtpd_tls_security_level=encrypt
> #submission inet n       -       n       -       -       smtpd
> #  -o smtpd_tls_security_level=encrypt


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the macports-users mailing list