procmail
[Top] [All Lists]

when the TRAP is run

1998-08-19 12:03:26
Walter Haiding posted,

| On Sun, 16 Aug 1998, Liviu Daia wrote:
| > | Otherwise a really great. Can't get any simpler.

No, Walter, you wrote that line, and I wrote the rest of that excerpt:

| > Yes, it can:
| >
| > :0:
| > * conditions
| > /var/spool/mail/someuser

Anyhow,

| On Sat, 15 Aug 1998, David W. Tamkin wrote:
| > That's what procmail's TRAP variable is for.

That one is right; I did say that.  And Walter commented,

| Which is called when procmail terminates. However, *when* does procmail
| terminate? After each recipe (I doubt that) or after each message in the
| mailbox was processed?

Procmail terminates when it exits ... after final delivery of the message.
It doesn't terminate (nor execute TRAP) after delivering a copy to a `c'
recipe [however, a clone does execute TRAP when it terminates, unless you
unset TRAP for it].  It doesn't execute the trap after a variable assignment,
a variable capture recipe, a filtering recipe, nor any other non-delivering
action.

On the other hand, it *does* execute the trap if you do a quick bail-out by
unsetting or missetting $HOST.