Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!ux1.cso.uiuc.edu!deimos.cis.ksu.edu!mccall!tp From: tp@mccall.uucp Newsgroups: comp.mail.uucp Subject: Re: Smail, Aliases & Programs Summary: Use a shell script Message-ID: <1549.254492d7@mccall.uucp> Date: 24 Oct 89 16:50:31 GMT References: <590@piglet.vision.UUCP> Organization: The McCall Pattern Co., Manhattan, KS, USA Lines: 22 > What I need (!!), before we start running smail instead of a brain-damaged and > hacked-around version of uumail, is a version of smail for Unix System V.3 > which *will* allow me to create aliases of the form > > info-server | /some/program/or/other I've been on VMS for several years now, so I no longer have it lying around, but what I did (using an earlier version of smail that didn't have aliases at all) was rather than renaming smail to rmail and handing it the mail directly, I wrote a shell script named rmail. It looked at its parameter and checked it against an alias list. If it was found, it would look to see if the first character of the alias was a pipe, and if so, exec the appropriate program (remember the mail message itself is on stdin, so execing the program would pass the message in to stdin of that program). I also had it handling simple aliases and lists of aliases. If the alias matched, but was not a pipe, it simply invoked smail with the alias names, rather than the argument received. Finally, if the address is not an alias, it simply exec'ed smail. -- Terry Poot (800)255-2762, in Kansas (913)776-3683 The McCall Pattern Company, 615 McCall Rd., Manhattan, KS 66502, USA UUCP: rutgers!ksuvax1!mccall!tp Internet: tp%mccall@ksuvax1.cis.ksu.edu