Path: utzoo!mnetor!uunet!husc6!bbn!bbn.com!rsalz From: rsalz@bbn.com (Rich Salz) Newsgroups: comp.mail.mh Subject: Re: Migrating MH folders to elm mailboxes ? Message-ID: <294@fig.bbn.com> Date: 13 Jan 88 02:05:39 GMT References: <19836@amdcad.AMD.COM> <1599.568513624@hplpm> <2198@tekcrl.TEK.COM> Organization: BBN Laboratories Incorporated, Cambridge MA Lines: 37 Summary: This script seems the best way, so far. I've just had occasion to transfer my mail archives from MH6.5 running on Ultrix2.0 over to MailTool running on SunOS3.4. This is the script I used on the Sun. It worked OK -- I (unfortunately :-) didn't seem to lose any of my mail archives. /r$ #! /bin/sh ## MHtoMT. MH to UnixMail conversion. Example: ## MHtoUM personal ## Reads all messages in MH directory ./personal, and creates the ## Unix Mail folder ~/F/personal. ## Assumes everything else has been cleaned out but MH folders. X="`date | sed -e 's/^... //'`" F=$HOME/F cd $HOME/Mail for D in ${1-*} ; do if [ ! -d ${D} ] ; then echo Skipping ${D} -- not a directory continue fi cd ${D} for I in `ls | grep -v '[^0-9]' | sort -n` ; do T=`grep '^Date:' <${I} | head -1` Z=`echo $T | sed -e 's/Date:[^,]*, //' -e 's/Date: //'` # echo $I Date is @"$Z"@ >&2 if [ -z "${Z}" ] ; then Z="${X}" fi echo "" grep -v '^Replied:' <$I | \ sed -e "/Return-Path:/s=\$= ${Z}=" -e "/Return-Path:/s//From /" done >${F}/${D} cd .. done -- For comp.sources.unix stuff, mail to sources@uunet.uu.net.