Path: utzoo!attcan!uunet!mcsun!ukc!axion!vision!chris From: chris@vision.UUCP (Chris Davies) Newsgroups: comp.mail.elm Subject: Re: filter(1) disables biff (was "bell on new mail") Keywords: filter, biff, inetd, comsat, deliver Message-ID: <1295@vision.UUCP> Date: 22 Oct 90 14:10:04 GMT References: <1990Oct15.175056.19427@dg-rtp.dg.com> <107204@convex.convex.com> <1990Oct16.160303.19442@DSI.COM> Reply-To: chris@vision.UUCP (Chris Davies) Organization: VisionWare Ltd., Leeds, UK Lines: 78 In article <1990Oct16.160303.19442@DSI.COM> piziali@convex.com (Andy Piziali) writes: > Syd, is there an easy fix to filter(1) we could install? And Syd replies: > Nope. Nor would there be. We use Chip's "deliver" program with a system-wide script which notifies users of new mail (provided the x bit is set on the tty - as per biff). While I'm not going to post the sources to deliver (available at many archive servers, I presume), I will post our deliver.sys script... I don't see why you couldn't use this in cojunction with filter(1) to do the required munging etc. Just a quick note, there is a line with grep "^$USER[ ]"; the whitespace is one space and one tab. Don't miss this! Chris --cut--here-- : '/bin/sh' # Mail delivery shell script for local mail. # # This is executed as root at delivery-time (see deliver(8L) for details) ARGS=$@ NULL=/dev/null DATE=`date '+%d-%h-%y (%T)'` WHOFIL=/tmp/delwho.$$ LOGFIL=/usr/local/lib/deliver/deliver.log trap 'S=$?; rm -f $WHOFIL; exit $S' 1 2 15 for USER in $ARGS do # # Notify the recipient (if they've got mailchecking enabled). # if who | grep "^$USER[ ]" > $WHOFIL 2> $NULL then # # User is logged on # FROM=`grep '^From:' "$HEADER" | cut -c7-` 2> $NULL if [ -z "$FROM" ] then FROM="someone" fi while read D1 TTY D2 do TTYDEV="/dev/$TTY" # Can't use test(1) since we're root, and we've got all r/w/x permissions! if [ "`/bin/ls -l $TTYDEV | cut -c3-4`" = "wx" ] then echo "\r\nYou have new mail on $HOSTNAME from $FROM\07\r\n" > $TTYDEV 2> $NULL fi done < $WHOFIL fi # # This ensures "deliver" actually delivers the mail. If you remove # this line, no mail will be delivered! # echo "$USER" done rm -f $WHOFIL exit 0 --and--here-- -- VISIONWARE LTD | UK: chris@vision.uucp JANET: chris%vision.uucp@ukc 57 Cardigan Lane | US: chris@vware.mn.org BANGNET: ...!ukc!vision!chris LEEDS LS4 2LE, England | VOICE: +44 532 788858 FAX: +44 532 304676 -------------- "VisionWare: The home of DOS/UNIX/X integration" --------------