Took me some time to figure that out
First, install Thunderbird Custom IdP (OIDC/OAuth2) — OAuthPatch extension. Then, import this JSON through its settings:
{
"disableExchangeAutodiscovery": true,
"providers": [
{
"name":"production",
"hostname":"imap.shpakovsky.ru smtp.shpakovsky.ru",
"issuer":"auth.shpakovsky.ru",
"clientId":"...",
"clientSecret": "***SECRET***",
"usePkce":false,
"authorizationEndpoint": "https://auth.shpakovsky.ru/authorize",
"tokenEndpoint": "https://auth.shpakovsky.ru/api/oidc/token",
"redirectUri": "https://localhost",
"scopes":{"imap":"openid email profile","smtp":"openid email profile"}
}
]
}
Remember to paste actual client id and secret, that your OIDC provider (TinyAuth in my case) will understand!
Also note that unlike FairEmail, Thunderbird supports having OIDC login for IMAP servers, and separate login/password for SMTP.