How to fix connection issue for outgoing server with Odoo.

Lucas Van Nedervelde 10 Reputation points
2024-01-12T14:24:16.7566667+00:00

I have configured the outgoing mail server from odoo to Azure but I got the below issue. Issue while connecting the server: The server refused the sender address (my email) with error b'5.7.57 Client not authenticated to send mail. Error: 535 5.7.3 Authentication unsuccessful [LO6P123CA0028.GBRP123.PROD.OUTLOOK.COM 2024-01-12T14:16:52.050Z 08DC12770BCFB540]' Is anything left from the Azure configuration?permission

I am looking forward to hearing back from you.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,771 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Arturo P 0 Reputation points
    2024-09-06T19:52:29.6833333+00:00

    Interesting to see we had the same issue Dieter! I'll post my solution as well, just so others can troubleshoot from two points of view.

    From what I can tell, managed windows devices (especially those managed via Microsoft Intune & autopilot) may also have Single Sign-On (SSO) enabled, so it will use windows credentials to automatically authenticate into Microsoft. If I am on a browser that is logged into Microsoft 365, SSO will automatically use my login credentials and not display the "log in with another account" option to enter the mailserver's M365 credentials in Odoo. So the session token that is granted from Microsoft is my session token, which fails when trying to send "from" the mailserver email. This is why entering a password works but Outlook Oauth doesn't if I get a valid session token but get the send error.

    Additionally, if I’m logged into Odoo with my Microsoft Azure credentials rather than an Odoo password, I will also automatically be logged in with SSO, preventing me from providing the correct credentials for the respective mail servers. This is because the browser is holding those session tokens from your microsoft user account.

    The solution here is to use a browser that is NOT Microsoft Edge (Chrome in incognito), and better yet a device that is NOT managed via Microsoft Intune, and log in to Odoo using Password credentials as an administrator user to make sure there are no active Microsoft Oauth session tokens. Then go to the mailservers and complete the Oauth authentication process with that mail server's credentials (if using a shared mailbox, make sure you reset the password for the mailbox so you can log into that shared mailbox's user account). Once complete, make sure you go to portal.office.com on the same browser that you set up the Odoo mailserver and log out of the session.

    I’ve been able to configure all of the inboxes correctly and confirm them by using the described solution. Quite a bit of nuance there, but its good to understand how SSO affects these configurations, and I hope others are able to solve their issue as well!

    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.