Szukałem jak pod postfixa podpiąć kilka domen ale tak aby każda z nich wychodziła na zewnątrz pod z góry określony IP.
Okazuje się to całkiem proste rozwiązanie znalezione tutaj:
http://serverfault.com/questions/92181/ ... ip-address
master.cf
main.cfKod: Zaznacz cały
Create different Interfaces. One for each domain: rotate1 unix - - n - - smtp -o syslog_name=postfix-rotate1 -o smtp_helo_name=domainone.com.br -o smtp_bind_address=173.111.111.1 rotate2 unix - - n - - smtp -o syslog_name=postfix-rotate2 -o smtp_helo_name=domaintwo.com.br -o smtp_bind_address=173.111.111.2
Kod: Zaznacz cały
Disable all other transport maps, i.e.: # transport_maps = xxxxx Enable dependent transport map (require postfix 2.7.x or later) sender_dependent_default_transport_maps = mysql:/etc/postfix/config/transport_random_dependent.cf transport_random_dependent.cf
Table transport_randomKod: Zaznacz cały
Example: user = postfix password = mypassword dbname = postfixdb hosts = localhost query = SELECT transport FROM transport_random WHERE domain = '%d' AND status='1' ORDER BY RAND() LIMIT 1
The instruction "RAND() LIMIT 1" is necessary only if you want to use random transports for the same domain.Kod: Zaznacz cały
Column "transport" = rotate1, rotate2, rotate3, rotate4 (etc) Column "domain" = sender domains (replaced by %d) Column "status" = boolean (0 or 1) if is enabled the transport.
In example, you want to send from mydomain.com from 3 different IPs.
Then, you create 3 transports (rotate1, rotate2 and rotate3) with 3 different IPs, then set at mysql lines:
[/code]Kod: Zaznacz cały
transport = rotate1 | domain = mydomain.com transport = rotate2 | domain = mydomain.com transport = rotate3 | domain = mydomain.com
Kod: Zaznacz cały
Then, when postfix will randomize three different transports (rotate one to three) to send this emails. [/quote] Na wszelki wypadek pozwolę sobie zacytować oryginalne rozwiązanie gdyby link przestał działać. Niech zostanie tutaj dla potomnych. Pozdrawiam.