Hello @Ahrshia Rezai , users will need to acquire a token interactively to get access tokens for IMAP, POP and SMTP Auth. You can use Sign-in frequency, Stay signed in and refresh tokens to minimize the need to re-authenticate. For a pure server to server scenario the only option is trough MS Graph which is a more robust and secure solution than using legacy protocols. That being said, provided a careful approach to security is kept, nothing prevents you from building a daemon application that stores user credentials (Managed Identities and Key Vault can be used to secure their management) which in tandem with the ROPC can be used to acquire user access tokens that allow the aforementioned legacy protocols to be used.
Let us know if this answer was helpful to you or if you need additional assistance. If it was helpful, please remember to accept it so that others in the community with similar questions can more easily find a solution.