procmail
[Top] [All Lists]

Re: Dealing with duplicate messages

1997-07-15 09:15:00
Philip Guenther <guenther(_at_)gac(_dot_)edu> replied to Timothy Luoma 
<luomat(_at_)peak(_dot_)org>:
When I get a duplicate message, I want to know where the previous dups went. 

    X-Dup: earlier copy went to 'otherbox'
Sure.  Change all of your current delivering recipes to instead of make
note in a variable of what they would have done, then check for dups,

It is not quite so simple, I think. It will change the whole feel of
the filtering.

      :0
      * ^Return-Path: <?procmail-request@
      { MAILBOX = procmail }

        :0
        * ^From:.*\<guenther(_at_)gac\(_dot_)edu\>
        { MAILBOX = guenther }

      # check for duplicates
      :0 Whc: msgid.lock
      |formail -D 8192 msgid.cache

      :0 a
      {
          # It was a dup!  Note it and send it to the Dups folder
          :0 hf
          | formail -I"X-Dups: earlier copy went to ${MAILBOX-the spool}"

          MAILBOX = Dups
      }

Now where the original would have made procmail the higher priority
of the two recipes, it is now the lower priority. Creating a list
of boxes it would match for and then saving it in the last if not
a dupe, or adding a X-Dups: header with the whole list if it is
would probably be more interesting and useful.

      :0
      * ^Subject: your cron job
      { ACTION = 'gzip >>cron.gz' }

This would be a nightmare for complex recipes that use lots of
different quote types. And you might have to deal with different
flags or lockfiles on different recipes. Does procmail support
stuff like:

        FLAGS=W
        USELOCK=stage-one-lock

        :0 $FLAGS : $USELOCK
        * some-condition
        | eval $SOME_ACTION

Elijah
------
Please do not CC me when replying to the list.  It is not my responsibility to
prove to you my mail is not spam, if mail to you bounces it will not be resent.