On 2014-09-24 10:38, Noel Jones wrote:
On 9/24/2014 9:12 AM, Postfix wrote:
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 ;)

Perhaps one of these are what you're looking for?
http://www.postfix.org/ADDRESS_REWRITING_README.html#generic
http://www.postfix.org/SOHO_README.html#fantasy

Thanks Noel -- they were what I'd been reading to get the above information. I think my gap in understanding is how I only apply a rewrite for messages going out to the internet vs to the local repo. And, perhaps, not being as clear about how
the mess works at the moment.

As it stands today, the mxrelay box is what every box sends mail to initially, with local mail being sent to the internal mailhost, and everything else to an upstream
MX box that has connectivity (it's third party not managed by me)

Since all messages leave that relay box, wouldn't general do rewrites on every message,
even the internal ones?

Perhaps I need to use a transport for local to send to the mailbox store, and relay all mail to another instance where it can apply a general rewrite? Trying to avoid over complicating with instances or additional VMs if there's an easier way to do this.

John

Reply via email to