> On 10 Jan 2020, at 19:01, Bill Cole
> <[email protected]> wrote:
>
> On 10 Jan 2020, at 12:28, Gerben Wierda wrote:
>
>> postfix is started during boot on my macOS system. This fails with:
>>
>> Jan 10 18:00:08 mail postfix/master[488]: fatal: bind 0.0.0.0 port 25:
>> Address already in use
>> Jan 10 18:00:10 mail /postfix-script[511]: fatal: mail system startup failed
>>
>> but when I shortly thereafter launch it it just starts fine.
>
> Apple includes its own customized version of Postfix in macOS, with a launchd
> config which runs 'master -e 60' at boot and whenever
> /var/spool/postfix/maildrop/ changes (i.e. mail is sent using
> /usr/sbin/sendmail.) Unfortunately, the default config
> (/etc/postfix/master.cf) enables postscreen, smtpd, and submission, which
> means ports 25 and 587 have listeners bound for 60 seconds at boot.
>
> Assuming you're running Postfix in a different prefix (ew.g. MacPort's
> /opt/local/) It should be safe to modify /etc/postfix/master.cf to disable
> postscreen, smtpd, and submission
This is easy enough.
> OR modify /System/Library/LaunchDaemons/com.apple.postfix.master.plist to
> reduce the runtime to something just long enough to clear a single-message
> queue under boot-time load, e.g. 2-5 seconds.
One little addition: this is not possible in recent macOS versions as it
requires turning System Integrity Protection (SIP) off.
> It is also possible in older MacOS X versions (i.e. those for which Apple no
> longer releases updates) to disable their Postfix entirely and replace it
> with your custom one by symlinking /etc/postfix/, /var/spool/postfix/ and
> /usr/sbin/sendmail to your custom build's equivalents.
>
> --
> Bill Cole
> [email protected] or [email protected]
> (AKA @grumpybozo and many *@billmail.scconsult.com addresses)
> Not For Hire (currently)