This issue was also reported on different topic related to setting up email replies. As suggested by @mpalmer I’m creating a new topic.
The other users who reported this issue on this topic:
I’ve searched the forum and can’t seem to find an answer so after debugging this using a hMailServer SMTP server I’m beginning to think this may be a bug. This issue is causing issues like the SMTP server not DKIM signing the message since the sender domain doesn’t match the
from header and also being flagged as potential spam by www.mail-tester.com for the same reason.
So I did some more testing to see what’s going on. I did 2 tests with the same setup from the same network and both are setup with the same SMTP server name, username/password, port and authentication. One machine running outlook and another discourse, sent a test eMail to the same email address from discourse and from outlook.
In outlook I set the “reply-to” feature similar to what discourse is is supposed to set for a reply to address. (using gmail here for the reply-to)
I looked at the SMTP server records and I noticed that the
from header from outlook was set correctly.
“RECEIVED: MAIL FROM: firstname.lastname@example.org”
However the logs from the discourse transaction shows this for the
“RECEIVED: MAIL FROM: email@example.com”
That’s the root cause why receivers are flagging as spam and why the SMTP server won’t DKIM sign the message sent from discourse since the from address doesn’t match the senders domain.
Why is discourse setting the
from flag with the reply-to address?