Question: How do I set up IMAP on a Google Workspace (Gmail) account?
Explanation: To receive or send email from another application (for example an accounting program, ticketing system, or email client) you often need to set up IMAP. IMAP stands for Internet Message Access Protocol and is used to connect to a mail server, alongside the older POP(3) protocol. The difference: with IMAP messages stay on the server and synchronise across devices, with POP3 they are downloaded and then removed from the server.
Connecting an external application to Gmail can be tricky because IMAP is an old protocol and Google has built extra security around it. Since May 2025, Google Workspace no longer accepts basic authentication (plain username and password) for IMAP, SMTP and POP. You must therefore connect through OAuth 2.0 or via an app password in combination with two-step verification.
- OAuth 2.0 is the recommended method. The application receives a digital token instead of a password, and the user never has to hand over their actual password to the application. Modern clients like Thunderbird, the Mail app on iOS and macOS, and newer versions of Outlook support this out of the box. When adding an account, click 'Sign in with Google' to activate OAuth.
- App passwords are a fallback option for devices and software that don't support OAuth, such as older printers, scanners, some accounting systems, and older versions of Outlook. An app password is a 16-character code that only works for that one device, and which you can revoke at any time without changing your main password. Two-step verification on the account is required for app passwords.
Solution:
There are three parties involved in setting up IMAP, and something has to happen at each one before the connection works.
Go to Apps > Google Workspace > Gmail > End User Access in the Google Admin Console and turn on IMAP access for the right OU or for all users.
- Go to Gmail Settings > Forwarding and POP/IMAP, or open Gmail and click the gear icon in the top right, then 'See all settings', then the 'Forwarding and POP/IMAP' tab.
- Under IMAP access select 'Enable IMAP'.
- Click 'Save Changes' at the bottom.
After enabling, it can take up to 24 hours before IMAP actually works for the user.
- Go to myaccount.google.com/apppasswords. Alternatively: click your profile picture in the top right, choose 'Manage your Google Account', then 'Security', and search for 'app password'.
- Enter a recognisable name for the application or device, for example Thunderbird laptop Anne or Brother printer office. This name helps you identify the password later.
- Click 'Generate'. The 16-character password now appears once in a yellow box. Save it immediately or paste it straight into the application. Google will never show the password again.
| Setting | Value |
|---|---|
| Incoming mail server (IMAP) | imap.gmail.com |
| IMAP port | 993 |
| IMAP encryption | SSL/TLS |
| Outgoing mail server (SMTP) | smtp.gmail.com |
| SMTP port | 587 (STARTTLS) or 465 (SSL) |
| SMTP encryption | STARTTLS or SSL/TLS |
| Username | Full Google Workspace email address |
| Password | App password from step 3 (or OAuth token for modern clients) |
Setting up for specific devices and programs
- Option 1, SMTP Relay (recommended for printers): Allows the device to send without storing a username or password on the device itself. Authentication runs via IP address and TLS. Configure this in Apps > Google Workspace > Gmail > Routing, scroll to 'SMTP relay service' and set the allowed IP address. On the device, use smtp-relay.gmail.com on port 587 (TLS) without authentication. Limit: 10,000 messages per user per day.
- Option 2, App password on the device: Use smtp.gmail.com on port 587 with an app password. Limit: 2,000 messages per day. Works for most older printers.
Per brand:
- Canon (unified Firmware Platform v3.18 or higher): supports OAuth.
- HP (FutureSmart 5.7 or higher): supports OAuth.
- Lexmark (FW24 or higher): supports OAuth.
- Ricoh, Savin, Lanier: limited OAuth support, preferably use SMTP Relay.
- Xerox: at the time of writing doesn't support OAuth, use SMTP Relay or an app password.
- Outlook 2019, 2021, Microsoft 365 and the new Outlook: support OAuth. Add the account via 'File > Add Account' and choose 'Sign in with Google' when prompted.
- Outlook 2016 or older: doesn't support OAuth. Use Google Workspace Sync for Microsoft Outlook (GWSMO) or upgrade to a newer version.
- Thunderbird: supports OAuth since version 77. Remove existing accounts that still use a password, and re-add them with the 'OAuth2' option under the authentication setting.
- Apple Mail on macOS and iOS: supports OAuth. Remove the existing Google account and re-add it via 'System Settings > Internet Accounts > Google'.
- First check whether the application offers 'Sign in with Google' or 'Connect Gmail via OAuth', this is always preferred.
- If OAuth doesn't work, use an app password with the IMAP and SMTP settings from step 4.
- For outreach or mailing tools (such as Mailchimp, Brevo): IMAP is not the right route. Use the tool's own sending infrastructure instead, and make sure your SPF and DKIM are properly configured.
Common issues and frequently asked questions: