I've got a handful of postfix servers in various subdomains of a private TLD. What I'm ultimately looking to do is rewrite anything going through the gateway box to a specific catch-all user of a legitimate domain, so at least I can deal with bounces and the sort.

Starting: joeuser@somemachine.domain1.example.private
Desired: catchall+joeu...@example.com

I'm using masquerade_domains to collapse all the machines down to user@example.private as it's acceptable and preferred (not all have local delivery) for "internal" mail. All systems within that private domain use the same mail relay, and this'd happen before a rewrite if I understand the processing order.

In the past I've used canonical mapping to rewrite something like user@example.private to u...@example.com, which is great for a 1:1, but not as much when you don't know all the end users that you'll be presented with.

I'm guessing in this case, I need to do a sender_canonical regexp similar to:
/^(.*@)example.private$/     catchall+${1}example.com

However, what I'm looking to do is use address extensions for only mail that leaves for the internet, not all "in-house" mail. Is there a way without running a separate instance or additional box to easily make this distinction (specific localdelivery agent maybe?)

I don't presently expect "return mail" to work (although I suspect I could script a delivery agent to convert from route-able catchall with address extensions to an internal user)

Thanks for any gentle pointers in the right direction. I just can't seem to find the right combination of rewrite examples in documentation, and the local vs remote decision just complicates things ;)

John

Reply via email to