How to Log Traffic in Apple Mail for Mac

How to Log Traffic in Apple Mail for Mac

Struggling to figure out why an important email won’t send or why Mail suddenly stopped receiving messages? Want to see what’s happening behind the scenes in Apple Mail — or need to manage the log files that can build up and take space? Find out here how to enable logging of your email traffic (IMAP and SMTP) in Apple Mail for Mac ⤓, where to locate the generated log files, and how to clear them safely.

First, Digging Against Gravity

When you dig a hole in the ground, you get lighter — you’re burning calories after all, right?

That’s not the whole story, though: you also get lighter simply by moving closer to Earth’s center. Because gravity from the mass above you pulls upward, your weight is reduced. Your effective weight is the same as if you were standing on a smaller planet whose radius equals the distance from the bottom of your self-dug pit to Earth’s center — you can ignore the rest.

Now… can’t ignore a problem your email account is giving you in Mail? Just like digging reveals hidden layers beneath the surface, carving into your Mail logs uncovers what’s really going on behind the scenes.

Let’s dig into those log files:

How to Log Traffic in Apple Mail for Mac

Time needed: 3 minutes

To set up Apple Mail for macOS to record traffic with email servers (IMAP and SMTP) for analysis on a Mac:

  1. Select Window | Connection Doctor from the menu in Mail.

  2. Check Log Connection Activity.

    No longer: To stop Mail from collecting further debugging data, do turn off Log Connection Activity.
     Caution : The option does not reset itself; do disable logging connection activity after you are done troubleshooting to prevent Mail from accumulating data needlessly and see below for clearing existing log files.
    Check “Log Connection Activity” to create a logfile of IMAP and SMTP email traffic in Apple Mail for Mac

Examine Mail for Mac Log Files

To locate and examine log files crated by Apple Mail for email connections:

  1. Open Mail.
  2. Select Window | Connection Doctor from the menu.
  3. Click Show Logs in the Mail Connection Doctor window.
  4. Double-click a log file or press Space when it is highlighted to examine it.
    What you’ll see: You will see the raw commands and data exchanged with the mail server.

This EHLO will go in the permanent record?

Buy La De Du a tea

Tips help fuel these email and tech how-tos.

Delete Mail Logs to Save Mac Disk Space

To delete log files created by the Apple Mail connection doctor on a Mac:

  1. Open the Mail logs folder in Finder; see above.
  2. Press Command A in the Finder window that opens to highlight all files in the Mail logs folder.
    Examine: Do only delete all email logs once you have examined them and finished troubleshooting (or wish to start troubleshooting with new data).
  3. Now press Command Backspace to move the files to the Mac’s Trash.

How to Log Traffic in Apple Mail for Mac: FAQ

In what folder are Mail logs kept?

Apple Mail keeps logs in a local folder inside the current macOS user’s home directory.
Folder location: You can find the Apple Mail log folder ~/Library/Containers/com.apple.mail/Data/Library/Logs/Mail.

Can I follow along as new data is written to the Mail logs?

Yes.

To get an updated display of an email log file from Mail in Mac Terminal:

  1. Open Terminal.
  2. Go to the Mail log folder.
    Here’s how: Type cd ~/Library/Containers/com.apple.mail/Data/Library/Logs/Mail and press Enter.
  3. Type tail -F  followed by the log file you would like to follow.
    Finding the filename: Use ls to list the present log files, named for the server name for the connection, of course.
    Example: tail -F imap.fastmail.com-{random string}.txt would display a log file for a Fastmail IMAP connection.
  4. Press Enter to open the log file.
    End: Press Control C to end following the log file

(Tested with Mail 16 on macOS Tahoe 26.3 and Sequoia 15.5; first published July 2025, last updated March 2026)

Home » Email Tips and Resources » How to Log Traffic in Apple Mail for Mac