Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IMAP with outlook.office365.com and XOAUTH2 fails since 18-Feb-2024 with command LIST illegal in state NONAUTH #187

Open
weisslj opened this issue Feb 27, 2024 · 0 comments

Comments

@weisslj
Copy link

weisslj commented Feb 27, 2024

Bug description

Since around 18-Feb-2024 fetching email with offlineimap via IMAP from my work account outlook.office365.com via XOAUTH2 fails with command LIST illegal in state NONAUTH. Nothing was changed on my laptop as far as I know, and also not on the remote side according to our administrators. Accessing via mutt, thunderbird, and mbsync still works!

First I thought this is related to the changed Thunderbird client ID from 08162f7c-0fd2-4200-a84a-f25a4db0b584 to 9e5f94bc-e8a4-4e73-b8be-63364c29d753, but that does not seem to be the case!

General informations

  • system/distribution (with version): Debian GNU/Linux Stable (Bookworm)
  • offlineimap version (offlineimap -V): offlineimap v8.0.0, imaplib2 v3.06, Python v3.11.2, OpenSSL 3.0.11 19 Sep 2023 (also latest master v8.0.0-38-gd29a4dc = d29a4dc)
  • Python version: Python 3.11.2
  • server name or domain: outlook.office365.com
  • CLI options: offlineimap -o -1

Configuration file offlineimaprc

[general]
accounts = work
pythonfile = ~/.offlineimap.py

[Account work]
localrepository = work-Local
remoterepository = work-Remote

[Repository work-Local]
type = Maildir
localfolders = ~/mail/work
sep = /

[Repository work-Remote]
type = IMAP
ssl = yes
sslcacertfile = /etc/ssl/certs/ca-certificates.crt
auth_mechanisms = XOAUTH2
oauth2_request_url = https://login.microsoftonline.com/common/oauth2/v2.0/token
# from https://hg.mozilla.org/comm-central/file/tip/mailnews/base/src/OAuth2Providers.jsm
oauth2_client_id = 9e5f94bc-e8a4-4e73-b8be-63364c29d753
oauth2_client_secret = 
# via https://github.com/UvA-FNWI/M365-IMAP
oauth2_refresh_token_eval = keyring.get_password('offlineimap-refresh-token', 'mymail@mycompany.com')
remotehost = outlook.office365.com
remoteuser = mymail@mycompany.com
remotepasseval = keyring.get_password('offlineimap', 'mymail@mycompany.com')
createfolders = no

pythonfile (if any)

import keyring

Logs, error

OfflineIMAP 8.0.0
  Licensed under the GNU GPL v2 or any later version (with an OpenSSL exception)
imaplib2 v3.06, Python v3.11.2, OpenSSL 3.0.11 19 Sep 2023
Account sync work:
 *** Processing account work
 Establishing connection to outlook.office365.com:993 (work-Remote)
 ERROR: While attempting to sync account 'work'
  command LIST illegal in state NONAUTH
 *** Finished account 'work' in 0:00
 ERROR: Exceptions occurred during the run!
 ERROR: While attempting to sync account 'work'
  imaplib2.imaplib2.IMAP4.error: command LIST illegal in state NONAUTH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant