[GH-ISSUE #1020] Email authentication fails with Microsoft 365 Outlook SMTP #717

Open
opened 2026-05-07 00:26:51 +02:00 by BreizhHardware · 1 comment

Originally created by @MrChadMWood on GitHub (Feb 8, 2024).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1020

🐞 Describe the bug
Email authentication fails with Microsoft 365 Outlook SMTP using STARTTLS encryption,

💻 Components impacted
Server-side

💡 Screenshots and/or logs

### smtp-mail.outlook.com:587
{"time":"2024-02-08T22:33:56.559Z","level":"WARN","message":"Unable to send email to cencored@cencored.com: 504 5.7.4 Unrecognized authentication type [CY4PR0501MB3908.namprd05.prod.outlook.com 2024-02-08T22:33:51.710Z 08DC255743C7]","email":"cencored@cencored.com","error":"504 5.7.4 Unrecognized authentication type [CY4PR0501MB3908.namprd05.prod.outlook.com 2024-02-08T22:33:51.710Z 08DC25520C743C70]","message_body_size":9,"message_event":"message","message_id":"4qmF5LaJcSpv","message_sender":"172.25.0.1","message_time":1707431626,"message_user":"u_U5MeBhxJuu","tag":"email","topic":"test-expiry-notifications","user_id":"u_U5MeBhxJuu","user_name":"cwood","visitor_auth_limiter_limit":0.016666666666666666,"visitor_auth_limiter_tokens":30,"visitor_emails":2,"visitor_emails_limit":24,"visitor_emails_remaining":22,"visitor_id":"ip:172.25.0.1","visitor_ip":"172.25.0.1","visitor_messages":2,"visitor_messages_limit":17280,"visitor_messages_remaining":17278,"visitor_request_limiter_limit":0.2,"visitor_request_limiter_tokens":57.056149986399994,"visitor_seen":"2024-02-08T22:33:52.477Z"}

### smtp-legacy.office365.com:587
{"time":"2024-02-08T23:16:18.697Z","level":"WARN","message":"Unable to send email to cencored@cencored.com: 504 5.7.4 Unrecognized authentication type [CY4PR0501.prod.exchangelabs.com 2024-02-08T23:16:13.824Z 08DC27850D59]","email":"cencored@cencored.com","error":"504 5.7.4 Unrecognized authentication type [CY4PR0501.prod.exchangelabs.com 2024-02-08T23:16:13.824Z 08DC278511F0D59E]","message_body_size":9,"message_event":"message","message_id":"H0c2IFiqomiR","message_sender":"172.26.0.1","message_time":1707434168,"message_user":"u_U5MeBhxJuu","tag":"email","topic":"test-expiry-notifications","visitor_auth_limiter_limit":0.016666666666666666,"visitor_auth_limiter_tokens":30,"visitor_emails":1,"visitor_emails_limit":24,"visitor_emails_remaining":23,"visitor_id":"ip:172.26.0.1","visitor_ip":"172.26.0.1","visitor_messages":1,"visitor_messages_limit":17280,"visitor_messages_remaining":17279,"visitor_request_limiter_limit":0.2,"visitor_request_limiter_tokens":60,"visitor_seen":"2024-02-08T23:16:09.983Z"}

At first I attempted to connect as described in Microsofts documentation:

# /etc/ntfy/server.yml

smtp-sender-addr: "smtp-mail.outlook.com:587"
smtp-sender-from: "alias@cencored.com"
smtp-sender-pass: "cencored"
smtp-sender-user: "cencored@cencored.com"

After that, I attempted using the legacy smtp endpoint as documented here.
smtp-sender-addr: "smtp-legacy.office365.com:587"

In either case it fails with the errors provided.

🔮 Additional context
Stack Exchange

Originally created by @MrChadMWood on GitHub (Feb 8, 2024). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1020 :lady_beetle: **Describe the bug** Email authentication fails with Microsoft 365 Outlook SMTP using STARTTLS encryption, :computer: **Components impacted** Server-side :bulb: **Screenshots and/or logs** ``` ### smtp-mail.outlook.com:587 {"time":"2024-02-08T22:33:56.559Z","level":"WARN","message":"Unable to send email to cencored@cencored.com: 504 5.7.4 Unrecognized authentication type [CY4PR0501MB3908.namprd05.prod.outlook.com 2024-02-08T22:33:51.710Z 08DC255743C7]","email":"cencored@cencored.com","error":"504 5.7.4 Unrecognized authentication type [CY4PR0501MB3908.namprd05.prod.outlook.com 2024-02-08T22:33:51.710Z 08DC25520C743C70]","message_body_size":9,"message_event":"message","message_id":"4qmF5LaJcSpv","message_sender":"172.25.0.1","message_time":1707431626,"message_user":"u_U5MeBhxJuu","tag":"email","topic":"test-expiry-notifications","user_id":"u_U5MeBhxJuu","user_name":"cwood","visitor_auth_limiter_limit":0.016666666666666666,"visitor_auth_limiter_tokens":30,"visitor_emails":2,"visitor_emails_limit":24,"visitor_emails_remaining":22,"visitor_id":"ip:172.25.0.1","visitor_ip":"172.25.0.1","visitor_messages":2,"visitor_messages_limit":17280,"visitor_messages_remaining":17278,"visitor_request_limiter_limit":0.2,"visitor_request_limiter_tokens":57.056149986399994,"visitor_seen":"2024-02-08T22:33:52.477Z"} ### smtp-legacy.office365.com:587 {"time":"2024-02-08T23:16:18.697Z","level":"WARN","message":"Unable to send email to cencored@cencored.com: 504 5.7.4 Unrecognized authentication type [CY4PR0501.prod.exchangelabs.com 2024-02-08T23:16:13.824Z 08DC27850D59]","email":"cencored@cencored.com","error":"504 5.7.4 Unrecognized authentication type [CY4PR0501.prod.exchangelabs.com 2024-02-08T23:16:13.824Z 08DC278511F0D59E]","message_body_size":9,"message_event":"message","message_id":"H0c2IFiqomiR","message_sender":"172.26.0.1","message_time":1707434168,"message_user":"u_U5MeBhxJuu","tag":"email","topic":"test-expiry-notifications","visitor_auth_limiter_limit":0.016666666666666666,"visitor_auth_limiter_tokens":30,"visitor_emails":1,"visitor_emails_limit":24,"visitor_emails_remaining":23,"visitor_id":"ip:172.26.0.1","visitor_ip":"172.26.0.1","visitor_messages":1,"visitor_messages_limit":17280,"visitor_messages_remaining":17279,"visitor_request_limiter_limit":0.2,"visitor_request_limiter_tokens":60,"visitor_seen":"2024-02-08T23:16:09.983Z"} ``` At first I attempted to connect as described in Microsofts documentation: ``` # /etc/ntfy/server.yml smtp-sender-addr: "smtp-mail.outlook.com:587" smtp-sender-from: "alias@cencored.com" smtp-sender-pass: "cencored" smtp-sender-user: "cencored@cencored.com" ``` After that, I attempted using the legacy smtp endpoint as documented [here](https://office365itpros.com/2021/08/19/exchange-online-to-introduce-legacy-smtp-endpoint-in-2022/). `smtp-sender-addr: "smtp-legacy.office365.com:587"` In either case it fails with the errors provided. :crystal_ball: **Additional context** [Stack Exchange](https://superuser.com/questions/1829456/ntfy-why-cant-it-authenticate-with-ms-outlook)
Author
Owner

@wunter8 commented on GitHub (Feb 9, 2024):

The problem is that ntfy only supports AUTH PLAIN right now, and Microsoft 365 Outlook only supports AUTH LOGIN right now.

If you're so inclined, you can look at the steps here to fix it: https://github.com/binwiederhier/ntfy/issues/930

<!-- gh-comment-id:1935314852 --> @wunter8 commented on GitHub (Feb 9, 2024): The problem is that ntfy only supports AUTH PLAIN right now, and Microsoft 365 Outlook only supports AUTH LOGIN right now. If you're so inclined, you can look at the steps here to fix it: https://github.com/binwiederhier/ntfy/issues/930
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ntfy#717
No description provided.