On 13Nov2013 20:20, Maurice McCarthy <mansel...@gmail.com> wrote:
> Please excuse a numpty interrupting, but could an old procmail recipe
> be adapted for use here. What I've got I don't understand and it was
> poached from somewhere or other
> 
> # Get rid of duplicates
> :0 Whc: .msgid.lock
> | formail -D 16384 .msgid.cache
> :0 a
> /dev/null

I prefer to do this in mutt using the ~= search (matches messages
that are dupes of other messages). It is more "visible". FWIW, I
used to use the above procmail recipe, before deciding to do it in
mutt.

The above recipe uses formail to consult a tiny database where it
keeps the most recent 16384 message-ids seen. If the current message's
message-id is already there it it exits successfully. This is the
condition for the actual filing target "/dev/null". So: if already
seen, file message to /dev/null (discard it).

From "man formail":

   −D maxlen idcache
      Formail  will  detect if the Message‐ID of the current message
      has already been seen using an idcache file  of  approximately
      maxlen size.  If not splitting, it will return success if a
      duplicate has been found.  If splitting, it will not output
      duplicate  messages.  If  used in  conjunction  with  −r,
      formail will look at the mail address of the envelope sender
      instead at the Message‐ID.

I think it also adds the new message-id if unseen.

I do this in mutt for a few reasons:

  - this recipe prevents one from refiling a message.
    Scenario: change filing rules, submit misfiled message to the new rules.
    Result: message thrown away.

  - using mutt makes the discard visible.
    (except that I have an unconditional folder-hook to discard ~= messages
    on entry anyway now)
    At least it is per folder and does not prevent me refiling.

  - I no longer use procmail to file my mail, preferring a tool of
    my own called mailfiler.

Cheers,
--
Cameron Simpson <c...@zip.com.au>

Since I've mentioned the subject of geneology, I'll repeat a story I heard
about a poor fellow over on airstrip one.  Seems he spent the most recent
thirty years of his life tracking down his family history.  Spent hundreds
of pounds, traveled, devoted his life to it.  Then, last month, a cousin
told him he was adopted.  Ahhh, sweet irony.
        - Tim_Mefford <t...@physics.orst.edu>

Reply via email to