Quoting Martin Trautmann <[EMAIL PROTECTED]> from 2000-11-16 10:48 +0100:
> is there any chance to edit the headers of received mails semi-automatically?
> 
> My wish is a macro to fix threading from other users with poor email
> software. A macro shall be called with the list number of the proper
> referred email. This will copy the message id from there and insert it both
> within the References header line, as well as e.g. 
> 'X-References-Fixed: <Message-ID> fixed by mutt on <date>'

> How could this be done best, if possible? Which mutt version is required,
> since former versions do not support edit_headers?

Quoting Martin Trautmann <[EMAIL PROTECTED]> from 2000-11-16 11:58 +0100:
> May be I was not clear:
> 
> Message #123 (number as shown in the mutt list) is a reply to #100, but does
> neither contain a matching subject line, nor does it contain In-Reply-To or
> References.
> 
> Thus I must tell mutt manually this number 100 in order to get 100's
> <Message-ID> and insert it as 123's References.

I use a macro to do just this. except for the extra 'fixed' header, but
you should be able to add that one easily.  All the tricks are in formail 
and the fairly new <edit> command, which lets you edit the raw message.  
Not sure what version is needed though.. at least 1.2.something?

Using your example I would tag msg#123, move to msg#100, hit ",T" to
fix the threading, and just reopen the mailbox to have it shown.

#--
macro index ,T "\
<pipe-message>formail -x Message-ID > /tmp/mutt-msgID<enter>\
<enter-command>set editor=\
'cat %s |\
 formail -i \"References:\
 \`cat /tmp/mutt-msgID;\
   cat %s | formail -x References\`\"\
 > /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 current message's \"Message-ID\" into the tagged messages'\
 \"References:\" headers"
#--

/Ulf

Reply via email to