How to Set Up Gmail in Apple Mail on Mac

The short answer
Add your Gmail account via System Settings then Internet Accounts, sign in with Google OAuth, and let Apple Mail sync. Then open Mail > Settings > Accounts > Mailbox Behaviors and map the Archive mailbox to [Gmail]/All Mail and the Trash to [Gmail]/Trash. That single step fixes most archive-and-delete problems.
How to set up Gmail in Apple Mail on Mac, configure mailbox behaviours for correct archive and delete, and fix common sync issues.
On this page
Setting up Gmail in Apple Mail on Mac is a two-stage job. The first stage — adding the Google account — takes about two minutes. The second stage — configuring mailbox behaviours — takes another two minutes and is the step most people skip. Skipping it is why Apple Mail sometimes deletes messages instead of archiving them, why you see duplicate sent messages, or why the [Gmail]/All Mail folder starts downloading your entire email history onto your Mac the moment Mail opens.
The root of every Apple Mail and Gmail quirk is the same thing: Gmail does not use a traditional IMAP folder structure. Where a standard IMAP account has separate Sent and Trash folders, Gmail uses labels, and it exposes them to IMAP clients as folders under a [Gmail] prefix. Apple Mail does not know this by default, so it tries to manage its own Sent, Trash, and Archive folders — and then things get out of sync. The mailbox behaviours step tells Mail to use Gmail's folders instead.
This guide covers both stages for personal Gmail accounts and Google Workspace accounts, notes where setup differs across macOS versions, and walks through the fixes for the problems that appear most often after setup.
The short answer#
In System Settings on macOS Ventura or later, go to Internet Accounts and add a Google account. Sign in with your Google credentials. Apple Mail will appear in the list of apps that can use the account — leave it turned on and click Done, then open Apple Mail.
Once Mail has synced and you can see your inbox, open Mail > Settings > Accounts, select your Gmail account in the left column, and click the Mailbox Behaviors tab. Set Archive Mailbox to [Gmail]/All Mail, Trash Mailbox to [Gmail]/Trash, and Sent Mailbox to [Gmail]/Sent Mail. Close Settings.
Those three dropdowns are the answer to most Apple Mail and Gmail complaints. Archive now moves messages to the same folder Gmail's own archive action uses. Deleting a message no longer creates a ghost copy that reappears on the next sync. Sent messages stop duplicating. The rest of this guide explains why each setting matters, how the setup differs across macOS versions, and what to do if something still is not working.
Before you start#
You need a Google account — personal Gmail or Google Workspace — and a Mac running macOS Monterey 12 or later. The steps below are written for macOS Ventura and Sonoma, where the account setup panel lives inside System Settings. On Monterey and earlier, the same panel lives in System Preferences instead.
IMAP must be enabled in your Gmail account. Personal Gmail accounts have it enabled by default. If you are on Google Workspace, your administrator controls this setting and may have it disabled. You can check in a browser: open Gmail, go to Settings > See all settings > Forwarding and POP/IMAP, and confirm that IMAP Access shows as enabled.
Most users do not need an App Password. Adding a Google account through Internet Accounts uses OAuth — you sign in directly through a Google-hosted window, and two-factor authentication is handled in that same window. App Passwords are only required if your Google Workspace administrator has explicitly disabled OAuth for IMAP clients and requires App Password authentication instead. If you are unsure, try the standard steps first.
- A working Gmail or Google Workspace account with IMAP enabled.
- macOS Monterey 12 or later — the Google option has been available in Internet Accounts since OS X Yosemite, and the setup is the same across all recent versions.
- An App Password only if your Workspace administrator requires one — generate it at myaccount.google.com under Security then App Passwords.
- A few minutes for the initial sync after adding the account, and more time on large accounts where Apple Mail downloads recent messages for the first time.
How to add your Gmail account to Apple Mail#
This stage adds the Google account to macOS so Apple Mail can connect to it. If you have already added the account for Calendar or Contacts, open System Settings > Internet Accounts, find the existing Google account, and make sure Mail is toggled on — then skip to the mailbox behaviours section.
- 1
Open System Settings and go to Internet Accounts
Click the Apple menu in the top-left corner of your screen and choose System Settings. In the left sidebar, scroll down and click Internet Accounts. On macOS Monterey and earlier, this is in System Preferences rather than System Settings, but the Google option is in the same place.
- 2
Add a Google account
Click Add Account (or the plus button, depending on your macOS version). A sheet appears listing the account types — iCloud, Google, Exchange, Yahoo, and others. Select Google. A sign-in window opens, either as a separate browser window or an embedded sheet, showing the Google sign-in page.
- 3
Sign in with your Google credentials
Enter your Gmail address, click Next, enter your password, and complete two-factor authentication if prompted. If you are on Google Workspace and your administrator requires an App Password, enter that in the password field instead of your regular password. Google will ask you to allow Apple access to your account — click Allow.
- 4
Enable Mail in the account permissions
After sign-in, macOS shows a list of apps that can use the account: Mail, Contacts, Calendars, Notes, and Reminders. Leave Mail turned on. You can switch the others off if you only want email. Click Done to save the account.
- 5
Open Apple Mail and let it sync
Open Mail from the Dock or Applications folder. Mail connects to your Gmail account over IMAP and starts fetching your folders and recent messages. On a large account this first sync can take several minutes. You will see your Gmail inbox appear in the sidebar along with your labels listed as folders and a [Gmail] subfolder group containing All Mail, Sent Mail, Drafts, Spam, and Trash.
How to configure mailbox behaviours#
This is the step most guides skip and the one that causes most of the problems. Without it, Apple Mail maps its Archive, Sent, and Trash actions to generic IMAP folders it creates itself, rather than to the specific Gmail folders Gmail actually uses. The result is messages that disappear, return after a sync, or pile up in duplicate locations.
The Mailbox Behaviors tab in Mail's account settings is where you override those defaults. The dropdowns in that tab list every IMAP folder Apple Mail can see in your Gmail account, and you choose which Gmail folder each Mail action should use.
- 1
Open Mail > Settings > Accounts
In Apple Mail, go to the Mail menu in the menu bar and choose Settings. On macOS Monterey and earlier this menu item is called Preferences, not Settings, but it opens the same window. Click the Accounts tab at the top of the window, then select your Gmail account in the left column.
- 2
Click the Mailbox Behaviors tab
On the right side of the Accounts panel, click the Mailbox Behaviors tab. You will see a set of dropdowns: Drafts Mailbox, Sent Mailbox, Junk Mailbox, Archive Mailbox, and Trash Mailbox. Each one currently points to wherever Apple Mail chose by default.
- 3
Set Archive Mailbox to [Gmail]/All Mail
Click the Archive Mailbox dropdown and choose [Gmail]/All Mail from the list. This is the folder Gmail uses internally for all archived messages, regardless of which label they carry. Mapping it here means the Archive button (or pressing the A key in Mail) moves messages to the same place Gmail's own archive action uses — so archiving in Mail and archiving in the Gmail web interface produce the same result.
- 4
Set Trash Mailbox to [Gmail]/Trash
Click the Trash Mailbox dropdown and select [Gmail]/Trash. Without this, deleting a message in Apple Mail puts it in a local Trash folder that Gmail does not treat as deleted. Gmail's retention logic ignores it, so the message stays in your account and reappears in Apple Mail on the next sync. [Gmail]/Trash is the folder Gmail's own delete action uses, and mapping it here makes Mail deletions permanent from Gmail's perspective.
- 5
Set Sent Mailbox to [Gmail]/Sent Mail
Click the Sent Mailbox dropdown and select [Gmail]/Sent Mail. Apple Mail saves a copy of every sent message to whatever folder this dropdown points to. Gmail also saves its own copy to [Gmail]/Sent Mail. If the dropdown is not set to [Gmail]/Sent Mail, both copies land in different places and you see every sent message twice — once in Mail's local Sent folder and once in Gmail's Sent Mail.
- 6
Close Settings and confirm the changes work
Close the Settings window. Send a short test message, archive one message in your inbox, and delete another. Then open the Gmail web interface and check: the sent message should appear in Sent, the archived message should appear in All Mail and be gone from the inbox, and the deleted message should appear in Trash. If all three land in the right place, the setup is correct.
Turn off All Mail syncing on large accounts
Differences across macOS versions and Google Workspace#
The account-adding and mailbox-behaviour steps work the same way on every supported macOS version. The differences are surface-level: where the settings panel lives and what it is called. The table below covers the four variations you are most likely to encounter.

