procmail
[Top] [All Lists]

Re: 'a' flag vs 'e' flag vs '?' condition

2001-11-14 23:14:25
Paul asked,

| Is the 'a' flag really the opposite of the 'e' flag?

Not exactly.  `a' means "if the most recently preceding recipe on this
nesting level with no `a' nor `A' matched and the action of the most recent
matching recipe on this nesting level succeeded."  `e' means "if the most
recent recipe on this nesting level matched but its action failed."

| I have:
|
|  :0 HcW
|  * ^\/Subject:.*
|  | grep '^Subject' | head -1 | egrep -vq '^Subject:.*(.)\1\1\1\1\1[^\1]+'
|
|  :0 efwh
|  | formail -A "X-spamtrap: $MATCH"

| But is this exactly the same as using:
|
|  :0 HcW
|  * ^\/Subject:.*
|  | egrep -q '^Subject:.*(.)\1\1\1\1\1[^\1]+'
|
|  :0 afwh
|  | formail -A "X-spamtrap: $MATCH"

It looks that way.  Usually it's wrong to say that, out of egrep and
egrep -v, one will succeed while the other will fail, but when the search
space consists of exactly one line, it is the case (I guess).

| And for that matter, could I do the same thing with:
|
|  :0 HfW
|  * ? egrep -q '^Subject:.*(.)\1\1\1\1\1[^\1]+'
|  | formail -A "X-spamtrap: $MATCH"

Mmm, I'm not so positive how `H' and `B' apply to exit code conditions.
This would make me feel more comfortable:

  :0 fW
  * H ?? ? egrep -q '^Subject:.*(.)\1\1\1\1\1[^\1]+'
  | formail -A "X-spamtrap: $MATCH"



_______________________________________________
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>