Interaction between Exim, Outlook and Exchange

This note is a supplement to the virtual domain mail setup.

Microsoft's Outlook (not Outlook Express) does strange things with some mail headers. It tries to interpret the Return-path and Sender headers as a reply address. This causes confusion to the users. In particular, if you have a virtual mail account where the domain name is different from the server's canonical name You will see addresses of the form

    "user@domain.com"@my.server.com

A second problem arises if messages with such headers are routed to an Exchange server. Exchange complains of an invalid mailbox name when it tires to validate the contents of the Return-path, a header that it should really be ignoring.

To get around this I have modified my remote_smtp transport as follows:


remote_smtp:
    driver = smtp
    return_path = \ 
        ${if match {$return_path}{\N"(.*)"@ns1.mankin.org.uk\N}\
        {$1}fail}

Obviously, you have to replace the literal domain name with the name of your server.
Creative Commons License

This work is licenced under a Creative Commons Licence.