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 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.

Thanks.

share|improve this question

1 Answer 1

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 master.cf. Than you should add something like this in your master.cf:

smtp            unix  -       -       -       -       -       smtp
smtp2           unix  -       -       -       -       -       smtp
    -o myhostname=other.example.com
    -o smtp_helo_name=other.example.com
    -o smtp_bind_address=1.2.3.4

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

other.example.com             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

 
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.