Repository navigation
OAuth2
OAuth2 is supported for Microsoft Outlook/Office 365 and Google Gmail. Configure OAuth instead of an IMAP password for the selected account.
- Register an application in Microsoft Entra.
- Add delegated
IMAP.AccessAsUser.Allpermission for Office 365 Exchange Online. - Enable public client flows for device-code authentication.
- Set the application client ID and, when needed, account type.
SRC_IMAP_PASSWORD=""
SRC_OAUTH2_CLIENT_ID="application-client-id"
SRC_ACCOUNT_TYPE="auto" # auto, personal, or workThe application uses device-code authentication and does not require a Microsoft client secret.
- Create or select a Google Cloud project.
- Enable the Gmail API.
- Configure the OAuth consent screen.
- Create a Desktop application OAuth client.
- Set both the client ID and client secret.
SRC_IMAP_PASSWORD=""
SRC_OAUTH2_CLIENT_ID="application-client-id"
SRC_OAUTH2_CLIENT_SECRET="application-client-secret"Persistent caching is controlled with:
OAUTH2_CACHE_ENABLED="true"
OAUTH2_CACHE_DIR=""Credentials are partitioned by provider, application, and normalized account identity. Persistent storage uses the platform-encrypted MSAL Extensions backend with cross-process locking; plaintext fallback is intentionally prohibited. If encrypted caching is unavailable, the current process continues without persistent storage. See Installation for Linux keyring setup.
Advanced OAuth endpoint overrides in .env.example are intended for testing or specialized deployments and should
normally remain empty.