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

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



On Sun 10 Mar 2013 at 00:37:59 -0700, Bob Proulx wrote:

> Zenaan Harkness wrote:
> > 
> > Cool :)
> > 
> > Thanks for sharing. Appreciated.
> 
> +1.  I also think that is pretty cool.  Since Message-Id is one of the
> few that would be passed through.  However many clients do not do
> this.  I have many problem friends who reply with bad MTAs that break
> threads.
> 
> Pretty cool just the same though.

Thank you.

An implementation of the idea is below.

If a CC arrives first, it is stored and its Message-ID recorded. A list
mail which comes in later with the same message-ID is saved and the
previous CC deleted using archmbox.

A list mail arriving first is saved and has its Message-ID recorded. A
later arriving CC is deleted because it has the same Message-Id.

A cron job using archmbox can move mails left in possiblecc to inbox at
a suitable time.

Note that another post

   http://lists.debian.org/debian-user/2013/03/msg00625.html

suggests a method for generating a Message-ID for the sent list mail
which does not depend on the use of Mutt.



SHELL=/bin/sh
TESTDIR=/home/brian/procmail-testing
MAILDIR=${TESTDIR}/received-mail
LOGFILE=${TESTDIR}/Proctest.log
LOG="--- Logging for ${LOGNAME}, "

#Troubleshooting:
VERBOSE=yes
LOGABSTRACT=all

FORMAIL=/usr/bin/formail
ARCHMBOX=/usr/bin/archmbox

# msgid.cache has all its data on one line. This does not suit the egrep
# line below.
MIDCACHE=`strings ${TESTDIR}/msgid.cache`

# Get the Message-ID of the mail. Remove leading whitespace.
# MID=`formail -zx"Message-ID"` is thought to be less efficient than the
# following:
:0
* ^Message-ID: \/.*
{
 MID = $MATCH
}

# Recipe 1.
# These are list mails which are not a response to one of my posts. Grab
# them immediately.
:0:
* ^List-Id:.*debian-user.lists.debian.org
* !^In-Reply-To:.*NoCcsPlease@example.com
${MAILDIR}/debian-user

# Recipe 2.
# A list mail which responds to a post of mine. Check if a Cc has aleady
# arrived and delete it if it has. Debian has an archmbox package.
:0Whc ${TESTDIR}/.archmbox.lock:
* ^List-Id:.*debian-user.lists.debian.org
* ^In-Reply-To:.*NoCcsPlease@example.com
* ? echo "${MID}" | egrep "${MIDCACHE}"
| $ARCHMBOX -k -o -1 -x Message-ID="${MID}"
~/procmail-testing/received-mail/possiblecc

# Recipe 3.
# Record Message-IDs of list mails which are in response to my posts. It
# shouldn't matter if a Cc is aleady deleted.
:0Whc: ${TESTDIR}/.msgid.cache.lock
* ^List-Id:.*debian-user.lists.debian.org
* ^In-Reply-To:.*NoCcsPlease@example.com
| $FORMAIL -D 8192 ${TESTDIR}/msgid.cache

# Recipe 4.
# We want all list mail.
:0:
* ^List-Id:.*debian-user.lists.debian.org
* ^In-Reply-To:.*NoCcsPlease@example.com
${MAILDIR}/debian-user

# Recipe 5.
# Check Message-ID of a Cc.
:0Whc: ${TESTDIR}/.msgid.cache.lock
* !^List-Id:.*debian-user.lists.debian.org
* ^In-Reply-To:.*NoCcsPlease@example.com
| $FORMAIL -D 8192 ${TESTDIR}/msgid.cache

# Recipe 6.
# Cc has arrived after the list mail (unlikely). It is deleted.
:0 a:
${MAILDIR}/devnull

# Recipe 7.
# A possible Cc has arrived before the list mail (most likely). It is
# put somewhere safe and only deleted if Recipe 2 sees it exists.
:0
${MAILDIR}/possiblecc


Reply to: