Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!rutgers!usc!sdd.hp.com!zaphod.mps.ohio-state.edu!rpi!batcomputer!theory.tn.cornell.edu!jch From: jch@chumley.tn.cornell.edu (Jeffrey C Honig) Newsgroups: comp.mail.mh Subject: Re: Aliases and MhMail Message-ID: Date: 19 Dec 90 18:20:32 GMT References: <4712@umbc3.UMBC.EDU> Sender: news@batcomputer.tn.cornell.edu Organization: Cornell Theory Center; Cornell University; Ithaca, NY USA Lines: 52 In-Reply-To: jhon@dubhe.gsfc.nasa.gov's message of 18 Dec 90 23:58:17 GMT Nntp-Posting-Host: chumley.tn.cornell.edu > How can I use aliases with mhmail? > The only way I've found is: > mhmail `ali -normalize alias` To do this with one alias you could use: mhmail "`ali -normalize alias`" < file It is more difficult to do with several aliases. I wrote the following script to send a piece of test mail for debugging mailers that you could probably easily modify to do what you want. Jeff #! /bin/sh if [ $# -lt 1 ]; then echo "Usage: ${0} address [address] [address] ..." exit 1 fi line= ; send=1 ; for name do case ${name} in -cc|-from) line="${line} ${name}" ; ;; -test) send=0 ; ;; -*) echo "Invalid switch" ${name} ; exit 1 ; ;; *) line="${line} `/usr/local/lib/mh/ap -format '%<{error}%{error}: %{text}%|%(putstr(mbox{text}))%<(nohost{text})%|%(lit @)%(putstr(host{text}))%>%>' \"\`ali ${name}\`\"`" ; esac done if [ $send -eq 1 ]; then mhmail ${line} -subject "Test.`hostname`.$$" -body "Please ignore this test mail." else echo ${line} ; fi