mod_oauth
refreshes OAuth tokens quite frequently, sometimes multiple times in the same minute, as well as for each new session, even if an hour has not yet passed.
An example showing OAuth token refresh output just from starting a single IMAP session with remote proxy connections configured. maxuserproxies=5
in net_imap.conf
, forcing it to recreate an IMAP client at the end, as part of which it reparses the user's OAuth config, even though it hasn't really changed.
This likely stems from the fact that we write the token to the config file when we load it, thus instantly invalidating the cached version.
[2025-10-17 22:46:14.386] -- Refreshed OAuth token '1' (good for 3599s)
[2025-10-17 22:46:14.772] -- Refreshed OAuth token '2' (good for 3599s)
[2025-10-17 22:46:14.891] -- Refreshed OAuth token '3' (good for 3599s)
[2025-10-17 22:46:14.910] -- Refreshed OAuth token '4' (good for 3599s)
[2025-10-17 22:46:15.560] -- Refreshed OAuth token '5' (good for 3599s)
[2025-10-17 22:46:23.982] -- Refreshed OAuth token '4' (good for 3599s)
[2025-10-17 22:46:14.500] DEBUG[581956]: mod_oauth.c:272 fetch_token: Token refresh required (no access token pre-seeded)
[2025-10-17 22:46:14.500] DEBUG[581956]: mod_curl.c:315 bbs_curl_post: cURL POST: https://oauth2.googleapis.com/token
[2025-10-17 22:46:14.767] DEBUG[581953]: mod_curl.c:238 curl_common_run: CURL Response Code: 200 - 2236 bytes (https://login.microsoftonline.com/common/oauth2/v2.0/token)
[2025-10-17 22:46:14.770] DEBUG[581953]: mod_oauth.c:214 refresh_token: OAuth refresh token has changed
[2025-10-17 22:46:14.771] DEBUG[581953]: config.c:375 config_parse_or_write: Parsing config /home/bbs/files/home/1/.config/.oauth.conf
[2025-10-17 22:46:14.771] DEBUG[581953]: config.c:502 config_parse_or_write: Updating setting 'refreshtoken' in existing config
[2025-10-17 22:46:14.772] DEBUG[581953]: config.c:551 config_parse_or_write: Parsed config /home/bbs/files/home/1/.config/.oauth.conf
[2025-10-17 22:46:14.772] DEBUG[581953]: config.c:275 config_free: Destroying config /home/bbs/files/home/1/.config/.oauth.conf
[2025-10-17 22:46:14.772] -- Refreshed OAuth token '2' (good for 3599s)
[2025-10-17 22:46:14.886] DEBUG[581955]: mod_curl.c:238 curl_common_run: CURL Response Code: 200 - 2105 bytes (https://login.microsoftonline.com/common/oauth2/v2.0/token)
[2025-10-17 22:46:14.889] DEBUG[581955]: mod_oauth.c:214 refresh_token: OAuth refresh token has changed
[2025-10-17 22:46:14.890] DEBUG[581955]: config.c:375 config_parse_or_write: Parsing config /home/bbs/files/home/1/.config/.oauth.conf
[2025-10-17 22:46:14.890] DEBUG[581955]: config.c:502 config_parse_or_write: Updating setting 'refreshtoken' in existing config
[2025-10-17 22:46:14.890] DEBUG[581955]: config.c:551 config_parse_or_write: Parsed config /home/bbs/files/home/1/.config/.oauth.conf
[2025-10-17 22:46:14.891] DEBUG[581955]: config.c:275 config_free: Destroying config /home/bbs/files/home/1/.config/.oauth.conf
[2025-10-17 22:46:14.891] -- Refreshed OAuth token '3' (good for 3599s)
[2025-10-17 22:46:14.903] DEBUG[581954]: mod_curl.c:238 curl_common_run: CURL Response Code: 200 - 2064 bytes (https://login.microsoftonline.com/common/oauth2/v2.0/token)
[2025-10-17 22:46:14.907] DEBUG[581954]: mod_oauth.c:214 refresh_token: OAuth refresh token has changed
[2025-10-17 22:46:14.909] DEBUG[581954]: config.c:375 config_parse_or_write: Parsing config /home/bbs/files/home/1/.config/.oauth.conf
[2025-10-17 22:46:14.909] DEBUG[581954]: config.c:502 config_parse_or_write: Updating setting 'refreshtoken' in existing config
[2025-10-17 22:46:14.909] DEBUG[581954]: config.c:551 config_parse_or_write: Parsed config /home/bbs/files/home/1/.config/.oauth.conf
[2025-10-17 22:46:14.910] DEBUG[581954]: config.c:275 config_free: Destroying config /home/bbs/files/home/1/.config/.oauth.conf
[2025-10-17 22:46:14.910] -- Refreshed OAuth token '4' (good for 3599s)
You must be logged in to leave a comment.