Blog/ Gmail how-tos

How to Use Gmail With a Third-Party Email Client

Nafiul HasanNafiul Hasan· 11 min read
Illustration of a third-party email client connecting to Gmail over IMAP, with Gmail labels mapped to parallel IMAP folder views and the OAuth sign-in flow highlighted

The short answer

To use Gmail with a third-party email client, enable IMAP in Gmail settings, then authorize via Google OAuth sign-in or generate an app password for legacy clients. Gmail maps all mail to a single store and treats labels as parallel IMAP folders, which causes duplicates and unexpected delete behavior in standard clients.

Enable IMAP in Gmail settings, then connect any third-party email client via OAuth. Learn why Gmail behaves differently and what to do when it breaks.

On this page
  1. 01The short answer
  2. 02What you need before you start
  3. 03How to connect Gmail to a third-party email client
  4. 04How Gmail behaves differently over IMAP
  5. 05What to do when it does not work
  6. 06A faster way: a client built for Gmail's architecture

If you have ever tried to read Gmail in a client other than Google's own web interface or mobile app, you have probably hit at least one of three surprises: a password that the client rejects even though you typed it correctly, the same email appearing four or five times across different folders, or a delete key that archives instead of removes. None of those are bugs in your client. They are the result of Gmail implementing IMAP differently from every other mail server, and the fixes are straightforward once you know what is happening.

This guide covers three things: how to authorize the connection in the first place, what Gmail's IMAP behavior actually is and why it differs from what a standard client expects, and what to fix when something breaks. Google Workspace users should note one additional prerequisite: your administrator must enable IMAP for the organization in the Admin console before any of these steps will work for you.

The short answer#

Connecting Gmail to a third-party email client takes two setup steps and one credential choice. First, enable IMAP inside Gmail settings — it is off by default on new accounts. Second, authorize the client to access your account, either through Google's OAuth sign-in or through an app password if the client uses legacy credentials.

OAuth is Google's preferred method and what every modern client supports. You click Sign in with Google inside the client, a browser window opens to Google's own sign-in page, you approve the requested access, and the client receives a secure token. Your Gmail password is never exposed to the client. App passwords serve legacy clients that cannot handle OAuth: generate a 16-character code at myaccount.google.com/apppasswords, enter it as the password field, and use your full Gmail address as the username. App passwords require two-step verification to be active on the account first.

Either way, the server settings are: incoming server imap.gmail.com, port 993, SSL/TLS required; outgoing SMTP server smtp.gmail.com, port 465 with SSL or port 587 with STARTTLS. Once the connection is established, Gmail's label-based architecture introduces folder behaviors that differ from what a standard IMAP client expects — those are covered after the step-by-step instructions.

What you need before you start#

Three conditions must be in place before the connection attempt will succeed. Checking them now saves a round-trip through a credential error.

  • IMAP must be enabled in Gmail. Go to Settings (the gear icon, top right) > See all settings > Forwarding and POP/IMAP > IMAP access > Enable IMAP > Save Changes. It is disabled by default.
  • Google Workspace accounts: your administrator must enable IMAP access for the organization in the Google Admin console. If the IMAP toggle is missing from your Gmail settings, that is the reason.
  • App password users: two-step verification must be active on your Google Account before the app password option appears at myaccount.google.com/apppasswords.
  • Confirm the client supports IMAP, not POP only. IMAP syncs and leaves mail on the server; POP downloads and can remove it. This guide covers IMAP.
  • OAuth users: any client built or substantially updated after 2022 supports Google sign-in. If the client presents only a server address and a plain password field with no OAuth option, it cannot connect — Google removed plain-password IMAP access in May 2022.

Google removed plain-password IMAP access in 2022

Google turned off less-secure app access in May 2022. A username plus your regular Gmail password will be rejected by every IMAP client today. You must use OAuth sign-in (preferred) or generate an app password. A client that offers neither option cannot connect to Gmail.

