Preservation of original envelope when always_bcc

2012-02-23 Thread Janantha Marasinghe

Dear Friends,

I'm currently using always_bcc to archive inbound and outbound of my 
postfix server. What do I have to do to preserve the original envelope 
of the e-mails sent? I search the mailinglist archive at postfix users 
but couldnt find a clear solution.


Thanks
Jay


Re: Preservation of original envelope when always_bcc

2012-02-23 Thread Wietse Venema
Janantha Marasinghe:
 Dear Friends,
 
 I'm currently using always_bcc to archive inbound and outbound of my 
 postfix server. What do I have to do to preserve the original envelope 
 of the e-mails sent? I search the mailinglist archive at postfix users 
 but couldnt find a clear solution.

Use a regular expression:

/etc/postfix/main.cf:
recipient_bcc_maps = pcre:/etc/postfix/recipient_bcc
recipient_delimiter = +

/etc/postfix/recipient_bcc:
/^(.*)@(.*)/bcc+$1=$2...@example.com

(it would also work with recipient_delimiter = -, and
bcc-$1=$2...@example.com).

Wietse


Re: Preservation of original envelope when always_bcc

2012-02-23 Thread Janantha Marasinghe

Hi Wietse,

Thanks for the swift response!

1. recipient_bcc maps is only does inbound mail right ? I have to set 
sender_bcc as well to catch the outbound?
2. bcc+$1=$2...@example.com is not clear for me. basically i have setup 
another e-mail address to which primary postfix should send the archive 
messages to.


On 2/23/2012 9:17 PM, Wietse Venema wrote:

Janantha Marasinghe:

Dear Friends,

I'm currently using always_bcc to archive inbound and outbound of my
postfix server. What do I have to do to preserve the original envelope
of the e-mails sent? I search the mailinglist archive at postfix users
but couldnt find a clear solution.

Use a regular expression:

/etc/postfix/main.cf:
 recipient_bcc_maps = pcre:/etc/postfix/recipient_bcc
 recipient_delimiter = +

/etc/postfix/recipient_bcc:
 /^(.*)@(.*)/   bcc+$1=$2...@example.com

(it would also work with recipient_delimiter = -, and
bcc-$1=$2...@example.com).

Wietse





Re: Preservation of original envelope when always_bcc

2012-02-23 Thread Wietse Venema
Janantha Marasinghe:
 Hi Wietse,
 
 Thanks for the swift response!
 
 1. recipient_bcc maps is only does inbound mail right ? I have to set 
 sender_bcc as well to catch the outbound?

Postfix has no concept of inbound or outbound mail. It receives
mail and gives it to the delivery agent that is responsible for
the recipient's domain.

The example makes BCC copies of ALL email, preserving ALL envelope
recipient addresses, regardless of whether a recipient is local or
remote.

 2. bcc+$1=$2...@example.com is not clear for me. basically i have setup 
 another e-mail address to which primary postfix should send the archive 
 messages to.

bcc is the name
example.com is the domain.

You are supposed to provide the actual name and domain.

Wietse


Re: Preservation of original envelope when always_bcc

2012-02-23 Thread Janantha Marasinghe

Hi Wietse,

Thanks for clarification. Now I got it. so if the mail address where the 
archive mail should go  is arch...@example.com then the in the  
/etc/postfix/recipient_bcc: it would be the following right?


 /^(.*)@(.*)/archive+$1=$2...@example.com


On 2/23/2012 9:41 PM, Wietse Venema wrote:

Janantha Marasinghe:

Hi Wietse,

Thanks for the swift response!

1. recipient_bcc maps is only does inbound mail right ? I have to set
sender_bcc as well to catch the outbound?

Postfix has no concept of inbound or outbound mail. It receives
mail and gives it to the delivery agent that is responsible for
the recipient's domain.

The example makes BCC copies of ALL email, preserving ALL envelope
recipient addresses, regardless of whether a recipient is local or
remote.


2. bcc+$1=$2...@example.com is not clear for me. basically i have setup
another e-mail address to which primary postfix should send the archive
messages to.

bcc is the name
example.com is the domain.

You are supposed to provide the actual name and domain.

Wietse