Re: Redirect all mail to one user retaining original envelope rcpt

2012-02-10 Thread Fabio Sangiovanni
Hi Wietse,

thanks a lot for your help.
One last question: in order to redirect mail from the original recipient(s) to 
the catch-all address I'm using address rewriting with canonical maps. Is this 
the best way to do it? Or should I rely on virtual aliasing for some reason?
My configuration:

/etc/postfix/main.cf
...
recipient_canonical_classes = envelope_recipient
recipient_canonical_maps = regexp:/etc/postfix/recipient_canonical
…

/etc/postfix/recipient_canonical
/.+@.+/ my_catch_all_addr...@mydomain.tld

Thanks again,
Fabio


Il giorno 09/feb/2012, alle ore 19:31, Wietse Venema ha scritto:

 Fabio Sangiovanni:
 Hi,
 
 I need to configure Postfix to get the following result: I need
 every mail submitted by users to be redirected to a remote account
 (via SMTP or LMTP), and every message must contain an header with
 the original envelope rcpt.  Example:
 
 /etc/postfix/main.cf
smtpd_recipient_restrictions = 
   check_recipient_access pcre:/etc/postfix/prepend.pcre
   ...stuff...
   reject_unauth_destination
   ...more stuff...
 
 /etc/postfix/prepend.pcre:
/(.+)/ prepend X-Recipient: $1
 
   Wietse
 



Re: Redirect all mail to one user retaining original envelope rcpt

2012-02-10 Thread Noel Jones
On 2/10/2012 2:36 AM, Fabio Sangiovanni wrote:
 Hi Wietse,
 
 thanks a lot for your help.
 One last question: in order to redirect mail from the original recipient(s) 
 to the catch-all address I'm using address rewriting with canonical maps. Is 
 this the best way to do it? Or should I rely on virtual aliasing for some 
 reason?
 My configuration:
 


If you want the envelop AND headers rewritten, use canonical_maps;
if you want only the envelope rewritten, use virtual_alias_maps.



  -- Noel Jones


Re: Redirect all mail to one user retaining original envelope rcpt

2012-02-10 Thread Noel Jones
On 2/10/2012 2:36 AM, Fabio Sangiovanni wrote:
 Hi Wietse,
 
 thanks a lot for your help.
 One last question: in order to redirect mail from the original recipient(s) 
 to the catch-all address I'm using address rewriting with canonical maps. Is 
 this the best way to do it? Or should I rely on virtual aliasing for some 
 reason?
 My configuration:
 


If you want the envelop AND headers rewritten, use canonical_maps;
if you want only the envelope rewritten, use virtual_alias_maps.



  -- Noel Jones


Re: Redirect all mail to one user retaining original envelope rcpt

2012-02-10 Thread Fabio Sangiovanni
Hi Noel,

thanks, I'll follow your advice.

Fabio


Il giorno 10/feb/2012, alle ore 17:44, Noel Jones ha scritto:

 On 2/10/2012 2:36 AM, Fabio Sangiovanni wrote:
 Hi Wietse,
 
 thanks a lot for your help.
 One last question: in order to redirect mail from the original recipient(s) 
 to the catch-all address I'm using address rewriting with canonical maps. Is 
 this the best way to do it? Or should I rely on virtual aliasing for some 
 reason?
 My configuration:
 
 
 
 If you want the envelop AND headers rewritten, use canonical_maps;
 if you want only the envelope rewritten, use virtual_alias_maps.
 
 
 
  -- Noel Jones
 



Re: Redirect all mail to one user retaining original envelope rcpt

2012-02-09 Thread Wietse Venema
Fabio Sangiovanni:
 Hi,
 
 I need to configure Postfix to get the following result: I need
 every mail submitted by users to be redirected to a remote account
 (via SMTP or LMTP), and every message must contain an header with
 the original envelope rcpt.  Example:

/etc/postfix/main.cf
smtpd_recipient_restrictions = 
check_recipient_access pcre:/etc/postfix/prepend.pcre
...stuff...
reject_unauth_destination
...more stuff...

/etc/postfix/prepend.pcre:
/(.+)/ prepend X-Recipient: $1

Wietse