How to connect Gmail to a third-party email client#

  1. 1

    Enable IMAP in Gmail settings

    Open gmail.com and click the gear icon in the top right, then See all settings. Go to the Forwarding and POP/IMAP tab. Under IMAP access, select Enable IMAP. Scroll down and click Save Changes. This step is required even for clients that sign in through OAuth — the IMAP connection still needs to be enabled server-side.

  2. 2

    Choose and prepare your authentication method

    Modern clients: look for a Sign in with Google or Add Gmail account option and use it. Legacy clients that ask only for a server address and password: open myaccount.google.com/apppasswords, select Mail and the device type, click Generate, and copy the 16-character code immediately. You will only see it once.

  3. 3

    Add the account in your email client

    For OAuth: click Add Account, choose Google or Gmail, enter your email address, and follow the browser prompt to grant access. For app passwords: click Add Account, choose IMAP or Other, enter your full Gmail address as the username, and paste the 16-character app password into the password field. Do not enter your regular Gmail password here — it will fail.

  4. 4

    Enter IMAP and SMTP server details if prompted

    Incoming IMAP: imap.gmail.com, port 993, SSL/TLS. Outgoing SMTP: smtp.gmail.com, port 465 (SSL/TLS) or 587 (STARTTLS). Clients that completed OAuth authorization typically auto-populate these; skip the step if the fields are already filled.

  5. 5

    Wait for the initial sync and review the folder list

    Gmail creates one IMAP folder per label, plus a set of special folders under [Gmail]: All Mail, Sent Mail, Drafts, Spam, Starred, Trash, and Important. Expect a longer folder list than you are used to on other providers. The next section explains what each folder represents and how to reduce the list.

  6. 6

    Set the delete behavior you actually want

    In Gmail, go to Settings > Forwarding and POP/IMAP > IMAP settings. Under When I mark a message in IMAP as deleted and expunge the inbox, choose the behavior that matches your expectation: archive the message (Gmail default, which surprises most IMAP users), move it to Trash, or delete it immediately. Set this once before you start using the client.

How Gmail behaves differently over IMAP#

Gmail was designed around labels, not folders. IMAP was designed around folders. Gmail bridges the two by translating every label into an IMAP folder view — but the translation produces behaviors no standard IMAP client was built to handle. These six behaviors account for almost every complaint about Gmail in a third-party client.

BehaviorStandard IMAPGmail over IMAPFix
Message storageOne message lives in one folderEvery message lives in [Gmail]/All Mail; labels appear as additional parallel folder views of the same messageDisable Show in IMAP for labels you do not use; avoid syncing All Mail in the client
Duplicate messagesA message exists in exactly one folder at a timeA message with three labels shows up in three IMAP folders simultaneouslySet the client to sync only Inbox, Sent, and the labels you actively use — not All Mail
Delete behaviorClient marks message as deleted and expunges on quitRemoves the Inbox label by default, archiving rather than deleting the messageChange in Gmail Settings > Forwarding and POP/IMAP > IMAP settings > delete behavior
Sent mail copiesClient saves one copy to the Sent folderGmail also saves a copy to [Gmail]/Sent Mail, so sent messages often appear twiceDisable the client's save-sent-copies-to-server setting, or map its Sent folder to [Gmail]/Sent Mail
Special folder namesTrash, Drafts, Sent are standard IMAP names clients recognizeGmail uses [Gmail]/Trash, [Gmail]/Drafts, [Gmail]/Sent Mail, which some clients cannot map automaticallyMap the client's special folders to the [Gmail]/* equivalents in account settings if prompted
Label hierarchyNested folders are independent containersGmail uses a slash separator: a label named Work/Project appears as a folder named Project nested under WorkNo action needed — cosmetic difference only in most clients

