Path: utzoo!attcan!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: <2561AFCE.2065@ateng.com> Date: 15 Nov 89 18:49:48 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: 82 According to bill@twwells.com (T. William Wells): >According to chip@ateng.com (Chip Salzenberg): >: o Do you want a mail to news gateway? >: >: In the system delivery file, notice addresses that look like newsgroups; >: hand those messages to the gateway program. (I did this.) > >This I can do easily enough. Just have aliases for the newsgroups >I want to gateway. Sure. That's easy enough. But what I meant by "notice" is to examine the address and see if it looks like _a_ newsgroup: for u do case "$u" in news-*) group=`echo $u | sed -e 's/^news-//' -e 'y/-/./'` cat $HEADER $BODY | mailnews-gateway $group echo DROP ;; *) echo "$u" ;; esac done As you can see, one routine handles _all_ newsgroups. >Actually, I've had a slightly different interest: munging >outgoing mail headers. An example: if I mail to a local mailing >list, the To: line does not get a domain name. Mm. Not too hard. In the system or post-user delivery file: for u do case "$u" in fake-mailing-list) ( header -nvf To $HEADER echo "To: real-mailing-list@mydomain" echo "" cat $BODY ) | smail -t echo DROP ;; *) echo "$u" ;; esac done With this trick in place, you send mail to the fake-mailing-list. Deliver then mangles your mail header and hands the mangled message over to Smail, which then delivers to real-mailing-list. >: Which is more valuable -- your computer's time, or yours? >The answer is "yes". :-) I knew we could agree about something. :-) >Hey, I just had a thought: there is little reason for me not to >add features that would permit easy integration of the two. I >could look for .deliver files in user's home directories and, if >found, run deliver for them instead of attempting normal delivery. I like this idea. Treat it as if the user's name were aliased: user: "user|/usr/bin/deliver user" In fact, I'd think the alias file reader might be the place to check for whether .deliver exists. >I have an alias bad-mail to which undeliverable mail is sent. >I could easily add an alias, say try-mail, which is similar to this, >except that, if mail to try-mail succeeds, no error code is returned. Hm. Neat. Of course, you must have some way to interpolate the (unknown) address into an alias. I'll assume it's the character "@". The typical lmail->deliver configuration might then be: try-mail: "root|/usr/bin/deliver @" bad-mail: "root/Badmail" -- You may redistribute this article only to those who may freely do likewise. Chip Salzenberg at A T Engineering; or