Portal Home > Knowledgebase > Articles Database > Exim not playing nice with Exchange servers
Exim not playing nice with Exchange servers
Posted by McBane, 09-16-2013, 11:53 PM |
Ok this is kind of a weird problem. I have a home server running exim and it hosts a few different domains on it. When I email most other email servers other than Exchange servers it works as it should and puts whatever I put as my email address in my email client as the from address.
When I send to an exchange server though from one of my virtual hosted domains it doesn't show the proper from address. It shows the user@ full fqdn of the server like this:
fakeuser@deimos.mydomain.org [mailto:fakeuser@deimos.mydomain.org] On Behalf Of Fake Name
On my email client my email is fakeuser@myotherdomain.net, which is hosted on the box at deimos.mydomain.org but Exchange servers just completely ignore my myotherdomain.net address.
Is there a setting on Exim I can set to have it properly show as fakeuser@myotherdomain.net when I send to exchange and not have it take the full FQDN of the box? Hope all this makes sense. I think it has something to do with the envelope to header, but I'm not completely sure about that, it's just a guess.
|
Posted by net, 09-16-2013, 11:57 PM |
Moved > Hosting Security and Technology.
|
Posted by kevincheri, 09-16-2013, 11:59 PM |
This happens when you send emails as the domain user, you may need to create a mailbox and authenticate with it to send emails. Or you can add the Header in mail() for 'From' address.
|
Posted by McBane, 09-17-2013, 12:04 AM |
Well yeah the users are just system users that are shared across all the domains on the box. They do use simple SMTP auth to send email with on their email clients. Some users use one domain and some use another and most of them don't want to use the boxes FQDN as their from address. Their mailboxes are created when the user is created.
Do I need to add a header to the exim config for each user and set them to a specific domain they want to show up as or something?
|
Posted by kevincheri, 09-17-2013, 12:19 AM |
You may need to add the 'FROM' headers via script when you send emails.
|
Posted by McBane, 09-17-2013, 12:28 AM |
When the emails are sent out the from header lists fakeuser@myotherdomain.net like it should, but for some reason exchange is just completely ignoring the from header and it's using the email servers FQDN.
That's the root of the problem right there, and why it works for every other server except for Exchange servers.
|
Posted by McBane, 09-17-2013, 08:28 PM |
Ok I've found out the problem but need a little help on fixing it. I need to do an exim re-write rule to make the envelope from address match the normal from address if that's possible and I think that should fix it to look proper. I'm running Exim 4.72 if it matters which is standard for CentOS 6 extras.
Any Exim experts out there that can do something like this? I've tried googling but I can't find a re-write rule that matches the envelope from to the regular from field.
|
Posted by McBane, 09-18-2013, 03:53 PM |
Just a heads up for people I think I've fixed this using the following re-write rules:
https://github.com/Exim/exim/wiki/Q0801
These rules do strip the real name part of the sender header, which I guess is best since sometimes that will cause bounces for mailer daemon messages which will result in you never receiving the mailer daemon bounce message, at least according to this exim wiki. It leaves the from header alone so your name is left alone there. Some mail servers tend to use the sender address and some use the from address. At least this is better than using the server's hostname which might be on a completely different domain than your email address like my case.
|
Posted by McBane, 09-19-2013, 11:35 PM |
Well I've tried using this to rewrite the envelope from and sender headers to match the email address in the From: header, but it doesn't seem to want to rewrite it for the envelope from header. It does take the email address from the From: header and puts it on the Sender: header.
*@*.your.domain ${sg{$h_from:}{^.*<(.*)>}{\$1}} Ffrs
It appears to have the proper flags to rewrite the envelope from, yet it doesn't... Am I doing this wrong for it to rewrite the envelope from header or is there some other option I need to set in the config file for this to happen?
|
Posted by Lost Eagle, 09-20-2013, 12:55 AM |
Howdy,
Its not an exim issue, try to connect to any of those emails via outlook or thunderbird, and send an email to your yahoo or Gmail mail.
Some client applications or scripts break the header.
If exim not secured it could allow week scripts to communicate ......
Regards
|
Posted by McBane, 09-21-2013, 01:01 AM |
You're probably right Lost Eagle, although I know a lot of mailservers will always match the email from the From: header to the envelope from: header. This makes it more email client friendly and probably why most MTAs do it this way.
Is this just impossible for Exim? Is it always going to use the FQDN hostname of the server itself for the envelope from, regardless if it's hosting the domain email for multiple domains on it?
This is making me want to start experimenting with Postfix or an MTA with that kind of function.
I guess there are not a lot of Exim experts out there anymore.
Does anyone run a WHM/cPanel linux box hosting multiple email domains on it? I think Exim is the default MTA for that. If so can someone post the rewrite rules off your exim.conf file, maybe cPanel/Exim has this figured out.
Last edited by McBane; 09-21-2013 at 01:10 AM.
|
Add to Favourites Print this Article
Also Read