I have confirmed the OAUTH2 secret is valid (expires in 2025) and token and refresh tokens are both valid. Everything is correct in Azure App registration; nothing has changed with either O365 or Znuny (except I went on vacation for a couple weeks )
We were getting timeout errors, I saw another post viewtopic.php?f=62&t=43736 that said to update to IMAPS versus IMAPTLS.
Now I am getting the error 2 BAD User is authenticated, but not connected.
I am at a loss here.....
Partial output of command line fetch:
Code: Select all
-bash-4.2$ ./otrs.Console.pl Maint::PostMaster::MailAccountFetch --debug --force-pid
Spawning child process to fetch incoming messages from mail accounts...
outlook.office365.com (IMAPS)...
IMAPS: Connection to outlook.office365.com closed.
Started at Mon Jul 24 11:33:58 2023
Using Mail::IMAPClient version 3.43 on perl 5.016003
Connecting with IO::Socket::SSL PeerAddr outlook.office365.com PeerPort 993 Proto tcp Timeout 600 Debug 1 SSL_verify_mode 0
Connected to outlook.office365.com
Read: * OK The Microsoft Exchange IMAP4 service is ready. [UwBKADAAUABSADAANQBDAEEAMAAwADAAMwAuAG4AYQBtAHAAcgBkADAANQAuAHAAcgBvAGQALgBvAHUAdABsAG8AbwBrAC4AYwBvAG0A]
Sending: 1 AUTHENTICATE XOAUTH2
Sent 24 bytes
Read: +
Sending: [Redact: Count=1 Showcredentials=OFF]
Sent 3054 bytes
Read: 1 OK AUTHENTICATE completed.
Sending: 2 SELECT INBOX
Sent 16 bytes
Read: 2 BAD User is authenticated but not connected.
ERROR: 2 BAD User is authenticated but not connected. at /usr/local/share/perl5/Mail/IMAPClient.pm line 1388.
Mail::IMAPClient::__ANON__('2 BAD User is authenticated but not connected.\x{d}\x{a}') called at /usr/local/share/perl5/Mail/IMAPClient.pm line 1424
Mail::IMAPClient::_get_response('Mail::IMAPClient=HASH(0x4b15d50)', 2, undef) called at /usr/local/share/perl5/Mail/IMAPClient.pm line 1350
Mail::IMAPClient::_imap_command_do('Mail::IMAPClient=HASH(0x4b15d50)', 'SELECT INBOX') called at /usr/local/share/perl5/Mail/IMAPClient.pm line 1248
Mail::IMAPClient::_imap_command('Mail::IMAPClient=HASH(0x4b15d50)', 'SELECT INBOX') called at /usr/local/share/perl5/Mail/IMAPClient.pm line 864
Mail::IMAPClient::select('Mail::IMAPClient=HASH(0x4b15d50)', 'INBOX') called at /opt/otrs/Kernel/System/MailAccount/IMAP.pm line 301
eval {...} called at /opt/otrs/Kernel/System/MailAccount/IMAP.pm line 305