Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!ateng!chip From: chip@ateng.com (Chip Salzenberg) Newsgroups: comp.mail.uucp Subject: Re: Smail, Aliases & Programs Keywords: smail alias Message-ID: <25687B9B.29705@ateng.com> Date: 20 Nov 89 22:32:57 GMT References: <590@piglet.vision.UUCP> <974@becker.UUCP> <254733A5.10634@ateng.com> <13074@s.ms.uky.edu> <254CCBB1.19467@ateng.com> <1989Nov2.200712.163@twwells.com> <255344AF.10561@ateng.com> <1989Nov6.064722.15635@twwells.com> <2558A19B.26552@ateng.com> <1989Nov13.09 Organization: A T Engineering, Tampa, FL Lines: 77 According to bill@twwells.com (T. William Wells): >According to chip@ateng.com (Chip Salzenberg): >: case "$u" in >: news-*) >: group=`echo $u | sed -e 's/^news-//' -e 'y/-/./'` >: cat $HEADER $BODY | mailnews-gateway $group >: echo DROP ;; > >So, with this one, someone can mail to news-comp-mail-uucp and it >goes to this newsgroup? Yes. I'm using a variant of this script on ateng for the local "ate.*" hierarchy. Messages to "ate-*" or "ate.*" become local articles. I've not installed a general "news-*" alias because I don't want one yet. :-) >Neat. I doubt I could do that sort of thing with lmail unless I >were to add some kind of wildcarding or regular expressions. And I >think that that goes way beyond what I'd want to do. And besides, >there's already a solution. :-) I see your point... though shoehorning in Henry Spencer's regexp routines shouldn't be much of a trick. >What I'd like to have is, if the To: address in locally generated >mail does not contain an @ or !, to have my domain appended to >it. While I don't know Deliver well enough to construct the >script, I'm sure it can be done. No problem. Here's one specialized for a mailing list. If you want a more general one, let me know. case "$u" in mailing-list) TO=`header -f To $HEADER` case "${SENDER} ${TO}" in *[!@]*) echo "$u" ;; *) # Local mail to local address ( header -nvf To $HEADER echo "To: mailing-list@mydomain" echo "" cat $BODY ) | smail -t echo DROP ;; esac ;; *) echo "$u" ;; esac >But I think that this would best be done in smail rather than >Deliver or lmail since smail sees all mail, whereas lmail or >Deliver only sees it if it is a local address. Well, it should be done in Smail, yes. But it's eminently reasonable for a user of Smail 2.5 to have Deliver handle _all_ mail, local and remote. For UUCP addresses, Deliver will invoke uux, but you might want to do some fancy special-case routing first -- just the kind of thing Deliver is best at. >If a local address does not have forwarding set, I'd check for .deliver >and, if it is present, alias the user name to the Deliver command. Yes, that's what I meant. :-) >: try-mail: "root|/usr/bin/deliver @" >: bad-mail: "root/Badmail" > >More likely, what I'd do is to append the list of failed names to >the command, without any special interpolation character. Sounds reasonable to me. You may want to consider a try-mail that's not a pipe to be in error. If you really want it in a mailbox you should have used bad-mail instead. -- You may redistribute this article only to those who may freely do likewise. Chip Salzenberg at A T Engineering; or "Did I ever tell you the Jim Gladding story about the binoculars?"