The second rule below grabs spaces, even though they are excluded, by
omission from the match list:
OR=2147483647^0 # Max score => immediate success. i.e. OR
:0: # (Topic|Subject) ~ project
* $ $OR ^(X-)?Topic: +\/[^ ]+
# Allow also "Re: Fw: xxx"
* $ $OR ^Subject:[ ]*((re|fw):?[ ]*)+\/[0-9a-zA-Z_-]+
Given that "It will contain all text matching the regular expression
past the `\/' token", how does MATCH then come to hold "Fw: n2ip_nms",
as logged:
procmail: Score: 0 0 "^(X-)?Topic: +\/[^ ]+"
procmail: Assigning "MATCH="
procmail: Matched "Fw: n2ip_nms"
procmail: Score: 2147483647 2147483647 "^Subject:[ ]*((re|fw):?[
]*)+\/[0-9a-zA-Z_-]+"
procmail: Executing " ls /export/projects | grep -i "$MATCH""
procmail: Non-zero exitcode (1) from " ls /export/projects | grep -i
"$MATCH""
procmail: No match on " ls /export/projects | grep -i "$MATCH""
Repeating the experiment, with explicit exclusion generates the same
result:
procmail: Matched "Fw: n2ip_nms"
procmail: Score: 2147483647 2147483647 "^Subject:[ ]*((re|fwd?):?[
]*)+\/[^ :]+"
How can it do that? (Or, perhaps more to the point, what am I
doing in an unprocmailian way? :-(
For what it's worth, when I try the regex with gawk, its matching
grabs things OK:
$ gawk '{match($0,/^Subject:[ ]*((Re|Fw):?[
]*)+([0-9a-zA-Z_-]+)/,A); print A[3]}'
Subject: Re: Fw: n2ip_nms
n2ip_nms
Regards,
Erik
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail