[net.sources] MH alias conversion script

jad@hpfcla.UUCP (jad) (08/13/85)

	For those of you who use MH, and are irritated by the fact that
	they chose to use a different format for their alias file than
	ucbMail uses (sigh), you might find this useful.  If your .mhrc
	file (default MH alias file on my systems) is of the format

;
;	Comment lines don't start out with multiple ;;;;;;'s !
;
one:	local_user
many:	user1, user2, ..., userN
remote:	<path1>, <path2>, ..., <pathN>

(<path> is any legal mail path)


	Then the following script will convert it into a legal .mailrc
	file.  I have a makefile in a sub-directory with target login
	that goes about and does things like this; if .mailrc is out of
	date with respect to .mhrc, it rebuilds it with the script.
	Note that ucbMail does not like lines that start out with '##',
	so your MH aliases can't start out with ';;' (in fact, you can
	not have anything after the first ';' I don't think).
	Note also that you will want to hard-code in your own options to
	ucbMail in the first echo statement ... unless you like mine.

	Anyway, hope this is of use to someone ... at least until MH.6
	comes out with the ability to parse .mailrc aliases	;-)

			      --      jad      --
			      John A. Dilley, FSD
			      Fort Collins,    CO

ARPA:			      terrapin@Purdue.EDU
UUCP:			      {ihnp4}! hpfcla!jad
PHONE:			      (303)226-3800 x4166

/* ----------          make_mailrc          ---------- */
#!/bin/sh
#
MHRC=$HOME/.mhrc
MAILRC=$HOME/.mailrc

if [ ! -f $MHRC ]
    then
	echo You do not have a .mhrc file.  $MAILRC not clobbered.
	exit 1
    else
	echo Creating $MAILRC from $MHRC ...
    fi

echo "set ask append dot metoo hold autoprint crt=24
# This file automatically generated from $MHRC
#	Created   `date`
" > $MAILRC

sed	-e 's/;/#/g'				\
	-e 's/[<>,:]//g'			\
	-e 's/^[a-zA-Z]/alias	&/'		\
	    < $MHRC >> $MAILRC
exit
/* ----------          make_mailrc          ---------- */