2

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.

1 Answer 1

1

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.

1
  • 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.
    – Jess
    Apr 20, 2011 at 14:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .