how to masquerade / map the from: field without masquerading the rcpt to:

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

how to masquerade / map the from: field without masquerading the rcpt to:

Etienne Simard-2
Hi,

I'm doing some tests to hopefully use postfix instead of the other MTA
but I tried different ways of masquerading the domain name with
another one and I am not successful.
The closest I got was using

mydomain = example.net
masquerade_domains = example.org, example.net
smtp_generic_maps = hash:/etc/postfix/generic

@example.org @example.net

This works in theory, but then the RCPT TO: going to [hidden email]
also get rewritten to [hidden email] which is not good.

and with
sender_canonical_maps = hash:/etc/postfix/sender_canonical

@example.org @example.net

I only get the reply-to email from the recipient to be changed to
[hidden email]

Any hint would be appreciated. I couldn't find the exact same example
on the internet which is masquerading two domain domain names under
one, but only for the
sender's email address and not the recipient email address.

--
esimard
Reply | Threaded
Open this post in threaded view
|

Re: how to masquerade / map the from: field without masquerading the rcpt to:

Wietse Venema
Etienne Simard:
> Hi,
>
> I'm doing some tests to hopefully use postfix instead of the other MTA
> but I tried different ways of masquerading the domain name with
> another one and I am not successful.
> The closest I got was using
>
> mydomain = example.net
> masquerade_domains = example.org, example.net

masquerade_domains is a hack for poorly-organized sites.  It is
better if systems send mail with an valid email address.

If that is not possible, consider using smtp_generic_maps on the
boundary between the chaos and the external network. Use the same
rewriting strategy as described, for a different problem, in
http://www.postfix.org/STANDARD_CONFIGURATION_README.html#fantasy

masquerade_domains breaks all kinds of things in Postfix, and it
should probably be phased out, now that smtp_generic_maps exists.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: how to masquerade / map the from: field without masquerading the rcpt to:

Etienne Simard-2
Thanks for the quick response.

The problem i have with the smtp_generic_maps is that when I put
"@exemple.org @exemple.net"
in the map it works, but it also changes the RCPT TO addresses.

So if I send from [hidden email] to [hidden email] it will
now try to send emails to [hidden email] which does not exist.

Is there a way around that?

Regards,

On Fri, Mar 22, 2013 at 5:40 PM, Wietse Venema <[hidden email]> wrote:

> Etienne Simard:
>> Hi,
>>
>> I'm doing some tests to hopefully use postfix instead of the other MTA
>> but I tried different ways of masquerading the domain name with
>> another one and I am not successful.
>> The closest I got was using
>>
>> mydomain = example.net
>> masquerade_domains = example.org, example.net
>
> masquerade_domains is a hack for poorly-organized sites.  It is
> better if systems send mail with an valid email address.
>
> If that is not possible, consider using smtp_generic_maps on the
> boundary between the chaos and the external network. Use the same
> rewriting strategy as described, for a different problem, in
> http://www.postfix.org/STANDARD_CONFIGURATION_README.html#fantasy
>
> masquerade_domains breaks all kinds of things in Postfix, and it
> should probably be phased out, now that smtp_generic_maps exists.
>
>         Wietse



--
Etienne Simard
Network and systems administrator | Acquisio

Tel: 450.465.2631 ext. 265
Cell: 514-836-9183
Email: [hidden email]

Follow Us:
Twitter: http://twitter.com/acquisio
LinkedIn: http://www.linkedin.com/company/acquisio
Facebook: http://www.facebook.com/acquisio


6300 Auteuil, suite 300 | Brossard, Qu├ębec J4Z 3P2
Toll Free: 1.866.493.9070 | www.acquisio.com
Reply | Threaded
Open this post in threaded view
|

Re: how to masquerade / map the from: field without masquerading the rcpt to:

Wietse Venema
Etienne Simard:
> Thanks for the quick response.
>
> The problem i have with the smtp_generic_maps is that when I put
> "@exemple.org @exemple.net"
> in the map it works, but it also changes the RCPT TO addresses.

Use the right tool for the right job.

Use smtp_generic_maps on the network boundary, to transform addresses
that are valid only inside the network, into addresses that are
valid outside the network, without exceptions.

Use aliases on the network boundary MTA, to route mail that enters
the network from outside, to whatever addresses you use internally.

        Wietse