首先,微软文档建议这些细节用于 Outlook 的 SMTP。我将其与其他服务配合使用效果很好。
- SMTP 服务器名称:smtp-mail.outlook.com
- SMTP 端口:587
- SMTP 加密:启动TLS
此外,NTFY 建议支持 SMTP 和 STARTTLS。
“截至今天,仅支持具有 PLAIN auth 和 STARTLS 的 SMTP 服务器。”
但是,当我尝试通过文件进行配置时/etc/ntfy/server.yml
,它不起作用。
请注意以下日志中的两个错误:
### smtp-mail.outlook.com:587
{"time":"2024-02-08T22:33:56.559Z","level":"WARN","message":"Unable to send email to [email protected]: 504 5.7.4 Unrecognized authentication type [CY4PR0501MB3908.namprd05.prod.outlook.com 2024-02-08T22:33:51.710Z 08DC255743C7]","email":"[email protected]","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 [email protected]: 504 5.7.4 Unrecognized authentication type [CY4PR0501.prod.exchangelabs.com 2024-02-08T23:16:13.824Z 08DC27850D59]","email":"[email protected]","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"}
起初我尝试按照微软文档中描述的方式进行连接:
# /etc/ntfy/server.yml
smtp-sender-addr: "smtp-mail.outlook.com:587"
smtp-sender-from: "[email protected]"
smtp-sender-pass: "cencored"
smtp-sender-user: "[email protected]"
之后,我尝试使用文档中所述的旧版 SMTP 端点这里。
smtp-sender-addr: "smtp-legacy.office365.com:587"
无论哪种情况,它都会失败并出现错误。