Hi,
I did a fresh setup of iTOP last version; Succeeded in setting up SSO with Azure MFA
Nevertheless, I block for 2 days seeting up oAuth IMAP with Azure
Could create Azure enterprise app, and create ServicePrincipal, and add permission on shared mailbox.
New-ServicePrincipal -AppId $entAppId -ServiceId $entObjId -Organization $tenantId -DisplayName 'ANVL-EXCH-SPN'
Add-MailboxPermission -Identity 'request@support.anvole.com' -User $entObjId -AccessRights FullAccess
When using script here, everything is fine and I can browse the imap mailbox
https://github.com/DanijelkMSFT/ThisandThat/blob/main/Get-IMAPAccessToken.ps1
.\Get-IMAPAccessToken.ps1 -clientsecret 'COm' -clientId f12851d -tenantID cbda***e31d -targetMailbox request@support.anvole.com
Accessing Sharedmailbox - request@support.anvole.com - with Accesstoken of User .
Connect to Office 365 IMAP Service.
When using iTOP IMAP oAuth, token is well created, when retrieving emails, always getting "cannot change folder, maybe it does not exist"
2022-11-02 02:11:40 | Debug | 17 | IMAPOAuthEmailSource Start for outlook.office365.com | OAuth |||
2022-11-02 02:11:41 | Debug | 17 | IMAP Sending: TAG1 AUTHENTICATE XOAUTH2 dXNlcj1yZXF1ZXNBAQ== | OAuth |||
2022-11-02 02:11:41 | Debug | 17 | IMAP Oauth sending AUTHENTICATE XOAUTH2 user=request@support.anvole.com auth=Bearer eyJ0eXAiOiJzG1m3g | OAuth |||
2022-11-02 02:11:41 | Debug | 17 | IMAP Receive: TAG1 OK AUTHENTICATE completed. | OAuth |||
2022-11-02 02:11:41 | Debug | 17 | IMAP Oauth receiving OK AUTHENTICATE completed. | OAuth |||
2022-11-02 02:11:41 | Debug | 17 | IMAP Sending: TAG2 SELECT "INBOX" | OAuth |||
2022-11-02 02:11:41 | Debug | 17 | IMAP Receive: TAG2 BAD User is authenticated but not connected. | OAuth |||
2022-11-02 02:11:41 | Debug | 17 | IMAP Sending: TAG3 LOGOUT | OAuth |||
2022-11-02 02:11:41 | Debug | 17 | IMAP Receive: * BYE Microsoft Exchange Server IMAP4 server signing off. | OAuth |||
2022-11-02 02:11:41 | Debug | 17 | IMAP Receive: TAG3 OK LOGOUT completed. | OAuth |||
2022-11-02 02:11:41 | Error | 17 | Failed to initialize the mailbox: request@support.anvole.com. Reason: cannot change folder, maybe it does not exist | IssueLog |||
Better with attachements
Not sure if it's case sensitive or not; isn't it usually "Inbox" ?
No, same issue
And it seems not to be case sensitive as the powershell script list all folders and gives a "INBOX" folder as you can see in attachment
https://github.com/DanijelkMSFT/ThisandThat/blob/main/Get-IMAPAccessToken.ps1
.\Get-IMAPAccessToken.ps1 -clientsecret 'COom' -clientId f12851d -tenantID 'cbda***31d' -targetMailbox request@support.anvole.com
Accessing Sharedmailbox - request@support.anvole.com - with Accesstoken of User .
Connect to Office 365 IMAP Service.
Authenticate using XOAuth2.
A01 OK AUTHENTICATE completed.
Getting mailbox folder list as authentication was successfull.
*** LIST (\Marked \HasChildren) "/" INBOX**
A01 OK LIST completed.
Logout and cleanup sessions.
OK, could solve it with a brand new Azure AD Tenant, with less security
Hi Jean-Yves,
Was this the solution? What did you do exactly?
I have it working for months, Today it suddenly stopped working.
"Failed to initialize the mailbox: xxx@xxx.nl Reason: cannot change folder, maybe it does not exist"
I checked the application in Azure, but everything seems still ok. The token is also still valid.
The SMTP function also still works, iTop still sends e-mails.
Tried to enable Debug Trace. also set 'debug to True' under "combodo-email-synchro". But i couldn't get any trace information out of it.
iTop version: 3.0.2-1-9957
Mail to ticket automation Version: 3.6.0
ran: apt-get update && upgrade
Maybe its a whole different problem, so maybe have to create a new topic for this.
since last night 2:00am it suddenly works again... i guess a hickup in Azure, but had no service health messages/alerts in Azure....
Hello, Jean-Yves.
What rights gave you to application in Azure AD.
Thanks a lot.
Thanks for the feedbacks Jean-Yves !
Closing ticket.