| Scenario | What changes | Where to find it |
|---|---|---|
| macOS Ventura 13 and Sonoma 14 | Internet Accounts is inside System Settings, which replaced System Preferences. The sidebar-based layout looks different from earlier macOS, but the Google option and the sign-in flow are unchanged. | Apple menu > System Settings > Internet Accounts |
| macOS Monterey 12 and earlier | Internet Accounts is inside System Preferences in the grid layout. Everything else — the account type list, the OAuth sign-in, and the Mailbox Behaviors tab in Mail — is identical. | Apple menu > System Preferences > Internet Accounts |
| Mail Settings vs Mail Preferences | On macOS Ventura and Sonoma, the Mail menu item is called Settings. On Monterey and earlier it is called Preferences. Both open the same window with the same Accounts and Mailbox Behaviors tabs. | Mail menu > Settings or Preferences |
| Google Workspace (work or school account) | Setup is identical to personal Gmail. If the administrator requires App Password authentication for IMAP, use it in the password field during sign-in. The Mailbox Behaviors configuration after setup is exactly the same. | Mail > Settings > Accounts > Mailbox Behaviors |
| Two-factor authentication | OAuth via Internet Accounts handles 2FA in the embedded sign-in window — no App Password needed. App Passwords are an alternative only when your Workspace administrator has disabled the OAuth path for third-party IMAP clients. | myaccount.google.com > Security > App Passwords (only if required) |
What to do when Gmail is not syncing in Apple Mail#
Most problems with Gmail in Apple Mail come from one of a small number of causes. Before working through the table below, confirm the mailbox behaviours are set correctly — an unmapped Archive or Trash folder looks like a sync problem but is really a configuration problem, and fixing the mapping resolves it immediately.
For anything that still is not working after checking the mappings, open Window > Connection Doctor in the Apple Mail menu. Connection Doctor shows each account's connection status, the last successful sync time, and any authentication error code. A red indicator with an error message points directly at the cause, whether that is a credential problem, an IMAP access problem, or a network issue.
| Symptom | Likely cause | Fix |
|---|---|---|
| Archiving a message in Apple Mail makes it disappear from the inbox but it cannot be found anywhere | Archive Mailbox is not mapped to [Gmail]/All Mail — Apple Mail is moving the message to a local folder that Gmail does not monitor | Open Mail > Settings > Accounts > Mailbox Behaviors and set Archive Mailbox to [Gmail]/All Mail. |
| Deleted messages come back after syncing | Trash Mailbox is not mapped to [Gmail]/Trash, so Gmail does not treat the deletion as final and restores the message on the next sync | Set Trash Mailbox to [Gmail]/Trash in Mailbox Behaviors. |
| Sent messages appear twice — one copy in Apple Mail's Sent folder and another in Gmail | Sent Mailbox is not mapped to [Gmail]/Sent Mail, so Apple Mail saves a local copy while Gmail also saves its own | Set Sent Mailbox to [Gmail]/Sent Mail in Mailbox Behaviors. |
| Apple Mail asks for the Gmail password repeatedly | The OAuth token has expired, or the Google account has been removed from Apple's authorised apps | Open System Settings > Internet Accounts, remove the Google account, and add it again. If the prompt continues, check your Google Account security settings for revoked third-party access. |
| No new messages appear in Apple Mail even though Gmail is receiving them | IMAP is disabled in Gmail settings, or Apple Mail is set to check for new messages manually rather than automatically | In a browser, open Gmail > Settings > See all settings > Forwarding and POP/IMAP and confirm IMAP Access is enabled. In Mail, open Preferences > Accounts and check that the account is not set to manual checking. |
| Apple Mail is slow and Mac storage is filling up after adding Gmail | [Gmail]/All Mail is syncing a full copy of the entire Gmail account to local storage | Right-click [Gmail]/All Mail in the Mail sidebar and uncheck it from synchronised folders. The Archive Mailbox mapping continues to work — you are only stopping the local download. |
| Gmail labels do not appear as folders in the Apple Mail sidebar | The labels are not set to show in IMAP in Gmail, or Mail has not yet fetched the full folder list | In Gmail settings, go to Labels and set each label to Show in IMAP. In Mail, choose Mailbox > Synchronise to pull the latest folder list from Gmail. |
Connection Doctor pinpoints the error code
A faster way to handle Gmail on Mac#
The steps above work, and once configured they hold. What they do not address is the ongoing work that fills your inbox every day. Apple Mail routes and archives correctly after the mailbox behaviours are set — it does not prioritise, draft replies, follow up on threads you forgot about, or surface what actually needs a decision today.
AI Emaily connects to the same Gmail account and handles triage, drafting, and follow-ups through the Gmail API directly, so there is no IMAP mailbox-behaviour configuration needed and no sync quirks to manage. The AI drafts replies based on a user-set Personal Context brain and per-recipient profiles — not by learning from your past mail. Every draft waits for your approval before sending, and a full audit trail shows what ran and when. We build AI Emaily. It starts with a 7-day free trial on the Pro and Autopilot plans — details at the pricing page.
Frequently asked
See it in AI Emaily
Keep reading
Sources

Written by
Nafiul HasanNafiul Hasan is an entrepreneur and AI automation system builder with 10+ years of experience turning messy, manual workflows into reliable automated systems. He designs and ships AI enterprise solutions end-to-end — the agent logic, the data plumbing, and the product people actually use — and founded AI Emaily to give busy professionals their attention back. He writes here from the builder's seat: what works, what breaks, and how to put AI to work without giving up control.