procmail
[Top] [All Lists]

Re: match a set of header-lines

2002-03-22 12:13:09
Ruud asked,

| In my .procmailrc I have the following:

[after some elisions]

| REGEXP="Received:"

| :0
| * $ ^\/$REGEXP(.*$)+
| {
|   HEADERLINES = $MATCH
| }

| The variable HEADERLINES is set to the group of headerlines from the
| first ^Received:-line until the end. But it would be sufficient if
| all the headerlines from the first ^Received to the last ^Received
| would be matched. I tried
|
|   * $ ^\/$REGEXP(.*$)*$REGEXP(.*)$
|
| but that didn't work. If you know why it doesn't, and/or how to
| make it work, I would be much obliged.

It looks correct to me (since the search area is H).  When you say it "didn't
work," what happened instead?  What does a verbose logfile say?  Does the
condition fail to match, or is the wrong text extracted?  Are you positive that
there's no trailing whitespace after the rightmost dollar sign?  Does it work if
you use the literal text "Received" or "Received:" instead of a variable?

I'd probably write

 * $ ^\/$REGEXP(.+$)*$REGEXP.+$

myself, but since the search area is H, there should be no effective difference.





_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>