PMG - Different outgoing IP for different trusted server

ishan

Active Member
Nov 12, 2018
13
1
43
36
Hello,
We have a configuration where we have one PMG server with 1 IP on it.

We connect 4 servers to this PMG server for outbound mail filtering.

We wish to add 3 more public IPs to PMG so that each server connected to PMG sends outbound emails through its own dedicated IP.

Currently it is 4:1 where all 4 send through same IP .
We wish to have 1:1 where all 4 will send through their own IPs.

How can we achieve this ?
 
This seems a bit tricky and involved...
* Are the 4 servers all responsible for a different domain?
* if yes you could take a look at putting yet another layer of smtpd servers after PMG's outbound smtpd instance:
* it is configured in /etc/postfix/master.cf and listens to 127.0.0.1:10025
* you could add some parameters to its invocation (sender_dependent_transport maps), and map each domain to a smtp-service configured in the master.cf, listening on another port, which sets smtp_bind_address to the desired outbound ip
(/etc/postfix/master.cf gets rendered through PMG's template system (see the admin-guide: https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#_service_configuration_templates)

see the following links for a few pointers:
https://serverfault.com/questions/92181/how-to-make-postfix-use-another-ip-address
https://shami.blog/2016/04/randomize-source-ip-addresses-with-postfix/


As said, this looks quite complicated (and sounds quite painful to debug) and I would not consider this a supported setup - you could consider simply setting up 4 PMG instances instead.

hope this helps!

EDIT: added links to postfix-config suggestions