procmail
[Top] [All Lists]

Re: independent chain actions.

2002-08-26 10:25:05
Udi asked,

| I try to remove temporary file after recipe was finished with
| success or not:
|
| :0

I assume that there's a condition here and that you aren't just heaping on
braces for fun; I've seen a lot of code that does that.

| {
| :0 Bw
| * $ ? antivirus $FILE
| /dev/null
|
| :0
| /bin/rm $FILE
| }
|
| The problem:  If I want to remove $FILE I must use [aAeE] flags
| and I want to remove it on ANY case.

The actual reason is that the first recipe inside the braces completes the
delivery, so the second recipe never gets seen.  The a, A, e, or E flag
wouldn't make a difference.

I'm not sure about one thing in Martin's suggestion; my experience is that
procmail happily skips any condition weighted 0^0 as not worth testing.  You
could try this:

 :0B # no need for `w' on a dump to /dev/null
 * 2^0 ? antivirus "$FILE"
 * 0^1 dummy ?? ? rm "$FILE"
# if that doesn't work, try  * 1^0 dummy ?? ! ? rm "$FILE"
 * -1^0
 /dev/null

instead.  The reason for the third condition is that you don't want to trash
the message if only the second condition scored.



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