Connecting Gmail via IMAP with an app password
Google has removed the “less secure apps” option. To connect Gmail to a third-party tool via IMAP, you now need an app password, which requires two-step verification to be enabled. The process takes five minutes and doesn't depend on any OAuth authorization that could expire.
Why IMAP rather than OAuth
A Google OAuth connection in testing mode expires after seven days: the analysis silently stops and you have to reconnect every week. An IMAP app password, on the other hand, stays valid until you revoke it. For a tool that needs to fetch your emails continuously, it's the most stable solution — and you keep one-click revocation from your Google account.
Step 1 — Enable two-step verification
- Open your Google account management, Security section.
- Choose “2-Step Verification” and follow the setup (phone number or authenticator app).
- Confirm: without this step, the app password option won't appear.
Step 2 — Generate the app password
- Still in Security, look for “App passwords.”
- Create an entry, name it for example “Happy Assistant.”
- Google shows a 16-character code in four groups. Copy it right away: it won't be shown again.
This code grants read access to your inbox: treat it like a password. It doesn't replace your Google password and is revoked independently.
Step 3 — Enter the connection details
In Happy Assistant, open your profile then “Connect Gmail (IMAP).” The server settings are pre-filled; only two fields need to be entered.
| Field | Value |
|---|
| IMAP server | imap.gmail.com |
| Port | 993 (SSL/TLS) |
| Username | your full Gmail address |
| Password | the 16-character code, without spaces |
After confirming, a first batch of recent messages is analyzed, then fetching continues automatically. If the connection fails, the cause is almost always one of three: two-step verification not enabled, regular password used instead of the app code, or spaces left in the copied code.
What about other providers?
| Provider | IMAP server | Port |
|---|
| Gmail | imap.gmail.com | 993 |
| Outlook / Hotmail | outlook.office365.com | 993 |
| iCloud | imap.mail.me.com | 993 |
| Free | imap.free.fr | 993 |
| Orange | imap.orange.fr | 993 |
Outlook and iCloud also require an app password if two-factor authentication is active. Professional servers generally accept the account's usual password.
Frequently asked questions
How do I revoke access later?
From your Google account, go to Security then “App passwords,” and delete the entry you created. Access is cut immediately, without changing your Google password.
Are my emails copied to a server?
No. Messages are read to be analyzed; only technical identifiers and extracted elements (title, date, suggested category) are kept.