Postfix: force outgoing mail for specified domain trough separate ip

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


Trackbacks

Trackback specific URI for this entry

This 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 | Threaded

No comments

Add Comment

You can use [geshi lang=lang_name [,ln={y|n}]][/geshi] tags to embed source code snippets.
Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
Standard emoticons like :-) and ;-) are converted to images.
E-Mail addresses will not be displayed and will only be used for E-Mail notifications.
To leave a comment you must approve it via e-mail, which will be sent to your address after submission.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA