OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Re: virtual_alias_maps: rewriting outbound

From: Magnus Bäck (magnusdsek.lth.se)
Date: Sun Jul 02 2006 - 05:19:30 CDT


On Sunday, July 02, 2006 at 07:00 CEST,
     Chris McKeever <techjedigmail.com> wrote:

> I have a virtual_alias_maps setup to handle legacy emails names:
> first.lastexample.com -> flastexample.com
>
> /(.)[^\.]*\.(.*)(.*)$/ $1$2$3
>
> we run multiple domains that had that setup.
>
> It works great for the inbound and does what I expect. Unfortunately,
> outbound email gets checked against that alias, then is rewritten and
> thus fails when sending.
>
> Is there a way (outside of explicitley listing each possible hosted
> mail domain) to not have the outbound email run through the alias?

You probably want to use canonical rewriting instead of virtual
rewriting. That way addresses in the headers will also be rewritten.

But that won't solve your problem. I suggest you avoid the .* domain
wildcard and instead explicitly list the domains that you want
rewritten.

/(.)[^\.]*\.(.*)example\.com$/ $1$2example.com
/(.)[^\.]*\.(.*)example\.org$/ $1$2example.org
/(.)[^\.]*\.(.*)example\.net$/ $1$2example.net

--
Magnus Bäck
magnusdsek.lth.se