How do I turn on logging for postfix on mac

I have been asked how I turn on /var/log/mail.log for postfix on a Mac running Mohave.

I have it running on mine, but it always has - but I can’t remember if I had to do anything special to turn it on.
The person asking has no /var/log/mail.log at all and now I’m curious.



Re: How do I turn on logging for postfix on mac

By James Brown at 11/08/2018 - 03:42

I’ve been having the same issue. Apple changed their logging system a few releases ago (Sierra?) to use the Unified Logging System, which logs to RAM rather than disk files.

I can create the file at /var/log/mail.log, give it correct permissions, etc, but it remains at 0 bytes.

I have managed to get some info by running this command in a terminal window:

$ log stream --predicate '(process == "smtpd") || (process == "smtp") || (process == "master")' -info

I suppose the output could be piped to mail.log.

I have heard of someone compiling Postfix an an older Mac, then moving it across to Mojave and it then logs to /var/log/mail.log.

Hopefully someone knows how to bring back the old functionality.