salesagility / SuiteCRM

SuiteCRM - Open source CRM for the world
https://www.suitecrm.com
GNU Affero General Public License v3.0
4.45k stars 2.08k forks source link

Microsoft 365 SMTP could not authenticate in SuiteCRM #9371

Open hitechparadigm opened 2 years ago

hitechparadigm commented 2 years ago

Issue

Office365 SMTP settings cannot authenticate in SuiteCRM.

When I try to configure the default outgoing mail server for sending email notifications using Microsoft 365 smtp.office365, port 587, SuiteCRM gives me SMTP Error: Could not authenticate.

Here is the log

3: Connection: opened
2: SERVER → CLIENT: 220 BL1P222CA0017.outlook.office365.com Microsoft ESMTP MAIL Service ready at Sat, 20 Nov 2021 02:56:36 +0000

1: CLIENT → SERVER: EHLO 54.90.134.19

2: SERVER → CLIENT: 250-BL1P222CA0017.outlook.office365.com Hello [54.90.134.19]
250-SIZE 157286400
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-STARTTLS
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250 SMTPUTF8

1: CLIENT → SERVER: STARTTLS

2: SERVER → CLIENT: 220 2.0.0 SMTP server ready

1: CLIENT → SERVER: EHLO 54.90.134.19

2: SERVER → CLIENT: 250-BL1P222CA0017.outlook.office365.com Hello [54.90.134.19]
250-SIZE 157286400
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-AUTH LOGIN XOAUTH2
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250 SMTPUTF8

1: CLIENT → SERVER: AUTH LOGIN

2: SERVER → CLIENT: 334 VXNlcm5hbWU6

1: CLIENT → SERVER: —obfuscated—
2: SERVER → CLIENT: 334 UGFzc3dvcmQ6

1: CLIENT → SERVER: —obfuscated—
2: SERVER → CLIENT: 535 5.7.139 Authentication unsuccessful, SmtpClientAuthentication is disabled for the Tenant. Visit https://aka.ms/smtp_auth_disabled for more information. [BL1P222CA0017.NAMP222.PROD.OUTLOOK.COM]

1: SMTP ERROR: Password command failed: 535 5.7.139 Authentication unsuccessful, SmtpClientAuthentication is disabled for the Tenant. Visit https://aka.ms/smtp_auth_disabled for more information. [BL1P222CA0017.NAMP222.PROD.OUTLOOK.COM]

3: SMTP Error: Could not authenticate.
1: CLIENT → SERVER: QUIT

2: SERVER → CLIENT: 221 2.0.0 Service closing transmission channel

3: Connection: closed
3: SMTP Error: Could not authenticate.

Expected Behavior

I want to be able to configure SuiteCRM outbound email using the Office 365 SMTP settings: server: smtp.office365.com port: 587 (SSL/TLS)

Actual Behavior

Every time I try to send a test email, I get this error: SMTP Error: Could not authenticate

Possible Fix

Have no idea.

Steps to Reproduce

  1. Log into SuiteCRM as admin
  2. Go to Admin > Email Settings
  3. Exchange Server: smtp.office365.com
  4. Exchange Server Port: 587
  5. Enable SMTP over SSL or TSL: TLS
  6. User SMTP Authentication: X
  7. Exchange Username: your office 365 username@domain.com
  8. Exchange Password: your O365 password

Context

As a lot of corporate clients use O365, it is critical to have the issue resolved.

Your Environment

johnM2401 commented 2 years ago

Hey,

I haven't used Office365 myself, I'm afraid, but I have had a look around for those error messages. I've found some threads online wherein others have noted this issue with other applications

Perhaps some of the steps here can assist?:

This thread mentions enabling/using App Passwords for Office365: https://stackoverflow.com/questions/24947434/setting-up-phpmailer-with-office365-smtp

This thread here mentions modifying the Security options for Legacy Auth/Azure: https://docs.microsoft.com/en-us/answers/questions/512954/535-57139-authentication-unsuccessful.html

This thread mentions enabling "Authenticated SMTP" in your Office 365 Admin panel: https://stackoverflow.com/questions/50365644/cant-connect-to-office365-smtp-via-phpmailer

Does anything above lead you to a solution? Please let us know if you are still having issues!

tsmgeek commented 2 years ago

Not directly an issue with SuiteCRM, your O365 tenant has SMTP auth disabled. You can either get it enabled or use a 3rd party SMTP service such as Sendgrid, Amazon SES etc as many of them support SMTP plain text auth.

We have a similar ticket for Gsuite deprecation of SMTP plain auth #8791.

535 5.7.139 Authentication unsuccessful, SmtpClientAuthentication is disabled for the Tenant. Visit https://aka.ms/smtp_auth_disabled for more information.

andresgarcia0313 commented 2 years ago

Tengo el mismo problema con gmail and O365

andresgarcia0313 commented 2 years ago

I have the same problem with gmail and o365

andresgarcia0313 commented 2 years ago

solved with google when creating an application password https://support.google.com/accounts/answer/185833?hl=es but not with office because it no longer allows creating an application password now it asks to create MFA authentication