Zuki_Zuk_Aka_Tovo encountered an SMTP authentication error (“504 5.7.4 Unrecognized authentication type”) while trying to configure Discourse to send emails via an Exchange server. After attempting fixes from various Discourse Meta threads and trying to relay mail through a local Postfix server — which resulted in a “Connection refused” error — they sought help. mik provided a working configuration: setting DISCOURSE_SMTP_AUTHENTICATION: login, using port 587 with TLS enabled, and ensuring the SMTP username matches the notification email address (e.g., SiteSetting.notification_email='yourusername@example.com'). Zuki_Zuk_Aka_Tovo confirmed this resolved their issue. The key insight was aligning the SMTP credentials with the notification email to bypass server-side security checks.
Well,
I have to go further so I tried a workaround by installing a posftix on my host in order to relay messages from discourse. I have an issue related to my lack of expertise on docker.
My configuration:
Host network:
docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN gro up default
link/ether 02:42:78:b6:18:3c brd ff:ff:ff:ff:ff:ff
inet 172.17.0.1/16 scope global docker0
Discourse network:
“Gateway”: “172.18.0.1”,
“IPAddress”: “172.18.0.3”,
“IPPrefixLen”: 16,
- exec: rails r "SiteSetting.notification_email='yourusername@example.com'"
Please note that the DISCOURSE_SMTP_USER_NAME and the username part of the mail in SiteSetting.notification_email is the same.
If you use for example noreply@example.com sometimes it does not work because of some security checks which are activated on the server that make sure that the username is corresponding to the user email.