procmail
[Top] [All Lists]

Re: Detecting and logging dupes

2001-08-28 22:41:03
"David W. Tamkin" <dattier(_at_)ripco(_dot_)com> writes:
Duncan Hill followed up,

| In retrospect, I need to keep a spare copy of all mail
| that has been seen as a duplicate.

In that case, you need a different approach:

# regional lockfile is needed during condition (local lockfiles
# work only during actions of matched recipes)
LOCKFILE=msgid.cache$LOCKEXT

:0 W # with regional lockfile in effect, local not needed
* ? formail -D 32768 msgid.cache
duplicates

LOCKFILE # if not duplicate, remove regional lockfile

The 'W' flag isn't really needed on the recipe, but David's solution
should definitely work.  I prefer, however, a version closer to the
original code:

        # Note the 'c' flag!
        :0 Whc: msgid.cache$LOCKEXT
        | formail -D 32768 msgid.cache

        # If the name was in the cache then the previous action will
        # have succeeded, so we chain off it with the 'a' flag.
        # The second colon enables dotlocking of the folder and should
        # be used if it's a mbox-style folder.
        :0 a:
        duplicates


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