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