Routing outgoing mail via multiple IPs

markc

Member
Sep 12, 2020
50
9
13
69
Gold Coast, Australia
spiderweb.com.au
I have a subnet of IPs that I allocate to a dozen different domains, and right now I use a combination of master.cf rules and sender_dependent_default_transport_maps = lmdb:/etc/postfix/sender_transport to send out mail from different customer virtual domains via different IPs. If I put PMG in front of this mailserver on its own VPS with a high risk UCEPROTECT-Level1 allocated IP, and if all mail goes out this single IP, I will be in a world of pain and lose segregation of customer domains per IP. Incoming mail would go to the MX of the PMG VPS and get forwarded to the mail server for customers to pick up, all good, but would outgoing from the mailserver need to go through PMG (for scanning and logging) and then get routed back to the mailserver so that the mailserver can then on send that message out via its current sender_transport rules?

Will this work anyway?

Is there anyway I could avoid the re-send back to the mailserver from PMG to take advantage of outgoing IP per domain and avoid that extra outgoing hop back to the main mailserver?

How to avoid the sender_transport lookup when first sending outgoing mail to PMG, but respect sender_transport when the message comes back to the mailserver and then needs to go out again directly from the mailserver (per subnet IP) via sender_transport?
 
Last edited:
but would outgoing from the mailserver need to go through PMG (for scanning and logging)
you could also skip scanning outgoing mail with PMG?

and then get routed back to the mailserver so that the mailserver can then on send that message out via its current sender_transport rules?
this sounds theoretically doable - but I'd advise against it - too much chance of building a mailloop

Why not simply push this .... use different IP per domain to PMG directly - and let it handle the sending?
just adapt the postfix config in PMG:
https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#pmgconfig_template_engine

I hope this helps!
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!