Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Suppose that I have some instance running in Amazon EC2:

This instance hosts some number of applications or websites for other domains:

This host is configured to use exim4 to interface with Amazon SES for sending mail. In Amazon SES, each domain is separately allowed as a valid sender:

However, as one would expect, the FQDN of the instance and the executing user are being used as the sender of each email, so all emails appear to originate from:

I can certainly configure Amazon SES to allow mails from, and I can further add a 'From: "Whoever" <>' envelope to the emails at the application level.

What I am wondering is, (a) is this an acceptable solution, and if not, (b) what configuration might I explore to show that mail for each domain (e.g. appears to originate directly from a "" server rather than the actual host. I assume this involves creating a DNS entry and pointing it to the server, but beyond that I am lost in how to set up exim or the application to allow this.

share|improve this question

2 Answers 2

up vote 2 down vote accepted

You can configure exim to hide the local mail name in outgoing mail. In addition you should configure your main exim server to use a smarthost, in this case the amazon SES thing.

Let's assume each site runs on its own virtual server, ( and ( and your email server is on yet another virtual server, (

To reconfigure exim4 you can run:

dpkg-reconfigure exim4-config

On the main email server configure it as follows (I only listed the relevant ones):

  • General type of mail configuration: mail sent by smarthost; received via SMTP or fetchmail

  • System mail name:

  • Machines to relay mail for:;

  • IP address or host name of the outgoing smarthost: THE_AMAZON_SES_IP

  • Hide local mail name in outgoing mail? Yes

  • Visible domain name for local users:

On the other servers configure exim like this, using as example host:

  • General type of mail configuration: mail sent by smarthost; no local mail

  • System mail name:

  • Other destinations for which mail is accepted: LEAVE_EMPTY <-- this will cause "The option to hide the local mail name in outgoing mail was enabled"

  • Visible domain name for local users:

  • IP address or host name of the outgoing smarthost:

In case you do only have one server, then just ignore the second step. Your main server should send out emails hiding the local server name and send them out as coming from

share|improve this answer

Are you trying to hide the fact that the email originated from an EC2 instance? The short answer is, you can't. The Received: headers will contain a reasonably complete trace of the email's path through the network. Fortunately for you, almost nobody ever looks at them.

If you just want recipients to see something reasonable for the From: header, then just put something reasonable in the From: header when you send the email.

share|improve this answer

Your Answer


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.