Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a centos 5 box running exim. The box hosts many domain names which send outgoing email. The problem is that the emails show that the email is coming the box's hostname (say x.com), rather than from each domain name (y.com and z.com). How can I set this up so that an email sent from y.com actually says that it's coming from y.com?

share|improve this question

migrated from superuser.com Nov 4 '11 at 17:45

This question came from our site for computer enthusiasts and power users.

1 Answer 1

If you are asking about the host name in the Received: header this is correct behavior. Just add an MX record for all your domains referencing the box's hostname. Also consider adding SPF records to the domains. If your server is Internet facing, it needs a static address, and it IP address should have a PTR record returning its FQDN (Fully Qualified Domain Name).

If you are asking about what recipients see in their mail clients this is determined by the mail user-agent sending the message: If it puts the appropriate From: or Reply-to: headers in the outgoing e-mail, these should show up appropriately when the email is read.
For exim you can put entries in /etc/email-addresses to change the default domain and/or name for particular users.

share|improve this answer
    
There's a lot of information here - many thanks but I'm still flailing. So let's say the server name is a.com and it has a static IP address. On the same box, I host b.com at a different IP address. I send out emails from, say, admin@b.com, but in my email client, it says Received: from a.com, presumably because that's the main IP address of the box. So should I somehow be telling exim to send the email from the IP address of b.com? –  farhadf Nov 11 '11 at 19:56
    
No, but you should add an MX record for b.com pointing to a.com. Also make sure that the PTR record for a.com's IP address resolves to a.com. –  BillThor Nov 11 '11 at 21:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.