In a Debian server, I added a second IP by the following configuration in /etc/network/interfaces
# The primary network interface
allow-hotplug eth0
iface eth0 inet static
address 1.1.1.1
netmask 255.255.255.255
gateway 1.1.1.1
auto eth0:1
iface eth0:1 inet static
address 1.1.1.2
netmask 255.255.255.255
Now, postfix
sends emails with the second IP instead of the primary IP.
I use a dedicated IP for each domain managed by nginx
. Is it possible to send email from each domain by the IP dedicated to that domain?
If NOT, how to use the primary IP for sending emails?
Its possible to use the IP dedicated to that domain for sending.
You need sender dependent transport maps.
Something like this:
add to /etc/postfix/main.cf:
/etc/postfix/sender_maps:
add to /etc/postfix/master.cf
Do a
postmap /etc/postfix/sender_maps
and reload postfix.To accept mail's on both IP the best probably to have
inet_interfaces = all
in main.cfYes, you can do that. Try changing master.cf configuration file with:
Restart postfix and check send mail.