[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Two copies of E-Mail (Re: I wish to advocate linux)



David Guntner wrote:
> Anyway, the recipe is dirt simple.
> ...
> # Duplicate Suppression.
> :0Whc: $MAILDIR/.msgid.cache.lock
> | $FORMAIL -D 8192 $MAILDIR/.msgid.cache
> 
>         # Take out the Trash.
>         :0 a:
>         /dev/null
> 
> That's all there is to it.  The formail program is used to grab the
> Message-ID of the incoming message.  Even if it is sent To: one address
> and CC: another, both "copies" will have the same Message-ID.  When the
> first one comes in, it stores that ID in the $MAILDIR/.msgid.cache file
> after first comparing the message to see if that ID has already been
> stored there.  If not, then it stores the ID and returns a FALSE so that
> the second part ("take out the trash") won't process.  If the Message-ID
> already *has* been stored in the cache file, then it returns a TRUE and
> the second part then dumps the message into /dev/null.

If it works for you then great.  But this is not without problems for
others.

For one I use the mailing list headers List-Id and List-Post.  Those
are the standard headers and those are the best ones to use for filing
mailing list messages.  Smart MUAs use those to know how to do a
list-reply.  Therefore the copy I want is the copy that comes from the
mailing list.

When people CC me directly then the direct copy is almost always the
one that comes first.  The recipe above deletes the second one.  The
second one is usually the one that comes through the mailing list
because this mailing list is sending to 2,000+ recipients and
therefore it takes longer.  The above almost invariably discards the
mailing list copy that I want to keep and keeps the direct copy that I
want to discard.

This means that people who use the above can't use the standard
List-Id headers and instead try to use the To: or Cc: addresses to
file the messages.  Or worse they try to use a Subject: tag.  That is
bad because the List-Id header is there for just that purpose.

Thankfully debian-user doesn't use a subject tag.  But it is a chain
of circumstances such as this that cause people to make bad choices
and then often try to force those bad choices upon others.  How many
times have people asked for subject tags on random mailing lists
instead of using the List-Id header as it was intended?

At one time I used the above recipe myself but stopped using it due to
these problems.  YMMV.

> Note that the locks *are* critical to prevent corruption, so keep the
> trailing ":" characters where they are. :-)

Note that they aren't needed for the /dev/null rule.  :-) However I
vaguely recall that /dev/null is treated specially and therefore it
won't matter for it one way or the other.  I would still remove the
lock colon for /dev/null anyway since it isn't needed with /dev/null.

Bob

P.S.  Here is the procmail rules I use to file all Debian mailing list
messages.

:0
* ^List-Id: .*<debian-[-a-zA-Z0-9]+\.lists\.debian\.org>
* ^List-Id: .*<debian-\/[-a-zA-Z0-9]+
Lists/debian/$MATCH/

:0
* ^List-Id: .*<[-a-zA-Z0-9]+\.lists\.alioth\.debian\.org>
* ^List-Id: .*<\/[-a-zA-Z0-9]+
Lists/debian/$MATCH/

Attachment: signature.asc
Description: Digital signature


Reply to: