Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!rpi!batcomputer!theory.tn.cornell.edu!swb From: swb@chumley.tn.cornell.edu (Scott Brim) Newsgroups: comp.mail.mh Subject: Re: FAQ and convertion from unix-mail to mh Message-ID: Date: 15 Nov 90 04:28:42 GMT References: Sender: news@batcomputer.tn.cornell.edu Organization: People of the Green Silences Lines: 63 In-Reply-To: felix@ai.sri.com's message of 14 Nov 90 18:28:03 GMT Nntp-Posting-Host: chumley.tn.cornell.edu In article felix@ai.sri.com (Francois Felix INGRAND) writes: Before I do anything foolish, I was wondering how difficult it is to convert my 50 unix-mail folders to MH format... and how difficult it would be to convert them back (in case I decide MH is not for me). It's easy. Assume your vanilla mail directory is ~/mail, and you're running csh. First, from mail to MH: foreach src (`/bin/ls ~/mail`) inc +$src -file ~/mail/$src end Original mail files will be left there (if you're configured in MH normally). To get back, well, here's a csh script you can use to get everything back except the dates. You could probably even get those back in most cases, but I never did the work to get them back in *all* cases. The script could probably use some other polishing too, but you know how it is. #!/bin/csh -f # For each mhfolder, take the corresponding mailfolder and inc it # into MH, then take the MH folder and cat it into the (massaged) mail # folder. Be sure the ultimate mail folder doesn't have # slashes in the name. echo "learning folders ..." foreach mh ( `folders -fast` ) set ml = `echo "$mh" | tr / .` echo $mh '=>' $ml ... snatching old mail ... echo -n " " inc -file ~/mail/$ml +$mh cat < /dev/null > ~/mail/$ml set attop = 1 echo $mh '=>' $ml ... moving mail ... echo -n " " set msgs = `pick +$mh all` if ($status != 0) then echo " ...forget it" /bin/rm -f ~/mail/$ml continue endif foreach msg ($msgs) echo -n "$msg " if ($attop != 1) then echo "" >> ~/mail/$ml echo "" >> ~/mail/$ml endif set attop = 0 echo "From swb@fake.tn.cornell.edu Fri Jan 1 12:00:00 1980" >> ~/mail/$ml cat ~/Mail/$mh/$msg >> ~/mail/$ml end echo "" >> ~/mail/$ml echo "" end