#! /bin/ksh # # dohype --- run hypermail to make web archive of a mailing list # # from /home/eweb/botany/public_html/cp/list/dohype # # Run via cron on spot by poulton: #10 02 * * * cd /users/poulton/public_html/wind_talk ; ./dohype ; # cd /users/poulton/public_html/extweb/windsurf/3rdAve ; # ./dohype ; # 20 02 * * * cd /users/griffin/web ; ./dohype ; PATH=$PATH:/local/bin:/usr/local/bin export HM_SHOWHEADERS=0 export HM_DIRMODE=0755 export HM_FILEMODE=0644 case `/bin/pwd` in *wind_talk* ) name="Wind_Talk" mail=$name@opus.labs.agilent.com-DeleteThis.com info="http:../../windspeed.info" ;; *3rd* ) name="3rdAve" mail=$name@opus.labs.agilent.com-DeleteThis.com info="http:../../windspeed.info" ;; *griffin* ) name="Griffin" mail=griffin_list@jr.labs.agilent.com info="http://jr.labs.agilent.com/griffin/web/index1.html" ;; * ) echo "$0: not configured for this directory" 1>&2 exit 2 ;; esac for file in archive Archive_src/archive???? do echo case $file in archive ) year="" caption="$name Mailing List Archive" ;; *[?]* ) continue # pattern found no match ;; * ) year=`echo $file | sed -e 's/.*archive//' ` caption="$name Mailing List Archive for $year" ;; esac dir=archive$year.hyp if [ -d $dir ] ; then if [ $file -nt $dir ] ; then #nrm -r $dir true else echo "$dir is newer than $file; skipping" continue fi else mkdir -p $dir fi echo "converting mail file $file, output to directory $dir" cat $file | # Here we add a sed filter for a hypermail 1.02 bug. A too-long # Message-Id line gets the message subject into the filename field # and a message like: # hypermail: Couldn't chmod "RE: WS minivan for sale xx" to 666. #sed '/^Message-Id:/s/\(............................................................................\).*/\1/' | # Here we add a filter for an unexplained change in the From line format: #From rcattell@mail.com-xx Fri Oct 27 09:44:34 2000 #From poult@nker.labs.agilent.com-xx Fri, 27 Oct 2000 11:21:55 -0700 (PDT) # It turned out the comma was the only change needed. awk '/^From / && $6>1990 && $6<2050 && $7~":" { sub(",","",$3) #tmp=$4; $4=$5; $5=tmp; #tmp=$6; $6=$7; $7=tmp; $8=""; $9="" } /^/ {print}' >junk1 #hypermail -pix \ hypermail -p \ -l "$caption" \ -d $dir \ -n $mail \ -b "$info" \ -m junk1 find $dir -type d | xargs chmod 775 # bug in 2b29 version find $dir -type f | xargs chmod 664 # bug in 2b29 version touch $dir nrm junk1 # for x in author date index subject # do # cat ${file}d/$x.htm | # sed -e 's/About this archive/Back to CP Homepage/' > tmp.$$ # mv tmp.$$ ${file}d/$x.htm # done done 2>&1 | tee dohype.out | egrep -v '^ *$|converting|Loading|Writing|skipping|messages.$|Created attachment'