Can Procmail be configured to get rid of mail after it is passed to a script?
Solution 1:
This is exactly how Procmail operates out of the box. Recipes are executed sequentially until a delivering action is taken, or until we run out of recipes, and deliver to $DEFAULT
. Writing to a mailbox, piping to a command, or forwarding to a different recipient are all delivering actions.
However, your first recipe has a c
flag, which explicitly disables this behavior, and causes another delivery to be attempted even after this action completes.
In so many words, take out the c
flag (and probably the second colon, too; or name an explicit lock file after it).
The old (not so) mini-FAQ has a section about locking which coincidentally also has a passage about your main question, and a discussion of "deliveredness".