macOS Mail

To maintain a consistent email experience across macOS, iOS, and iPadOS, I’ve been primarily using the default Mail app. Integrating Gmail via IMAP is simple, and address book and calendar sync works well, so I’ve used this setup for years without much trouble.

However, I recently encountered a strange issue: when I archived a message received through my Gmail account in the macOS Mail app, the message didn’t disappear from the Inbox as expected. Oddly, this behavior only occurred on macOS—on iOS and iPadOS, the same archive action worked perfectly.

Since archiving worked without issues when using Thunderbird with the same account, I suspected this was a Mail app-specific issue under certain conditions and decided to investigate further.

Symptoms

  • Archiving an email in the macOS Mail app leaves the message in the Inbox instead of moving it to All Mail.
  • The Mail app briefly displays a “Copying…” message.
  • In the Gmail web interface, the email remains in both the Inbox and All Mail.
  • Archiving works correctly on iOS/iPadOS Mail apps.
  • Thunderbird also handles archiving without issues.

Investigation Process

1. Reviewing IMAP Logs

In Gmail, archived emails should have the Inbox label removed. However, when archiving via the macOS Mail app, this label remained, and the email stayed in the Inbox.

Mail app logs showed that the APPEND command was sent and seemingly accepted by the Gmail server. A UID STORE -X-GM-LABELS (\Inbox) command also appeared, but the Inbox label wasn’t actually removed. As a result, the message continued to appear in the Inbox.

2. Comparing with a Working Account

On the same Mac and Mail app, another Gmail account handled archiving without any problems. Both accounts had [Gmail]/All Mail correctly configured as their Archive Mailbox in Mail app preferences.

3. Archiving via Junk as a Workaround

I discovered that if I first moved the problematic message to Junk and then archived it from there, it correctly moved to All Mail. This confirmed that the archive command itself worked, but the removal of the Inbox label was failing.

4. Resetting Mail App Folder Settings

I attempted to reset the Mail app’s folder mappings using the following steps:

  1. In Gmail settings, disable IMAP access for all labels, especially “All Mail.”
  2. In the Mail app, archive a message from the affected account.
  3. Mail will create a new label [Gmail]/Archive and use it for archiving.
  4. Quit the Mail app.
  5. Re-enable IMAP access for all labels in Gmail settings, including All Mail.
  6. Reopen the Mail app.
  7. The Archive mailbox is now automatically mapped to [Gmail]/All Mail, and archiving starts working properly.

5. Verifying the Archive List

On working accounts, the Mail app’s “All Archives” list displays Gmail (All Mail). On the problematic account, it only showed Gmail. After resetting the folder mappings, it correctly changed to Gmail (All Mail), just like the working accounts.

Root Cause Analysis

The Mail app must recognize Gmail’s “All Mail” as the archive target (\Archive) to function correctly. If it fails to do so, the Inbox label isn’t removed during archiving, leaving the message in the Inbox. As a result, archiving appears broken from the Mail app’s perspective.

Solution

  1. Disable IMAP access for “All Mail” in Gmail settings.
  2. Open the Mail app and archive a message—verify it goes to [Gmail]/Archive.
  3. Quit the Mail app.
  4. Re-enable IMAP access for “All Mail” in Gmail settings.
  5. Reopen the Mail app.
  6. In Mail settings, confirm that All Mail is set as the Archive Mailbox.
  7. Verify that “All Archives” displays as Gmail (All Mail).

After these steps, archiving should work properly, with messages disappearing from the Inbox and appearing only in All Mail on Gmail.

Conclusion

This issue stemmed from a subtle mismatch between how Mail and Gmail handle archiving. Rather than physically moving messages, the Mail app archives by removing the Inbox label—if this removal fails due to a folder mapping issue, the message stays in the Inbox.

If archiving isn’t working as expected or emails remain in the Inbox after archiving, try resetting the folder mappings in the Mail app as described above.