* David T-G [2001-08-07, 04:05 -0400]:
> Marco --
> 
> ...and then Marco Fioretti said...
> % The original thread started because somebody was pissed
> % off by people who start a totally different thread by hitting
> % "reply" to any message from the list, changing the subject to
> % a totally unrelated one, and off they go.
> 
> This time around, yes, but *my* original request was because of users
> whose mail just plain doesn't have a References: header at all.  And even
> replying to the list won't fix that :-)

This is indeed not the first time the question of how to handle broken
threads is discussed. Also the patches (or similar ones) have been
posted to the list before.

> Will this code ever make it into the official mutt distribution?  Who
> knows.  Should we abandon an idea that will apparently help a lot of
> people, or even just me?  I certainly hope not, 'cuz I sure can't code
> it, and it really belongs in mutt rather than in some procmail script
> (much though I love the procmail/formail idea because I can grok it :-)

I wrote two macros about a year ago to let me ,Thread or ,Unthread mails
at my will. You'll find the macros in the archives or attached. It would
be nice to have this functionallity in Mutt though.

With the macros, you should only move one mail: the top mail in the
subthread you want to break lose, or the top mail in the thread you want
to insert into another thread as a subthread. Note! This can give mails
with references to more than one thread.. but it _seems_ as if Mutt's
way of threading ties them to the mail closest. (i've never looked at
the code for how mails are gathered into threads)

Usage is to simply make a message the current and hit ,U to rename its
Reference: and In-Reply-To: headers. Or to tag the first mail of a full
thread, move over to where it should be inserted and hit ,T to insert
the current mail's Message-Id: as a References: header into the tagged
message while the old References: and In-Reply-To: are renamed.

You will have to reopen the mailbox to have the threading redone,
to synchronize the mailbox is not enough.

/Ulf
macro index ,T "\
<pipe-message>formail -z -x Message-ID > /tmp/mutt-msgID<enter>\
<enter-command>set editor=\
'formail -i \"References:\
 \`cat /tmp/mutt-msgID\`\"\
 -R In-Reply-To Old-In-Reply-To\
 < %s\
 > /tmp/mutt-fix.$$;\
 mv /tmp/mutt-fix.$$ %s; sleep 1; touch %s'<enter>\
<tag-prefix><edit>\
<shell-escape>rm /tmp/mutt-msgID<enter>\
<enter-command>set editor=vim<enter>" \
 "insert the current message's \"Message-ID\" into the tagged messages'\
 \"References:\" headers"

macro index ,U "\
<enter-command>set editor=\
'formail\
 -R References Old-References\
 -R In-Reply-To Old-In-Reply-To\
 < %s\
 > /tmp/mutt-fix.$$;\
 mv /tmp/mutt-fix.$$ %s; sleep 1; touch %s'<enter>\
<edit>\
<enter-command>set editor=vim<enter>" \
 "remove the current message's \"References:\" and \"In-Reply-To:\" headers"

Reply via email to