Brice21

Q: Server 5.2 missing SMTP Logs

Since Server 5.2 and macOS Sierra there is an issue with SMTP logging.

 

SMTP logs aren't accessible from Server.app anymore !

 

It seems due to the fact that SMTP log is not being written, as /private/var/log/mail.log file size is zero !

 

Is SMTP logging disabled ?

 

Are the SMTP logs stored in another path ?

Posted on Sep 29, 2016 3:48 AM

Close

Q: Server 5.2 missing SMTP Logs

  • All replies
  • Helpful answers

  • by Mac mini Dabbler,

    Mac mini Dabbler Mac mini Dabbler Sep 29, 2016 11:58 AM in response to Brice21
    Level 1 (4 points)
    Servers Enterprise
    Sep 29, 2016 11:58 AM in response to Brice21

    First line in /etc/syslog.conf states:

     

    # Note that flat file logs are now configured in /etc/asl.conf

     

    When I check the content of /etc/asl/com.apple.mail it shows:

     

    # mail facility has its own log file

    ? [= Facility mail] [<= Level debug] claim only

    > /var/log/mail.log mode=0644 format=bsd rotate=seq compress file_max=5M all_max=50M

     

    I then check /etc/asl.conf and can't see any reference to the above. So possibly the configuration lines for mail.log are missing in /etc/asl.conf.

     

    I will add the content of /etc/asl/com.apple.mail to /etc/asl.conf as the syntax looks the same and restart mail. See what happens.

  • by Mac mini Dabbler,

    Mac mini Dabbler Mac mini Dabbler Sep 29, 2016 12:11 PM in response to Mac mini Dabbler
    Level 1 (4 points)
    Servers Enterprise
    Sep 29, 2016 12:11 PM in response to Mac mini Dabbler

    Sorry, no effect. I will try to find out what the real cause is.

  • by croadfeldt,

    croadfeldt croadfeldt Oct 14, 2016 9:32 AM in response to Mac mini Dabbler
    Level 1 (9 points)
    Oct 14, 2016 9:32 AM in response to Mac mini Dabbler

    Any luck?

     

    I've configured the logging level to info across the mail.settings range of available options. But that had no effect either.

     

    While it's not a show stopper, it certainly is annoying.

  • by Mac mini Dabbler,

    Mac mini Dabbler Mac mini Dabbler Oct 14, 2016 9:34 AM in response to croadfeldt
    Level 1 (4 points)
    Servers Enterprise
    Oct 14, 2016 9:34 AM in response to croadfeldt

    I've given up, let Apple fix their own bugs. And this new macOS Sierra and Server app sure have a lot.

  • by Arne Rolf Heier,

    Arne Rolf Heier Arne Rolf Heier Oct 15, 2016 4:29 PM in response to Mac mini Dabbler
    Level 1 (9 points)
    Servers Enterprise
    Oct 15, 2016 4:29 PM in response to Mac mini Dabbler

    Apple have a new log system in Sierra. It is not using the log files or asl.

    The logs are in memory or a log db.

     

    log -- Access system wide log messages created by os_log, os_trace and other logging systems.

     

    You can read the smtpd log from terminal with this command.

    log show --start "2016-10-16"  --end "2016-10-17" --predicate  'process == "smtpd"' --debug

  • by Mac mini Dabbler,

    Mac mini Dabbler Mac mini Dabbler Oct 16, 2016 7:24 AM in response to Arne Rolf Heier
    Level 1 (4 points)
    Servers Enterprise
    Oct 16, 2016 7:24 AM in response to Arne Rolf Heier

    Thank you for your answer but the output of your command line does not give nearly as much information as it used to have in previous versions. I want Apple to revert this chance and give us the old logging back. It is essential to have insight in the information of the old loggings as I need it to block persistent spammers and for other purposes.

  • by Mac mini Dabbler,

    Mac mini Dabbler Mac mini Dabbler Oct 16, 2016 11:11 AM in response to Mac mini Dabbler
    Level 1 (4 points)
    Servers Enterprise
    Oct 16, 2016 11:11 AM in response to Mac mini Dabbler

    For now I've created a shell script and put in in the crontab so I don't have to resolve to using Terminal and the SMTP log can be viewed in Server.app.

     

    ----------

    #!/bin/bash

     

    NOW=$(date +"%Y-%m-%d")

     

    /bin/rm /var/log/mail.log && touch /var/log/mail.log

    /usr/bin/log show --start "$NOW"  --end "$NOW" --predicate  'process == "smtpd"' --info > /var/log/mail.log

    ----------