20

I am running OS X 10.12.3. I do not have the OS X Server package installed, but I know postfix comes as part of the standard (non-server) installation.

I have the occasional need to send emails from the command line and although I can send emails just fine using the 'mail' command, I cannot for the life of me find any kind of log that shows the progress and/or status of a sent mail item.

Despite what this answer says (mail and mailx fail to send emails to gmail), /var/log/mail.log does not exist, at least not on Sierra. I have scoured the config files in /etc/postfix trying to find a reference to a log directory but didn't find one. I've even tried using the -mtime option of the find command to locate any changed files immediately after sending an email, but to no avail. All that comes up are the temporary storage locations within /var/spool/postfix, but none of those files are actually just a plain old log file.

I read this post (Is there any documentation on the macOS Sierra new logging system?) about the new logging approach on Sierra, but it didn't solve my problem. I've checked system.log and although there are a few messages containing postfix, they are only about the service exiting, not about mail items being sent.

Does postfix even write a log entry on Sierra when you send an email?

Any info on this topic would be greatly appreciated.

23

This works for me:

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

Explanation:

--predicate is used to filter the log. In this case it looks for the process "smtpd" or "smtp"

--info shows all messages down to info level, which is good for most purposes.

Hope this helps!

  • It just outputs Filtering the log data using "process == "smtpd" OR process == "smtp"". – HappyFace Dec 20 '18 at 14:30
  • @HappyFace, this command starts filtering, so after that you get log messages when you start accessing smtp. – not2savvy Mar 22 at 13:56
  • Needs sudo for me. – HappyFace Jun 7 at 8:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .