Out of office mails works internally but externaly the logs says : - it goes out of Exchange 2010 to go to Postfix (without any sender), - Postfix sends it out to the sender without any sender - the destinator bounces it back with the error " status=bounced (host gmail-smtp-in.l.google.com[220.127.116.11] said: 550 Requested action not taken: mailbox unavailable (in reply to MAIL FROM command))"
The RFCs say that out of office mails and other MDNs should be sent with an empty sender. Since Exchange 2010 (or 2007?), that is what it is done.
The problem is that at least Gmail and Hotmail refuse those mails:
status=bounced (host gmail-smtp-in.l.google.com[18.104.22.168] said: 550 Requested action not taken: mailbox unavailable (in reply to MAIL FROM command))
Internet says that we can't add a sender to those out of office mails in Exchange 2010. There are transport rules but they can't add "From" attribute in header, and email rewriting but... Its like asking me to write a big book in chinese while I just want to have a "cool" chinese character on my arm.
My luck is that my exchange sends mail via a postfix server (Internet -> Postfix -> Exchange) and that we can add sender to mails with postfix.
What I understand is that I can replace things like "*@mydomain.com" to a single static mail address, always the same, that I can choose like "mailer@myStylishDomainName.com" but what I would like to do is add the real sender mail address to the "from". And I would like to do this only if it is a "automatic reply" kind of mail.
How could I add a "from" value to my out of office mails so that gmail and other external mail servers accept my MDNs please?
Update 1 : in addition ton DKIM/DMARC, I saw those roads :
- fill in external postmaster
You can configure and manage the external postmaster address. The external postmaster address is used as the sender for system-generated messages and notifications sent to message senders that exist outside the Microsoft Exchange Server 2010 organization. An external sender is any sender that has an e-mail address that contains a domain not defined in the list of accepted domains for the Exchange 2010 organization.
- change OOF mails format from TNEF to something else: it is possible to avoid TNEF for "normal" mail but I don't know how to force OOF mails to be sent in usual MIME type
Update 2 : if I remove the Postfix MTA in between my Exchange and the Internet, Out of office mails are sent and received/accepted by Gmail because they do have a Return-Path and a From. So it must be Postfix that is messeing with this.