question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Office 365 SMTP authentication

See original GitHub issue

⚠️ Please verify that this bug has NOT been raised before.

  • I checked and didn’t find similar issue

🛡️ Security Policy

Description

Upon creating a Mail Notification and using Office 365 i run in following Error:

Error: Invalid login: 535 5.7.139 Authentication unsuccessful, the request did not meet the criteria to be authenticated successfully. Contact your administrator. [AM6P193CA0093.EURP193.PROD.OUTLOOK.COM] at SMTPConnection._formatError (/app/node_modules/nodemailer/lib/smtp-connection/index.js:784:19) at SMTPConnection._actionAUTHComplete (/app/node_modules/nodemailer/lib/smtp-connection/index.js:1536:34) at SMTPConnection.<anonymous> (/app/node_modules/nodemailer/lib/smtp-connection/index.js:1490:18) at SMTPConnection._processResponse (/app/node_modules/nodemailer/lib/smtp-connection/index.js:947:20) at SMTPConnection._onData (/app/node_modules/nodemailer/lib/smtp-connection/index.js:749:14) at TLSSocket.SMTPConnection._onSocketData (/app/node_modules/nodemailer/lib/smtp-connection/index.js:189:44) at TLSSocket.emit (node:events:527:28) at addChunk (node:internal/streams/readable:315:12) at readableAddChunk (node:internal/streams/readable:289:9) at TLSSocket.Readable.push (node:internal/streams/readable:228:10) { code: 'EAUTH', response: '535 5.7.139 Authentication unsuccessful, the request did not meet the criteria to be authenticated successfully. Contact your administrator. [AM6P193CA0093.EURP193.PROD.OUTLOOK.COM]', responseCode: 535, command: 'AUTH LOGIN' }

image

👟 Reproduction steps

Create New Notification Enter Office 365 Credentials Test

👀 Expected behavior

Sending a E-Mail

😓 Actual Behavior

Runs in an authentication error

🐻 Uptime-Kuma Version

1.16.1

💻 Operating System and Arch

linux x86_64 Debian GNU/Linux 11 (bullseye)

🌐 Browser

Google Chrome Version 102.0.5005.62

🐋 Docker Version

20.10.12 (API: 1.41)

🟩 NodeJS Version

No response

📝 Relevant log output

Error: Invalid login: 535 5.7.139 Authentication unsuccessful, the request did not meet the criteria to be authenticated successfully. Contact your administrator. [AM6P193CA0093.EURP193.PROD.OUTLOOK.COM]
    at SMTPConnection._formatError (/app/node_modules/nodemailer/lib/smtp-connection/index.js:784:19)
    at SMTPConnection._actionAUTHComplete (/app/node_modules/nodemailer/lib/smtp-connection/index.js:1536:34)
    at SMTPConnection.<anonymous> (/app/node_modules/nodemailer/lib/smtp-connection/index.js:1490:18)
    at SMTPConnection._processResponse (/app/node_modules/nodemailer/lib/smtp-connection/index.js:947:20)
    at SMTPConnection._onData (/app/node_modules/nodemailer/lib/smtp-connection/index.js:749:14)
    at TLSSocket.SMTPConnection._onSocketData (/app/node_modules/nodemailer/lib/smtp-connection/index.js:189:44)
    at TLSSocket.emit (node:events:527:28)
    at addChunk (node:internal/streams/readable:315:12)
    at readableAddChunk (node:internal/streams/readable:289:9)
    at TLSSocket.Readable.push (node:internal/streams/readable:228:10) {
  code: 'EAUTH',
  response: '535 5.7.139 Authentication unsuccessful, the request did not meet the criteria to be authenticated successfully. Contact your administrator. [AM6P193CA0093.EURP193.PROD.OUTLOOK.COM]',
  responseCode: 535,
  command: 'AUTH LOGIN'
}

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
Computronikscommented, Jun 1, 2022

Ahh ok, so we would need to support a new method of authentication for microsoft email servers such as OAuth2. In which case, would it be possible to change this issue from a bug to a feature request for support for this. Anoyingly, OAuth will be more complicated to implement as it requires that we register the app with Azure Active directory. Microsoft have provided details on how to go about implementing this feature here, https://docs.microsoft.com/en-us/exchange/client-developer/legacy-protocols/how-to-authenticate-an-imap-pop-smtp-application-by-using-oauth. Due to the deadline of October 1, 2022 this should probably be fairly high priority as it will probably take a while to get the registration with Azure.

@louislam Sorry to ping you, as this requires registering with an external service, I think that that might be something that you would need to do. I could probably get the rest of it done this weekend or next weekend because I plan to finish off #1550 tomorrow (02/06/22)

Link to docs for nodemailer: https://nodemailer.com/smtp/oauth2/

0reactions
Computronikscommented, Jun 2, 2022

Thanks, just checked their guide, it is quite a lot of steps and difficult in order to get all IDs. I think Microsoft really make a big mistake for this, people will just quit and use other smtp providers.

Yeah, I can understand why they did it but it does seem like a really annoying step, especially when it is so easy with gmail (only need to enable smtp auth in settings)

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to set up a multifunction device or application to send ...
Option 1: Authenticate your device or application directly with a Microsoft 365 or Office 365 mailbox, and send mail using SMTP AUTH client ......
Read more >
Microsoft 365 SMTP Settings (Office 365) Explained: Key Details
1. Enable SMTP Authentication in Microsoft 365 ... In order to send your WordPress site's emails via your Microsoft 365 email address, you'll ......
Read more >
Enable SMTP Authentication | Microsoft 365 from GoDaddy
Enable SMTP Authentication · Sign in to your Email & Office Dashboard (use your GoDaddy username and password). · Select Manage next to...
Read more >
How do I use Office365 for SMTP? - Knowledgebase
SMTP relay lets Office 365 relay emails on your behalf by using your public IP address (or a certificate) to authenticate Office 365....
Read more >
How to send emails using Office 365 SMTP AUTH, HELP!
SMTP Authentication can be configured at the tenant level and the user's level. The first one is a configuration globally for all the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found