procmail
[Top] [All Lists]

Re: A rule to copy all message to a maildir, and then keep processing

2009-11-19 11:18:45

Another approach would be to use an includerc, which only delivers to the backup mailbox if a variable isn't set. Roughly:

:0
* BACKEDUP ?? ^^^^
{
        BACKEDUP=YES
        :0c:
        backup.mbx
}

If you're identifying lists before spam filtering, then within the scope of having identified it to be a list message (say, after using list_id.rc), you can INCLUDERC=backup.rc, then continue to process for specific list messages. Likewise, if you have a greenlist, after verifying the sender is in your greenlist, INCLUDERC=backup.rc, then handle the specifics of storing the greenlisted message. If it is neither, you should process for spam, discard spam, and afterwards, INCLUDERC=backup.rc

Not elegant, but if any of the recipies bail out without explicit delivery and you continue to process the procmailrc, because the message has already been backed up, it won't be re-backed up by a seperate "call" to backup.rc.

Of course, if you simply process for spam FIRST, then backup everything that isn't spam, it is a lot cleaner.
---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail