In the last weeks we noticed that the delivery of certain mails is refused by some incoming mail servers. They determine that the domain of the outgoing mail server is not the same domain as the senders address. Checking the maillog, the from-address of the outgoing mail is not the same as given in olat.local.properties (in our case email@example.com). It's the senders address:
The message header is okay:
But the SMTP envelope is not right. The envelope-from must be explicitly set. I solved the problem by following patch:
which is correct.