Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!ut-sally!ut-ngp!infotel!pollux!ndmce!tp From: tp@ndmce.uucp (Terry Poot) Newsgroups: comp.mail.headers Subject: Re: I hate smail Message-ID: <1128@ndmce.uucp> Date: Sat, 10-Jan-87 06:54:51 EST Article-I.D.: ndmce.1128 Posted: Sat Jan 10 06:54:51 1987 Date-Received: Sat, 10-Jan-87 23:47:28 EST References: <14227@amdcad.UUCP> <532@rayssd.RAY.COM> <1286@ncc.UUCP> Reply-To: tp@ndmce.UUCP (Terry Poot) Organization: Nathan D. Maier Consulting Engineers, Dallas Lines: 108 In article <1286@ncc.UUCP> lyndon@ncc.UUCP (Lyndon Nerenberg) writes: >OK - here's one: > > It would be nice if smail could handle aliases. > Here is a quick fix, if you can configure it for your system. I set my mailers up to call the following shell script rather than smail. It does aliasing and then passes the new address list to smail. It doesn't nest aliases, and it treats them as case insensitive. The alias file is named /usr/lib/uucp/Aliases and has the following format: alias:address Where of course is a real tab. An alias is a list of one or more addresses, where an address is either something you can pass to smail, or a '|' followed by a program invocation. In the latter case, there is one caveat, no spaces are allowed. However any '#' characters will be translated to spaces before the command is executed. Program invocations and mail addresses can be mixed. I set mailx to use this directly, and set the binmail program that comes with smail to call it rather than smail. I also am lucky enough to be able to change the PATH that uuxqt uses, so I but this in my local bin directory and call it rmail, and I get alias handling on incoming mail as well. It has been working here for a month or so at least. This is just a quick hack, and if anyone makes any improvements, please send them back to me. ---------------- cut here, and watch the .signature --------------- : Mail aliasing script. Please send any comments or improvements to: : Terry Poot, Nathan D. Maier Consulting Engineers, (214)739-4741 : 8800 N. Central Expressway, Suite 300, Dallas, Tx 75231, USA : UUCP: { seismo | cbosgd | ihnp4 | sun!convex | allegra!convex }!ndmce!tp : ARPA: ndmce!tp@seismo.css.gov CSNET: ndmce!tp@smu : UUCP Domain based: tp@ndmce.com dest="" list="" plist="" STDIN="" Aliases=/usr/lib/uucp/Aliases for name in $* do if grep -i \^${name}: $Aliases >/dev/null then dest="`grep -i \^${name}: $Aliases|cut -f2-` $dest" else dest="$name $dest" fi done for name in $dest do case $name in \|*) : plist="$name $plist" ;; *) : list="$name $list" ;; esac done if [ "$plist" ] then STDIN="< /tmp/rmail$$" cat >/tmp/rmail$$ for name in $plist do cmd=`echo $name|cut -c2-|tr '#' ' '` eval $cmd $STDIN done fi if [ "$list" ] then exec /l/bin/smail $list $STDIN fi if [ "$STDIN" ] then rm -f /tmp/rmail$$ fi ---------------- cut here --------------------- Here are a few pieces from my alias file, by way of example. The TP alias allows me to get mail to tp, TP, Tp, or tP, as this is case insensitive. As there is no nesting, this doesn't cause a loop. As you see EVERYTHING coming in gets aliased, so this script has been used a lot, and is stable. I've tested the program forwarding, though I don't have any real examples. The one below is concocted for illustrative purposes. ---------------- cut here --------------------- Poot: tp postmaster: tp root: tp Terry.F.Poot: tp Terry.Poot: tp Terry: tp TP: tp TP14: tp usenet: tp uuadm: tp uucp: tp prog: |/l/bin/prog#arg1#arg2#arg3 ------------- cut here ------------------- -- Terry Poot, Nathan D. Maier Consulting Engineers, (214)739-4741 8800 N. Central Expressway, Suite 300, Dallas, Tx 75231, USA UUCP: { seismo | cbosgd | ihnp4 | sun!convex | allegra!convex }!ndmce!tp ARPA: ndmce!tp@seismo.css.gov CSNET: ndmce!tp@smu