Postfix: force outgoing mail for specified domain trough separate ip
Posted by valqk on
To be able to send each domain mail from different ip you have to do the following:
#> vi /etc/postfix/master.cf
add postfix listener bound on alternative ip in master.cf after smtp line:
#mail.domain.com transport
domaincom_transport unix - - y - - smtp
-o smtp_bind_address=$domaincom_transport_bind_address
-o smtp_helo_name=mail.domain.com
-o syslog_name=smtp-domain
#> vi /etc/postfix/main.cf
domaincom_transport_bind_address = 192.168.0.10
#mask outgoing mails on a per domain to ip match base - add a line
sender_dependent_default_transport_maps = hash:/etc/postfix/sender_transport
then create the file for mapping
#> vi /etc/postfix/sender_transport
@domain.com domaincom
@domain2.com domain2
@domain3.com domain3
save and exit and create hash db:
#> postmap hash:/etc/postfix/sender_transport
/etc/init.d/postfix restart
#> vi /etc/postfix/master.cf
add postfix listener bound on alternative ip in master.cf after smtp line:
#mail.domain.com transport
domaincom_transport unix - - y - - smtp
-o smtp_bind_address=$domaincom_transport_bind_address
-o smtp_helo_name=mail.domain.com
-o syslog_name=smtp-domain
#> vi /etc/postfix/main.cf
domaincom_transport_bind_address = 192.168.0.10
#mask outgoing mails on a per domain to ip match base - add a line
sender_dependent_default_transport_maps = hash:/etc/postfix/sender_transport
then create the file for mapping
#> vi /etc/postfix/sender_transport
@domain.com domaincom
@domain2.com domain2
@domain3.com domain3
save and exit and create hash db:
#> postmap hash:/etc/postfix/sender_transport
/etc/init.d/postfix restart
Trackbacks
Trackback specific URI for this entryThis link is not meant to be clicked. It contains the trackback URI for this entry. You can use this URI to send ping- & trackbacks from your own blog to this entry. To copy the link, right click and select "Copy Shortcut" in Internet Explorer or "Copy Link Location" in Mozilla.
No Trackbacks
Comments
Display comments as Linear | ThreadedNo comments