[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nmh-workers] problem with mark zeroing out sequences
From: |
Jerrad Pierce |
Subject: |
Re: [Nmh-workers] problem with mark zeroing out sequences |
Date: |
Tue, 25 Feb 2014 22:53:13 -0500 |
I suppose I could try, but I've not used a C debugger
Hmm, on a hunch I just discovered that somehow the call to mhstore
in mime-add-hook's for loop is the trigger... of course that's the
raison d'etre of the script :-/
Hopefully it's not too hard to follow:
#!/bin/sh
VERSION=0.05
#Diagnostic messages
DEBUG=0
#Backup message suffix
BAK=`mhparam mimehook-bak`
SLOCAL=`mhparam mimehook-slocal`
[ $DEBUG = 1 ] && echo -n "Processing message $1";
if grep -q -E '^MIME' $1 ; then
[ $DEBUG = 1 ] && echo " ...is MIME"
SRCDIR=`dirname $1`
MSG=`basename $1`
#Don't clobber main context
if [ -n $SLOCAL ]; then
export MHCONTEXT=`$SLOCAL`
[ $DEBUG = 1 ] && echo "slocal context $MHCONTEXT"
folder -fast +$SRCDIR >/dev/null
fi
for PART in `mhstore $MSG 2>&1 | awk 'match($0,/as file .+/){print
substr($0,RSTART+8,RLENGTH)}'`; do
[ $DEBUG = 1 ] && echo "Processing part $PART";
#Tweak -auto name to match message number
PARTDIR=`dirname $PART`
PARTFILE=`basename $PART`
if `echo $PARTFILE | awk "/^$MSG\./ { exit 1 }"` ; then
NEWPART="$PARTDIR/$MSG.$PARTFILE"
[ $DEBUG = 1 ] && echo "Renaming -auto part $PART to $NEWPART";
mv $PART $NEWPART
PART=$NEWPART
fi
mv -i $PART $SRCDIR
done
#DEFANG plain text
if [ ! -e "$1.$BAK" ]; then
[ $DEBUG = 1 ] && echo "Defanging MIME with mhfixmsg: backup in
$1.$BAK";
cp -i $1 $1.$BAK
mhfixmsg $1
fi
#Remark as unread
UNSEEN=`mhparam Unseen-Sequence`
if [ -n $UNSEEN ]; then
mark $MSG -nozero -add -seq $UNSEEN
fi
else
[ $DEBUG = 1 ] && echo " ...is NOT MIME"
fi
- [Nmh-workers] problem with mark zeroing out sequences, belg4mit, 2014/02/25
- Re: [Nmh-workers] problem with mark zeroing out sequences, David Levine, 2014/02/25
- Re: [Nmh-workers] problem with mark zeroing out sequences, David Levine, 2014/02/25
- Re: [Nmh-workers] problem with mark zeroing out sequences,
Jerrad Pierce <=
- Re: [Nmh-workers] problem with mark zeroing out sequences, Ken Hornstein, 2014/02/26
- Re: [Nmh-workers] problem with mark zeroing out sequences, Jerrad Pierce, 2014/02/26
- Re: [Nmh-workers] problem with mark zeroing out sequences, Ralph Corderoy, 2014/02/26
- Re: [Nmh-workers] problem with mark zeroing out sequences, Ken Hornstein, 2014/02/26
- Re: [Nmh-workers] problem with mark zeroing out sequences, Jon Steinhart, 2014/02/26
- Re: [Nmh-workers] problem with mark zeroing out sequences, Jerrad Pierce, 2014/02/26
- Re: [Nmh-workers] problem with mark zeroing out sequences, Jon Steinhart, 2014/02/26
- Re: [Nmh-workers] problem with mark zeroing out sequences, Ken Hornstein, 2014/02/26
- Re: [Nmh-workers] problem with mark zeroing out sequences, Jerrad Pierce, 2014/02/26
- Re: [Nmh-workers] problem with mark zeroing out sequences, Ken Hornstein, 2014/02/26