Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!nuchat!sugar!ficc!peter From: peter@ficc.ferranti.com (Peter da Silva) Newsgroups: comp.mail.uucp Subject: Re: Using SMTP and smail Message-ID: Date: 24 Sep 90 16:55:22 GMT References: <1808@utoday.UUCP> <1588@chinacat.Unicom.COM> Reply-To: peter@ficc.ferranti.com (Peter da Silva) Organization: Xenix Support, FICC Lines: 69 In article <1588@chinacat.Unicom.COM> chip@chinacat.Unicom.COM (Chip Rosenthal) writes: > The problem is that smail 2.5 does not have any delivery support - it > needs to pass of the message to another program to perform the actual > delivery. I guess a second problem is that smail 2.5 makes the naive > assumption that there are only two delivery channels: uucp and local. The best solution to this problem is to tell smail that the uucp delivery agent is some program you specify (I stick mine in /usr/lib/smail/router), and have it figure out the actual juju to do the real delivery. /* ** Defs.h: header file for rmail/smail. ... */ #define ROUTER "/usr/lib/smail/router" /* Command to route !oid mail */ #define DELIVER "/usr/lib/smail/deliver" /* Command to deliver local mail */ ... #define RMAIL(flags,from,sys) "%s %s %s %s",ROUTER,flags,from,sys /* */ #define RARG(user) " '%s'",user Router itself can be a simple shell script or a quicky C program. I have it read /usr/lib/smail/routes to get the name of the program to use for actual delivery. I default to UUCP, and I've set up several "pseudo" sites, such as the following script that send to all members of a group: #!/bin/sh # # Arguments passed in the environment: FLAGS, FROM, SYS, USERS REAL_USERS= BAD_GROUPS= G_FMT="group:passwd:gid:users" G=/etc/group for USER in $USERS do _USERS="`carve $G_FMT group==$USER users -f $G | sed 's/,/ /g'`" if [ ! "$_USERS" ] then BAD_GROUPS="$BAD_GROUPS $USER" else REAL_USERS="$REAL_USERS $_USERS" fi done if [ ! "$REAL_USERS" ] then { echo "Your mail to $USERS was not sent. No valid groups were found." echo "" echo "Contents of bounced mail:" echo "==========" cat } | mail -s "No such group(s): $BAD_GROUPS" $FROM exit 0 fi if [ "$BAD_GROUPS" ] then { echo "Your mail to $USERS did not get to all the listed groups" } | mail -s "No such group(s): $BAD_GROUPS" $FROM fi smail -F $FROM $REAL_USERS -- Peter da Silva. `-_-' +1 713 274 5180. 'U` peter@ferranti.com