Using exchange as SMTP doesn't work

AI-generated summary

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.

Hi,
Newcomer here. With a fresh install, I’m trying to get me confirmation email but I’ stuck.
I know that our smtp server is an exchange one.
As advised, I’ve put the DISCOURSE_SMTP_AUTHENTICATION parameter to login instead of plain
I’ve followed the procedure described here: https://meta.discourse.org/t/troubleshooting-email-on-a-new-discourse-install/16326/2
I’ve tried potential fixes here
https://meta.discourse.org/t/smtp-exchange-server-problem/27826 and there
https://meta.discourse.org/t/smtp-connection-problem-docker-installation/41981
But I still have the discourse-doctor error:
UNEXPECTED ERROR
504 5.7.4 Unrecognized authentication type

Any help will be really appreciated.
Thanks

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,

  • Postifx:
    mynetworks = 172.16.0.0/12, 127.0.0.0/8

  • container/app.yml:
    DISCOURSE_SMTP_AUTHENTICATION: none
    DISCOURSE_SMTP_ADDRESS: 172.17.0.1
    DISCOURSE_SMTP_PORT: 25

discourse-doctor gives:
=== ERROR ===
CONNECTION REFUSED
Connection refused - connect(2) for “172.17.0.1” port 25
Where is my fault?

Please try this configuration in your app.yml file:

DISCOURSE_SMTP_AUTHENTICATION: login
DISCOURSE_SMTP_ADDRESS: smtp.example.com
DISCOURSE_SMTP_PORT: 587
DISCOURSE_SMTP_USER_NAME: "yourusername"
DISCOURSE_SMTP_PASSWORD:  "yourpassword"
DISCOURSE_SMTP_ENABLE_START_TLS: true
DISCOURSE_SMTP_OPENSSL_VERIFY_MODE: none

And at the end of the file:

- 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.

Hope it could help.

Thanks Mik,
That solved my issue.