You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

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

Reply
26 replies

Nov 14, 2016 7:17 AM in response to Mac mini Dabbler

OK, thanks so much. I'm pretty much a newbie when it comes to this type of stuff. But I believe I followed your instructions correctly and (tho I'd never done it before), read-up on how to create a cron tab which, when I check using crontab -l, now says 10 * * * * /usr/local/scripts/mail_log.sh which is what I named the file containing your script.


It's been well over 10 minutes now, since I set up the cron tab, but I'm just not sure where in the Server app I'm supposed to start seeing the mail log? In the "Mail" section of the Logs popdown? I see Mail Server Log, but that only shows various people logging in & out of their mail apps, and runs back several days. Do I need to restart the Mail service (or the server itself) to kick this off?

Dec 19, 2016 10:36 PM in response to Mac mini Dabbler

Thank for that, certainly helpful.


Unfortunately, I still haven't got the entire log control that I had before.


I have some emails that are confirmed received by the SMTP server but never delivered (but that's only a guess) to Dovecot as they don't appear in the Inbox.


Unfortunately I am unable to confirm wether this email has or hasn't been delivered. Some fault are being displayed in the logs but not sure if all are and certainly successful deliveries aren't showing in the SMTP logs.


Any idea please? Rather frustrating


server:~ admin$ sudo serveradmin settings mail:postfix:log_level

Password:

mail:postfix:log_level = "debug"

Dec 20, 2016 4:21 AM in response to Beno 44

Hi, after following some of the suggestions made earlier in this thread, like you I saw that the level of info of the SMTP log that I was able to produce and view through the Server.app was not as detailed as I needed and remembered from earlier Server versions. Luckily, I was able to adapt another suggestion and figured out how to save more detailed log info to a textfile.


Upon boot-up, I issue the following command in Terminal:

log stream --predicate '(process == "smtpd") || (process == "smtp")' --debug > /Users/admin/Desktop/"$(date +%Y%m%d-%H%M%S).txt"


Then I minimize the Terminal window to the dock. The command creates a dated textfile on my desktop that stores a running mail log, fully detailed with "sent" indications, IP addresses, etc., like I used to get in the mail log using Server.app. Yes, it's not ideal since I have to keep the Terminal running in order to capture this info, but our server doesn't have anyone working at it regularly, so the Terminal can run undisturbed in the dock. When I want to end one of these textfiles and begin another, all I have to do is quit Terminal, store the generated textfile somewhere convenient, and then re-issue the above command to begin a fresh textfile "log". Obviously on your server, you would change the username in the command to your own, and change the saved path as well, if desired.

Server 5.2 missing SMTP Logs

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.