OAUTH2 - SMTP authentication failed

Moderator: crythias

Post Reply
restartengineer
Znuny newbie
Posts: 8
Joined: 17 Jan 2023, 16:24
Znuny Version: 6.4
Real Name: Rekiyan Seto

OAUTH2 - SMTP authentication failed

Post by restartengineer »

Hi All,

I keep getting this error message when I send email with Znuny.
SMTP authentication failed (SMTP code: 535, ErrorMessage: 535, 5.7.139 Authentication unsuccessful, the user credentials were incorrect. [SI1PR02CA0010.apcprd02.prod.outlook.com] )
I am using Znuny 6.4.4 and configured it with the OAUTH2 authentication. It works for the POP3S configuration, I am able to fetch and receive a new ticket, but I am unable to send any message.
Image

I am very sure that I have correctly configured my OAUTH and my SMTP/Sendmailmodule as I follow this documentation https://www.znuny.org/en/blog/modern-au ... -microsoft. I have set the same email address for my System Email Address, OAUTH2 token request, and all SendmailModule related configuration.

I have been googling around for 2 weeks, and I can't find any solution to this. I would really realy appreciate any help on this.

Thanks.
Best Regards
root
Administrator
Posts: 3934
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: OAUTH2 - SMTP authentication failed

Post by root »

Hi,

Probably there is something to fix in O365. Have you checked https://docs.microsoft.com/en-us/exchan ... submission?

- Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
restartengineer
Znuny newbie
Posts: 8
Joined: 17 Jan 2023, 16:24
Znuny Version: 6.4
Real Name: Rekiyan Seto

Re: OAUTH2 - SMTP authentication failed

Post by restartengineer »

Hi Roy,

I think I have the correct configuration at my O365 environment.
1. Turned Off the SMTP AUTH
2. Turned on use of Legacy TLS
Image

3. Enabled the Authenticated SMTP for the user I used for my SMTP configuration
Image

Any other advise?

Thanks,
Best Regards
zzz
Znuny superhero
Posts: 888
Joined: 15 Dec 2016, 15:13
Znuny Version: All
Real Name: Emin
Company: Efflux GmbH
Contact:

Re: OAUTH2 - SMTP authentication failed

Post by zzz »

Hey,

Is the same account that is authenticating trying to send the mail?

Best regards
Emin
Professional OTRS, Znuny & OTOBO services: efflux.de | efflux.de/en/

Free and premium add-ons: German | English
restartengineer
Znuny newbie
Posts: 8
Joined: 17 Jan 2023, 16:24
Znuny Version: 6.4
Real Name: Rekiyan Seto

Re: OAUTH2 - SMTP authentication failed

Post by restartengineer »

Yes it is. The account I use to send the email is the same as the one I use to authenticate the OAUTH2 Token.
MichaelVD
Znuny newbie
Posts: 3
Joined: 29 Dec 2022, 17:25
Znuny Version: 6.0.38 CE
Real Name: Michael

Re: OAUTH2 - SMTP authentication failed

Post by MichaelVD »

did you find a solution? I seem to have the same problem
restartengineer
Znuny newbie
Posts: 8
Joined: 17 Jan 2023, 16:24
Znuny Version: 6.4
Real Name: Rekiyan Seto

Re: OAUTH2 - SMTP authentication failed

Post by restartengineer »

No. Still no solution 😅
I use SMTP Auth for the workaround.
MichaelVD
Znuny newbie
Posts: 3
Joined: 29 Dec 2022, 17:25
Znuny Version: 6.0.38 CE
Real Name: Michael

Re: OAUTH2 - SMTP authentication failed

Post by MichaelVD »

Yes I also keep using the SMTP Auth for the moment but in 6 days the simple authentication will be disabled in my o365 😅
restartengineer
Znuny newbie
Posts: 8
Joined: 17 Jan 2023, 16:24
Znuny Version: 6.4
Real Name: Rekiyan Seto

Re: OAUTH2 - SMTP authentication failed

Post by restartengineer »

Mine would be deactivated in four days.😔😄
The SMTP auth will apparently not be disabled just yet.
MichaelVD
Znuny newbie
Posts: 3
Joined: 29 Dec 2022, 17:25
Znuny Version: 6.0.38 CE
Real Name: Michael

Re: OAUTH2 - SMTP authentication failed

Post by MichaelVD »

It is working now for me. :-D

I added the account that is sending the mails to the "user and groups" of the application in the azure application
And clicked on request new token in the OTRS oauth2 Configuration management and used this same account to log in for the token request
Post Reply