Exim appending hostname to fully qualified sender address

exim

I'm having a problem at the moment on a corporate e-mail server whereby Exim is appending its server hostname onto the end of the sender's e-mail address, despite that e-mail address already being fully qualified.

For example, a user sends an e-mail from:

the.sender@mycompany.co.uk

and Exim is changing this to:

"the.sender@mycompany.co.uk"@corp-2.mycompany.co.uk

This is no longer a valid e-mail address and as a result receiving mail servers usually reject the message because it can't verify the sender.

Exim config at: http://pastebin.com/4nS6T1Aw

Exim output from a dummy delivery (exim -bh) at: http://pastebin.com/UTXC8RuR

From the looks of it, something weird is going on with quotation marks and I think Exim's tripping itself up, but I'm scratching my head on this one and would appreciate any help!

Thanks

Best Answer

In the early days of email, the email address format was generally user@hostname. Frequently, the sender that was passed to a mail server was simply the username, and the mail server automatically appended its hostname to the supplied username.

Over the past 15 years, it's become much more common for a mail server to be configured to accept email for multiple domains (not just its hostname), which is typically called "virtual mail." When it comes to virtual mail, the mail server must figure out when the argument being passed is just a local username, or if it's a full email address. When it's not a full email address, you want Exim to append the hostname (or default domain you specify), but if it is an email address, you want to tell Exim not to append that hostname/domain.

I have this in my MAIL acl, which tells exim to "retain the sender domain" (which is a roundabout way of saying "the domain is supplied, leave it alone").

  accept  authenticated  = *
          control        = submission/sender_retain
          control        = dkim_disable_verify
          add_header     = X-Authenticated-Sender: ${sender_address}
          set acl_c_authenticated = 1