···138138139139Use an app-specific password (Gmail, Fastmail, Hostpoint, etc.) rather than your main account password.
140140141141-For the full configuration reference including multiple accounts, `[[senders]]` aliases, folder customization, signatures, and UI options, see [docs/configuration.md](docs/configuration.md).
141141+For the full configuration reference including multiple accounts, OAuth2 authentication, `[[senders]]` aliases, folder customization, signatures, and UI options, see [docs/configuration.md](docs/configuration.md).
142142143143### Onboarding
144144
···1313password = "app-password"
1414from = "Me <me@example.com>"
15151616+# OAuth2 authenticated accounts are supported, it just need the relevant fields. Note that the password field is not required.
1717+[[accounts]]
1818+name = "Personal"
1919+imap = "imap.example.com:993" # :993 = TLS, :143 = STARTTLS
2020+smtp = "smtp.example.com:587"
2121+user = "me@example.com"
2222+from = "Me <me@example.com>"
2323+oauth2_client_id = ""
2424+oauth2_client_secret = ""
2525+oauth2_issuer_url = ""
2626+oauth2_scopes = ["", ""]
2727+1628# Multiple accounts supported — add more [[accounts]] blocks
1729# Switch between them with `ctrl+a` in the inbox
1830···7587The `signature` field in `[ui]` is appended automatically when opening a new compose buffer (`c`). It is **not** added for replies. The separator `--` is inserted for you — just write the signature body in Markdown.
76887789Use TOML triple-quoted strings (`"""`) to preserve line breaks. The signature appears at the end of the buffer — you can edit or delete it before saving.
9090+9191+## OAuth2 Authentication
9292+9393+Neomd supports OpenAuth2 authenticated accounts, you just need to add `oauth2_client_id`, `oauth2_client_secret`, `oauth2_scopes` and `oauth2_issuer_url`.
9494+9595+Note that when using oauth2 authentication, the password field is not required in the account configuration.
9696+9797+### Issuer URL
9898+9999+By default, if an issuer URL is provided, i.e.: `https://login.microsoftonline.com/common/v2.0` for Office265 accounts, neomd will search for the OpenID Connect discovery URL: `/.well-known/openid-configuration` resolving then the `oauth2_token_url` and `oauth2_auth_url`. These parameters can be provided manually as well.
100100+101101+### Scopes
102102+103103+The scopes required depends on the provider and is better confirmed by your email provider. As an example, for Office365 acounts, the following scopes are required for IMAP: `"https://outlook.office365.com/IMAP.AccessAsUser.All", "offline_access"`.
104104+105105+### Reference documentation for GMAIL and Office365
106106+107107+- To enable OAuth2 authentication for Office365 accounts, follow the documentation [here]("https://outlook.office365.com/IMAP.AccessAsUser.All", "offline_access")
108108+- For GMAIL, follow the documentation [here](https://developers.google.com/workspace/gmail/imap/xoauth2-protocol)