I've installed postfix 2.11.3
and we have multiple IP addresses on our server which we want to host two domains, isolated and running on their own IPs.
domain1 unix - - n - - smtp
-o smtp_bind_address=1.1.1.1
-o smtp_helo_name=mail.abc.com
-o syslog_name=postfix-mail.abc.com
domain2 unix - - n - - smtp
-o smtp_bind_address=2.2.2.2
-o smtp_helo_name=mail.xyz.com
-o syslog_name=postfix-mail.xyz.com
Following transporter /etc/postfix/sender_transport
also defined in main.cf
:
@abc.com domain1:
@xyz.com domain2:
After restarting postfix, it stopped listening on port 25
:
[root@postfix-2.11.3]# telnet 1.1.1.1 25
Trying 1.1.1.1...
telnet: connect to address 1.1.1.1: Connection refused
But if I use following line in master.cf
it listen on 25 and i can see banner if i telnet:
1.1.1.1:smtp inet n - n - - smtpd -o myhostname=mail.abc.com
2.2.2.2:smtp inet n - n - - smtpd -o myhostname=mail.xyz.com
But I want to tell my mail server when you send out email use specific domain just like sender_transport
What i am doing wrong?
Notes:
I have removed following line from master.cf
and replaced with above domain1 and domain2:
smtp inet n - n - - smtpd
Best Answer
Solution - Postfix version 2.7 or above required:
/etc/postfix/master.cf
/etc/postfix/main.cf
/etc/postfix/sender_transport
Run command to generate hash db
Restart/Reload postfix
Testing
Sending email test
Got to gmail Inbox > Show Original
Voila!! see it used
65.xxx.xxx.200
IP address to sent out email..