procmail
[Top] [All Lists]

Problems with procmail regexp and <...>

2005-07-20 13:51:28
All -
Sorry if I missed similar things somewhere in a FAQ, but I didn't see 
anything specific enough to help me understand.

I am attempting to process emails via procmail and send certain information 
from each email out to a script.  I've had no problems grabbing the subject 
or from lines using regexp and setting a variable, then passing the variable 
to an external script, but I can't seem to get a regexp that matches a line 
formatted as the following:

<anyaddress(_at_)anydomain(_dot_)com>:

This is actually a specific line that I'm trying to grab from a bounced 
message sent by the qmail daemon, if anyone cares.

The recipe that I have attempting to do this is:

:0 B
* ^\<\/.*\>:
{
   BOUNCED = "$MATCH"
}
|/scripts/process_rejects.ksh "$BOUNCED"

The error that I get is:

procmail: Skipped "|/scripts/process_rejects.ksh "$BOUNCED""

To verify that it's not the external script that's the problem, I've done 
things such as:

:0
* ^Subject:\/.*
{
          SUBJECT = "$MATCH"
}
|/scripts/process_rejects.ksh "$SUBJECT"

and it works perfectly.
It appears to be a problem with how procmail parses the < and > in the 
script, but I think I've tried all the methods to escape that, although I'm 
still missing something.
If I use the same regexp with grep, for instance, it works as expected (I 
have to un-escape the < and > in that case).

Hopefully that makes sense, and I'm just missing something REALLY obvious.

Thanks



____________________________________________________________
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