New connection protocolls in 2023 for ms-office emails, no more imap access to mailbox?

Nils H 1 Reputation point
2022-12-05T15:40:30.583+00:00

Hallo all,

My initial question is how to handle reading mails in 2023 from ms-office mailboxes. I have a non-interactive script that used IMAP to login with several ms-office accounts across multiple azure ADs.

I found a similar question: https://learn.microsoft.com/en-us/answers/questions/872062/how-to-authenticate-a-backend-java-imap-applicatio-1.html

However i absolutely don't want the user to make an interactive login.
I have the password for each account so maybe i can still use oatuh, otherwise i might need ms-graph? I am quite new to this so i don't know where to start to upgrade my application and read how to get there since there are several concepts for modern authentication and i don't know where to start.

Here are the keys to my script:

Can someone tell me what steps i would need to do to get this working? A general step-by-step explanation or code examples in c#,go,java or whatever are much welcome!

Exchange | Exchange Server | Development
Microsoft Security | Microsoft Entra | Microsoft Entra ID
Microsoft Security | Microsoft Graph
{count} votes

1 answer

Sort by: Most helpful
  1. Glen Scales 4,446 Reputation points
    2022-12-13T22:32:44.05+00:00

    My initial question is how to handle reading mails in 2023 from ms-office mailboxes. I have a non-interactive script that used IMAP to login with several ms-office accounts across multiple azure ADs.

    You can use the Graph API https://learn.microsoft.com/en-us/graph/api/resources/message?view=graph-rest-1.0 and for authentication use the client credentials flow https://learn.microsoft.com/en-us/azure/active-directory/develop/msal-authentication-flows which is what you use for non-interactive apps.

    Can someone tell me what steps i would need to do to get this working? A general step-by-step explanation or code examples in c#,go,java or whatever are much welcome!

    There are good tutorials for the graph at https://learn.microsoft.com/en-us/graph/tutorials in a number of languages that give you the step by step and code samples

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.