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!

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,592 questions
Exchange Server Development
Exchange Server Development
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Development: The process of researching, productizing, and refining new or existing technologies.
508 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,473 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Glen Scales 4,431 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