I've did it using canonical maps :
Main.cf :
sender_canonical_maps = hash:/etc/postfix/canonical
/etc/postfix/canonical:
@test.local @test.edu
Thanks
Nasser
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On
> Behalf Of Luigi Rosa
> Sent: Sunday, March 06, 2011 10:49
> To: Postfix users
> Subject: Re: Domain rewriting
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Nasser Heidari said the following on 06/03/11 06:43:
>
> > Now I want to rewrite All of my emails domain from test.local to
> > test.edu when they traveling to outside network.
>
> I have many similar installations: Exchange (often on Windows SBS) inside and
> Postfix as border MTA.
>
> My solution is this, giving the domain name example.com and the exchange
> hostname exchange.example.local
>
> On the Exchange server you configure each user with _main_ SMTP address
> [email protected] and another SMTP address [email protected] (you
> can also add SMTP addresses for example.local, but could not be needed).
>
> In the Exchange SMTP connector you tell Exchange to use Postfix MTA as smart
> relay
> (you have to enclose Postfix IP in square brackets in the appropriate field
> of SMTP
> connector).
>
> In Postfix you create an alias table (using /etc/aliases, or a database of
> your
> choice) like this:
>
> [email protected]: [email protected]
> [email protected]: [email protected]
> [email protected]: [email protected]
>
> Of course you have to tell Postfix to deliver all the mail for
> exchange.example.com to
> exchange server
>
>
> If you follow this procedure, or something linke this, your email from
> Exchange will
> have [email protected] because you have set it as the main email address
>
>
>
>
> Ciao,
> luigi
>
> - --
> /
> +--[Luigi Rosa]--
> \
>
> I have a bad feeling about this.
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAk1zNWcACgkQ3kWu7Tfl6ZRRdgCgjYkV6hesQ05n/zI+11J4zRzi
> 1AoAn2vMyVG3vQxVI47S2pfiEcdMVMPy
> =Li4W
> -----END PGP SIGNATURE-----