OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Re: [Newbie] Can I perform origin dependant domain rewriting?

From: Greg Cowie (cowiecorefa.com)
Date: Mon Dec 10 2007 - 13:06:31 CST


Thanks very much Victor - by dividing the incoming and outgoing into two
transport streams and applying the smtp_generic_maps to JUST the
outgoing stream, I get around the issue of not wanting to rewrite
recipient fields, as those by definition will be in the incoming stream.

Just need my supervisor to sign off on this now.

mouss - thanks for your pointer, and I appreciate that I didn't send
enough information to really diagnose this properly, I'm suitably
chagrined - my apologies. Should this solution of Victor's prove
unsuitable I will correct my omissions as best I can.

Thank you both,
Greg

Victor Duchovni wrote:
> On Mon, Dec 10, 2007 at 12:21:09PM -0500, Greg Cowie wrote:
>
>> System - postfix 2.4.1 running on Fedora Core 4
>>
>> If anyone could suggest a course of action, it would be greatly
>> appreciated. I think I've done my homework, but I'm hoping that I've
>> just overlooked something in the documentation/group archives/google -
>> maybe my terms aren't cannon.
>>
>> I want to rewrite the domain on outgoing email iff it matches one of our
>> domains (basically rebranding our outgoing email without reconfiguring
>> each of 300+ email clients), but I don't want to rewrite the domain name
>> if the email is NOT from inside our network. I'm able to set up the
>> rewriting using a canonical map, but this seems to be an all or nothing
>> proposition. Is there any way to rewrite the domain name on any mail
>> originating from mynetworks, and not rewrite the same domain if it
>> originates outside of mynetworks?
>
> The simplest case is when it is safe to assume that outbound mail is
> from inside your network, and inbound mail is not. In that case, use
> the "relay" transport for inbound destinations (or deliver locally)
> and use "smtp" for outboud traffic. In master.cf turn on generic(5)
> rewriting for "smtp" only and not for "relay".
>