The root cause of most Gmail-IMAP friction is one architectural fact: every message is stored once in All Mail, and labels are applied as additional folder views on top of that single store. A client that syncs every available folder downloads the same message once per label it carries. Knowing this makes every duplicate and delete problem immediately diagnosable — and the fix is always the same: tell the client which folders to sync and which to ignore.

Diagram showing how Gmail routes every incoming message to a single All Mail store first, then branches it into multiple label-based IMAP folder views simultaneously, unlike standard IMAP where each message occupies exactly one folder location
Gmail stores one copy of every message in All Mail and applies labels as parallel IMAP folder views — so a message with three labels appears in three places in a standard IMAP client that syncs all folders.

What to do when it does not work#

Most Gmail-plus-IMAP problems fall into one of six patterns. The table below maps each symptom to its cause and the fix. If your situation is not covered, Google's Gmail Help pages on reading Gmail through other email clients are current and address Workspace admin restrictions, rate limits, and less common connection errors.

SymptomLikely causeFix
Authentication failed or invalid credentialsPlain-password auth was removed in 2022; or an app password was revoked or expiredRe-authorize via OAuth sign-in, or revoke and regenerate the app password at myaccount.google.com/apppasswords
Same email appears multiple timesClient is syncing both All Mail and the label foldersIn Gmail > Settings > Labels, uncheck Show in IMAP next to All Mail, then restart the sync
Delete archives instead of removing the messageGmail default IMAP delete removes the Inbox label only, leaving the message in All MailIn Gmail > Settings > Forwarding and POP/IMAP > IMAP settings, change the delete behavior to Move to Trash
Hundreds of folders visible in the clientEvery Gmail label becomes an IMAP folder by defaultIn Gmail > Settings > Labels, uncheck Show in IMAP for labels you do not need in the client
Client connects but cannot sendSMTP auth is not configured or the wrong port is setUse smtp.gmail.com, port 465 (SSL/TLS) or 587 (STARTTLS). The same app password must be used for SMTP if not using OAuth.
Sent mail appears twiceThe client saves a sent copy and Gmail saves one to [Gmail]/Sent MailDisable the client's save-sent-messages-to-server setting, or map its Sent folder to [Gmail]/Sent Mail

Check the IMAP toggle before debugging credentials

The most common reason a previously working client stops syncing is that IMAP got disabled in Gmail settings — a Workspace admin policy update, a settings sync, or a stray click. Check Settings > Forwarding and POP/IMAP before investigating credentials or server addresses.

A faster way: a client built for Gmail's architecture#

The steps above establish a working IMAP connection. What they do not solve is the ongoing work that comes after the connection is set up: deciding which messages need a response, writing replies, tracking follow-ups before they go cold. A generic IMAP client reads mail and leaves the rest to you.

We build AI Emaily, an AI-native email client that connects Gmail through Google's standard OAuth sign-in and handles the IMAP quirks automatically — duplicate suppression, correct delete behavior, full label-to-folder mapping — without any manual folder configuration. Beyond the connection, AI Emaily triages incoming mail down to a short ranked list of what needs you, drafts replies in the voice you configure through your Personal Context brain and per-client profiles, and surfaces follow-ups before threads go quiet. Manual, Copilot, and Autopilot modes let you set how much the agent acts on your behalf, with undo and a full audit trail on every action. There is a 7-day free trial — see the details at aiemaily.com/pricing.

Frequently asked

Nafiul Hasan

Written by

Nafiul Hasan

Nafiul 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.

EntrepreneurAI Automation System BuilderAI EnthusiastBuilds AI Enterprise Solutions10+ years experience
More from Nafiul
Ready when you are

Connect Gmail to a client that handles the quirks automatically

Standard IMAP clients expose Gmail's label-folder mismatch, duplicate behavior, and archive-not-delete defaults. AI Emaily connects through OAuth, suppresses duplicates, triages your inbox, drafts in your configured voice, and runs your follow-ups. 7-day free trial.

  • 7-day free trial
  • Cancel anytime
  • Every provider