Re: Save all emails in transit, including envelope data

2022-09-06 Thread Jim Popovitch



On Tue, 2022-09-06 at 12:07 -0400, Wietse Venema wrote:
> Jim Popovitch:
> > On Tue, 2022-09-06 at 09:25 -0400, Viktor Dukhovni wrote:
> > > On Tue, Sep 06, 2022 at 06:35:05AM -0400, Wietse Venema wrote:
> > > 
> > > > > Any suggestion?
> > > > 
> > > > /etc/postfix/main.cf:
> > > > recipient_bcc_maps = pcre:/etc/postfix/recipient_bcc.pcre
> > > > 
> > > > /etc/postfix/recipient_bcc.pcre:
> > > > (.+)@(+)$1%$2@backup.example
> > > 
> > > Nit:
> > > 
> > > /(.+)@(.+)/   $1%$2@backup.example
> > 
> > What are my options for sending that to a file instead of a destination
> > address?  I want to temporarily store a copy of all bounce emails for a
> > mailinglist to debug a bounce processing problem. 
> 
> Proper mail systems will return undeliverable messages to the mailing
> list's bounce address. Just like any other email, you can receive
> those messages in a mailbox file or in a maildir structure.

Right, right.  What I want to do is add the recipient_bcc_maps that you
suggested earlier, and modify it to match the bounce address, and then
dump that to a file for future examination the next time the mailing
list's bound processing doesn't function as it should. 

-Jim P.




Re: Save all emails in transit, including envelope data

2022-09-06 Thread Wietse Venema
Jim Popovitch:
> On Tue, 2022-09-06 at 09:25 -0400, Viktor Dukhovni wrote:
> > On Tue, Sep 06, 2022 at 06:35:05AM -0400, Wietse Venema wrote:
> > 
> > > > Any suggestion?
> > > 
> > > /etc/postfix/main.cf:
> > > recipient_bcc_maps = pcre:/etc/postfix/recipient_bcc.pcre
> > > 
> > > /etc/postfix/recipient_bcc.pcre:
> > > (.+)@(+)  $1%$2@backup.example
> > 
> > Nit:
> > 
> > /(.+)@(.+)/ $1%$2@backup.example
> 
> What are my options for sending that to a file instead of a destination
> address?  I want to temporarily store a copy of all bounce emails for a
> mailinglist to debug a bounce processing problem. 

Proper mail systems will return undeliverable messages to the mailing
list's bounce address. Just like any other email, you can receive
those messages in a mailbox file or in a maildir structure.

Wietse


Re: Save all emails in transit, including envelope data

2022-09-06 Thread Jim Popovitch



On Tue, 2022-09-06 at 09:25 -0400, Viktor Dukhovni wrote:
> On Tue, Sep 06, 2022 at 06:35:05AM -0400, Wietse Venema wrote:
> 
> > > Any suggestion?
> > 
> > /etc/postfix/main.cf:
> > recipient_bcc_maps = pcre:/etc/postfix/recipient_bcc.pcre
> > 
> > /etc/postfix/recipient_bcc.pcre:
> > (.+)@(+)$1%$2@backup.example
> 
> Nit:
> 
> /(.+)@(.+)/   $1%$2@backup.example
> 

What are my options for sending that to a file instead of a destination
address?  I want to temporarily store a copy of all bounce emails for a
mailinglist to debug a bounce processing problem. 

tia,

-Jim P.



Re: Save all emails in transit, including envelope data

2022-09-06 Thread Viktor Dukhovni
On Tue, Sep 06, 2022 at 06:35:05AM -0400, Wietse Venema wrote:

> > Any suggestion?
> 
> /etc/postfix/main.cf:
> recipient_bcc_maps = pcre:/etc/postfix/recipient_bcc.pcre
> 
> /etc/postfix/recipient_bcc.pcre:
> (.+)@(+)  $1%$2@backup.example

Nit:

/(.+)@(.+)/ $1%$2@backup.example

-- 
VIktor.


Re: Save all emails in transit, including envelope data

2022-09-06 Thread Wietse Venema
Massimo Federico Bonfigli:
> As per the subject says, is there a way to save all email in transit
> through postfix, including the basic envelope info (in particular at least
> envelope sender and recipients)?
> 
> I know I could use the pipe daemon to invoke a script and save these info,
> however that would be my delivery destination, it would affect the mail
> flow and I would be forced to reinject the email into postfix and I'm not
> sure if that would come without issues so I was hoping to find some way
> that would be less intrusive.
> 
> What I thought it would be possible was to have two values in the transport
> maps, like:
> 
> * smtp:, mypipe:
> 
> To achieve email forking between transports, but this is not possible (I
> like to be an optimist at times)
> 
> As far as I know the recommended way to save a copy of all emails is to use
> always_bcc but with that I lose the envelope data and I can't "replay"
> those emails reliably in case of some data loss event.
> 
> Any suggestion?

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

/etc/postfix/recipient_bcc.pcre:
(.+)@(+)$1%$2@backup.example

Wietse