1 Postfix; Multiple Domains

For Setting up ip/domain personalities (a domain name that is tied to an ip address, and is on a postfix server that serves multiple domains) I had to configure 3 files.

For OUTBOUND traffic to come from different IP addresses but the same domain, I had to do the following:

1. Edit the sdd_transport_maps.regexp in the /etc/postfix directory, and set up the regexp as if it was in the <FROM> header.  The log of postfix contained

From=<root>

When I put the regexp to match that, it worked successfully.  The line that I put in the sdd_transport_maps.regexp file was as follows:

/root/     domain:

Where /root/ is what we’re matching on and the domain: is the alias we’re assigning it.  Please note the : at the end needs to be there.  This is saying “we’re assigning it this alias, but the port stays the same”, because it’s blank.

I then, in the master.cf file, set up the alias of “domain”, and bound the IP address with the following command:

domain   unix   -   -   n   -   -   smtp
-o smtp_bind_address=xx.xx.xx.xx   #which will bind postfix to the IP address of xx.xx.xx.xx
-o syslog_name=domain   #(for logging purposes)

This will say that any email that is from “root” (matched exactly) will have the transport alias of domain and be sent from the bound ip address of xx.xx.xx.xx.  Also, in the log file, you will see reference to domain.

For INBOUND traffic, I added the interface that the client will be connecting on in the master.cf file.  In said file, I added the following:

xx.xx.xx.xx:smtp      inet  n       -       n       -       -       smtpd -o myhostname=domain.com

This will change the welcome banner for connections on xx.xx.xx.xx.

Note that the xx.xx.xx.xx interface MUST be configured on the machine.  If it’s not, it won’t hurt anything, but it will be time lost as the steps above will not do anything.

No Comments to “1 Postfix; Multiple Domains”

There are no comments yet.

Leave a Reply

Your email address will not be published. Required fields are marked *