>Is there any way to keep old and new messages together? [after list
>name change] What should I do?
Write a new function,
rebuild --migrate <orig> <dst>
which adds an X-Mailing-List: <dst> header to each MH file
in the <src> folder (if it doesn't already exist), then calls
rebuild --reprocess <src>
Send me a patch to the script below as a unified diff, I'll test it,
then run it on your list. You are welcome to look at bounce.pl
(see mail-archive.com's FAQ on imports) for hints.
Jeff
====================
#!/bin/sh
############################################################
# Experimental manual cleanup tool.
# Time-stamp: <Thu 04/27/2000 13:54:29>
############################################################
MAIL=xxINSTxx/Mail
TMPFOLDER=rebuild.$$
MAILME=xxBINxx/mailme
ARCHIVE=xxARCHIVExx
VAULT=xxINSTxx/vault
MHPATH=xxMHPATHxx
CONF=xxCONFxx
PATH=${PATH}:${MHPATH}
REFILE="refile -unlink"
usage() {
echo "usage: $0 { option }"
echo "Manually manipulate mail archives."
echo
echo " --nuke <list> destroy forever and ever"
echo " --melt <list> pour original data back into inbox"
echo " --monthlify <list> switch to monthly indexing mode"
echo " --localize <lang> <list> switch to a language localization"
echo " --reprocess <list> reprocess list archive (not threadsafe)"
echo " --fossilize <list> compress an inactive list"
echo " --all reprocess all archives (may take days)"
echo
echo " --showdupes show lists with duplicated usernames"
echo " --showactive <days> show lists updated in last n days"
echo " --showinactive <days> show lists not updated in last n days"
echo
}
fossilize () {
cd $MAIL
TAR=FOSSILIZED-$1.tar.bz2
ESCAPED_NAME=`echo $1 | tr @ _ | tr . _`
WORDLIST=$VAULT/$ESCAPED_NAME/db.wordlist.work
if [ -f $WORDLIST ]
then
rm $WORDLIST
fi
if [ -f $1/FOSSIL* ]
then
echo "$1 is already fossilized"
return
fi
tar cIf $TAR $1
if [ $? = 0 ]
then
mv $1 $1.bak
mkdir $1
mv $TAR $1
rm -rf $1.bak
fi
}
melt () {
VICTIM=$1
BENEFACTOR=$2
ESCAPED_NAME=`echo $VICTIM | tr @ _ | tr . _`
echo "Obliterating $VICTIM (for rebuild)"
rm -rf $ARCHIVE/$VICTIM
rm -rf $VAULT/$ESCAPED_NAME/db*
if [ "$3" = "caution be damned!" ]
then
mv $MAIL/$VICTIM $MAIL/$BENEFACTOR
else
folder -create +$BENEFACTOR
$REFILE -src +$VICTIM `pick +$VICTIM` +$BENEFACTOR
rm -f $MAIL/$VICTIM/.mh_sequences
rmdir $MAIL/$VICTIM
fi
}
reprocess () {
PEN=refiling-pen.$$
melt $1 $PEN "caution be damned!"
RP_COUNT=`ls $MAIL/$PEN | grep [0-9] | grep -v ',' | wc -l`
while [ $RP_COUNT != 0 ]
do
echo "$RP_COUNT messages to reprocess."
$MAILME -src $PEN
RP_COUNT=`ls $MAIL/$PEN | grep [0-9] | grep -v ',' | wc -l`
done
rm -rf $MAIL/$PEN
}
reprocess_all () {
cd $MAIL
for i in *@* ; do
reprocess $i
done
}
nuke () {
[ ! "$1" ] && return
ESCAPED_NAME=`echo $1 tr @ _ | tr . _`
echo -n $"Nuking $1..."
rm -rf $MAIL/$1
rm -rf $VAULT/$ESCAPED_NAME/db*
rm -rf $ARCHIVE/$1
echo "done."
}
monthlify() {
ESCAPED_NAME=`echo $1 | tr @ _ | tr . _`
echo -n $"Monthlifying $1..."
mkdir -p $VAULT/$ESCAPED_NAME
touch $VAULT/$ESCAPED_NAME/monthly
if [ -f $ARCHIVE/$1/.mhonarc.db ]
then
mv $ARCHIVE/$1 $ARCHIVE/$1.bak
mkdir -p $ARCHIVE/$1
mv $ARCHIVE/$1.bak $ARCHIVE/$1/older
fi
if [ -f $MAIL/$1/1 ]
then
mv $MAIL/$1 $MAIL/$1.bak
mkdir -p $MAIL/$1
mv $MAIL/$1.bak $MAIL/$1/older
fi
echo "done."
}
localize() {
ESCAPED_NAME=`echo $2 | tr @ _ | tr . _`
ln -fs $CONF/rcfile.$1 $VAULT/$ESCAPED_NAME/rcfile
}
showdupes() {
cd $MAIL
A=`ls | grep @ | cut -f1 -d@ | uniq -d | sed -e 's/\$/@/g' -e 's/^/^/g'`
ls | grep @ | grep -e "$A"
}
showactive() {
showactive_aux $1 "<="
}
showinactive() {
showactive_aux $1 ">="
}
showactive_aux() {
DAYS=$1
cd $ARCHIVE
for i in `ls | grep ^[a-z].*@.*$`
do
if [ -f $i/.mhonarc.db ]
then
TIMESTAMP=`ls -l --full-time $i/.mhonarc.db|cut -c 43-67`
THEN=`echo $TIMESTAMP | sed 's/.*/"&"/' | xargs -n 1 date +%s -d`
NOW=`date +%s`
if [ $(( ($NOW-$THEN) $2 ($DAYS * 86400) )) = 1 ]
then
echo $i
fi
fi
done
}
# Handle command line arguments
if [ "$1" = "--reprocess" -a -d $MAIL/$2 -a "$2" ]
then
reprocess $2
elif [ "$1" = "--melt" -a -d $MAIL/$2 -a "$2" ]
then
melt $2 inbox
elif [ "$1" = "--nuke" -a -d $MAIL/$2 -a "$2" ]
then
nuke $2
elif [ "$1" = "--fossilize" -a -d $MAIL/$2 -a "$2" ]
then
fossilize $2
elif [ "$1" = "--monthlify" -a -d $MAIL/$2 -a "$2" ]
then
monthlify $2
elif [ "$1" = "--showdupes" ]
then
showdupes
elif [ "$1" = "--localize" -a -d $MAIL/$3 -a "$3" -a -f $CONF/rcfile.$2 ]
then
localize $2 $3
elif [ "$1" = "--showactive" -a "$2" ]
then
showactive $2
elif [ "$1" = "--showinactive" -a "$2" ]
then
showinactive $2
elif [ "$1" = "--all" ]
then
reprocess_all
else
usage
fi
_______________________________________________
Gossip mailing list
[EMAIL PROTECTED]
http://jab.org/cgi-bin/mailman/listinfo/gossip