procmail
[Top] [All Lists]

Re: procmail multi-line-match in header problem

2006-06-23 12:46:12
On Fri, 23 Jun 2006, Don Russell wrote:

Justin Piszcz wrote:
I have a procmail rule:

################################################################################
# Save linux-kernel e-mails.
################################################################################
:0
* 
^Return-Path:(_dot_)*linux-kernel-owner(_dot_)*(_at_)vger(_dot_)kernel(_dot_)org*
linux-kernel


However, in some cases, the return path is split-up on three lines, and
the recipe does not match.
[snip]

Let me take a stab at this....

You could use formail to extract the return-path....

RP = `formail -zx Return-Path: | xargs`
:0 :
* RP ?? (_dot_)*linux-kernel-owner(_dot_)*(_at_)vger(_dot_)kernel(_dot_)org*
linux-kernel


A couple of observations...
1 - you did not specify the : to lock the mailbox (maybe you don't need
it, but you didn't say you were using maildir instead of mbox
2 - the asterisk at the end is going to match zero or more g characters.
I don't think that's really what you want.

Don

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail


Thanks, is using formail then the best solution for this issue?

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail