Can't figure out sending through M365

Moderator: crythias

Post Reply
alltidtim
Znuny newbie
Posts: 1
Joined: 13 Aug 2025, 16:16
Znuny Version: 7.1
Real Name: Tim

Can't figure out sending through M365

Post by alltidtim »

Hi!

I've set up oauth using the following guide; https://www.znuny.org/en/blog/modern-au ... -microsoft
Inbound email works as expected though outgoing email throws an error regarding SMTP auth.
ErrorMessage: 535, 5.7.139 Authentication unsuccessful, SmtpClientAuthentication is disabled for the Tenant.

I've verified numerous times that the configuration is correct though it seems it's ignoring the configuration (SendmailModule::AuthenticationType set to OAuth2 token) and still falls back on SMTP for authentication.
Any tips on troubleshooting this further?
djsensui
Znuny newbie
Posts: 2
Joined: 07 Nov 2023, 18:07
Znuny Version: 6.5.4
Real Name: deejay

Re: Can't figure out sending through M365

Post by djsensui »

I came across on this issue just 2 weeks ago. What i remember that time is a deleted Oauth2 configuration and then restarted the server. Make sure that the appropriate configuration in admin -> system configuration (Core::Email) such as the following.

SendmailModule -> Kernel::System::Email::SMTPTLS
SendmailModule::AuthUser
SendmailModule::AuthenticationType (OAuth2 token)
SendmailModule::Host -> smtp.office365.com
SendmailModule::OAuth2TokenConfigName (The name you configure on the Oauth2 settings)
Johannes
Moderator
Posts: 436
Joined: 30 Jan 2008, 02:26
Znuny Version: All of them ^^
Real Name: Hannes
Company: Znuny|OTTERHUB

Re: Can't figure out sending through M365

Post by Johannes »

alltidtim wrote: 13 Aug 2025, 17:42 Hi!

I've set up oauth using the following guide; https://www.znuny.org/en/blog/modern-au ... -microsoft
Inbound email works as expected though outgoing email throws an error regarding SMTP auth.
ErrorMessage: 535, 5.7.139 Authentication unsuccessful, SmtpClientAuthentication is disabled for the Tenant.

I've verified numerous times that the configuration is correct though it seems it's ignoring the configuration (SendmailModule::AuthenticationType set to OAuth2 token) and still falls back on SMTP for authentication.
Any tips on troubleshooting this further?
Hi,
It says it right in the message.
"SmtpClientAuthentication is disabled for the Tenant"
Check your tenant config:
https://learn.microsoft.com/en-us/excha ... submission

and if it is enabled, it should work

Regards
Post Reply