Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I currently have a machine set up to operate with two domains. The main name uses the standard Unix-user delivery, and the second domain is entirely virtual (using virtual_alias_domains and virtual_alias_maps), with the second domain only forwarding mail.

However, when mail is forwarded, it still appears to be delivered by the host of the primary domain (presumably set by myorigin.) Is it possible to get it so when mail is forwarded to the virtual domain, it appears to be delivered by it as well? That domain is on another IP and I'd like to use it so the mail stays consistent.


share|improve this question
up vote 1 down vote accepted

It is generally not a good idea to fake the hostname. What's your problem with having the client name at something different than the email sender domain?

Normally it's totally fine to let the hostname at the primary IP address/DNS name. If you really know what you're doing then read ahead. Otherwise let it the way it is.

To accomplish your goal with two different sending hostnames you have to sent your mails with two different smtp daemons. I pressume that you have two IP addresses and corresponding DNS names and they are correctly configured.

So first create a new smtp daemon in your Than you should add something like this in your

smtp            unix  -       -       -       -       -       smtp
smtp2           unix  -       -       -       -       -       smtp
    -o smtp_bind_address=

Now you only have to tell, that ever mail delivered from should take the smtp2 daemon. So you write in the transport table:             smtp2:

That should be all.

share|improve this answer
It was mostly for service separation, since the main SMTP DNS name doesn't have anything to do with the secondary. I've since moved the second domain to a VM, but appreciate the answer. – Andrew Koester Apr 20 '11 at 14:35

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.