Most people owning a Mac use the Mail.app application to send and receive their e-mail, the program works as announced and should provide enough functionality for most of us. But, when it comes to diagnostics, there isn’t a lot to be found. The “Activity Window”—as a logging-aid—leaves a lot of guesswork why something didn’t work out the way we intended it to work. Or to word it a little less politely: We have no idea whatsoever why we couldn’t connect to a mail-server, we just know it didn’t work. Isn’t there anything we could do?
Obviously there is, writing this post wouldn’t make sense otherwise, would it?
One way would be to capture the packages flowing from and to the machine using tcpdump. On the other hand, Macs tend to be noisy regarding network-traffic. Wading through the result-file isn’t everybody’s idea of fun. (Mine neither, by the way.) There has to be another way. And there is:
/Applications/Mail.app/Contents/MacOS/Mail -LogActivityOnPort 25
If we’re starting Mail.app from the command-line like this, we are able to persuade it to tell us what happens while using the mentioned port. The output is written to the terminal-window where we issued the command and should give us a good idea of what is going on. The command shown above logs activity on the SMTP-port, if we want to monitor our POP-activity, we’d have to use port 110; you get the idea.
Happy logging.
2 Comments
One should not forget to set the buffer in Terminal.app, you might miss entries.
Right, but I think the default setting of 10.000 lines should be sufficient.

Thanks for the hint.