SUMMARY: How does one notify (biff) users on clients when new mail arrives?

From: Wayne Little (rwl@ee.umr.edu)
Date: Fri Feb 15 1991 - 13:03:44 CST


Here is the summary to my recent posting about how to get biff notification
to users on clients that NFS mount a central mail spool.

The original question was:
> We have a central mail spool which is nfs mounted by all our workstations.
> It works fine except that notification of new mail does not get to the
> users on the clients - i.e. setting biff to "y" is an exercise in futility
> on the clients.
>
> Since our mail addresses are centralized, the client machine is not part
> of the e-mail address and comsat (the biff server) looks for user@mailbox-
> offset. The comsat(8c) man page does say its looking in the utmp file to
> see if the users are logged in, so of course people logged in on another
> machine won't be found.
>
> Has anyone using a central mail spool hacked biff or otherwise come
> up with a way to notify users on clients when new mail has arrived?

I'll give the outline & credits first and then provide some more details
that may be helpful, and comments you may find humorous (at least I did :-).

The undedited replies including the sources that were sent are available via
anonymous ftp from franklin.ee.umr.edu [131.151.4.11] in catenated mail format
~ftp/pub/biff.over.nfs [58010 bytes] or a compressed version biff.over.nfs.Z
[This summary is prepended to the undedited replies in these files.]

1. Nix biff & use the csh variable "mail" (It works I tried it :-) )
        From: Dikran Kassabian <deke@ee.rochester.edu>
        From: wallen@cogsci.UCSD.EDU (Mark R. Wallen)
        From: lrj@helios.TN.CORNELL.EDU (Lewis R. Jansen)
        From: bisc@zellweger.ch (Thomas K. Bischoff)
        From: manager@duttnph.tudelft.nl (Wouter Smaal)

2. It is *not* a problem using mailtool under sunview or OpenWindows
        From: bo@eng.clemson.edu (Bo Slaughter)
        From: bisc@zellweger.ch (Thomas K. Bischoff)

3. Use xbiff (the following do & are happy campers)
        From: lrj@helios.TN.CORNELL.EDU (Lewis R. Jansen) & #1
        From: cws@math.ufl.edu (Christopher Stark) & #2
        From: yih%atom@cs.utah.edu (Benny Yih)
        From: MACPHEDRAN@sask.usask.ca (Ian MacPhedran)
        From: knutson%SW.MCC.COM@MCC.COM (Jim Knutson)

4. Use a homegrown comsat/biff replacement (anonymous ftp & other details below)
        Various versions referred to or supplied by:
        From: dank@moc.Jpl.Nasa.Gov (Dan Kegel)
        From: moran@ai.sri.com (Doug Moran)
        From: fabrice@sj.ATE.SLB.COM (Fabrice Le Metayer)
        From: Roger Burroughes <roger@cogsci.edinburgh.ac.uk>
        From: John A. Murphy <jam@philabs.Philips.Com>

5. Use the Zephyr notification system from MIT's Project Athena
        From: jon@MIT.EDU (Jon A. Rochlis)
        One thing you might want to look at is the Zephyr notification system
        from MIT Project Athena. (Start with pub/zephyr/doc/usenix.ps via
        anonymous ftp from athena-dist.mit.edu.) While Zephyr is overkill for
        simple email notification, we have found that there are a lot more
        things that need a notification service. The source code is also
        available from athena-dist.mit.edu...

6. Per user program to check mail spool
        From: "Fuat C. Baran" <fuat@cunixf.cc.columbia.edu>
        anonymous ftp: cunixf.cc.columbia.edu[128.59.40.130]:~ftp/pub/mw.tar.Z

7. Remove the line in .login that says: setenv MAIL ~/mail/inbox
   (This cleared up the problem for Sharon - they're using mailtool)
        From: squinter@pdn.paradyne.com (Sharon Quintero(813)530-2729)

8. Solution for MH users
        From: Scott Brim <swb@chumley.TN.Cornell.EDU>

        Wayne, if you're using MH, you can do things with slocal and
        .maildelivery so that you get a one-line notification on any machine.
        That's how we run our SLCs here. The mail is delivered to the spool on
        the server, and those who want to be beeped have an entry like "rsh
        <slc> rcvtty -biff" in your .maildelivery file. This is all MHish, but
        it works well.
--------------------------
*** Additional DETAILS ***
--------------------------
1. Nix biff & use the csh variable "mail"
From: Dikran Kassabian <deke@ee.rochester.edu>
We hate biff (HEY DO0DZ!)

Set the csh variable "mail"

This format, in a user's .cshrc, will notify the user when new mail has
arrived with a "You have new mail" message.

        set mail = (360 /usr/spool/mail/$user)

Its better than biff since it doesn't blather all over the screen, but
instead, notifies before printing the next csh prompt. The 360 is the
number of seconds before checking again (frequency).

From: wallen@cogsci.UCSD.EDU (Mark R. Wallen)
.. same solution explained ...
I *personally* find that less obnoxious that biff, but then I mostly read my
mail on a macintosh anyway :-)

----
2. It is *not* a problem using mailtool under sunview or OpenWindows
From: bisc@zellweger.ch (Thomas K. Bischoff)

Both mailtools (sunview and openwindows) do notify the user when new mail arrives by raising the flag and/or beeping.

---- 3. Use xbiff From: MACPHEDRAN@sask.usask.ca (Ian MacPhedran)

You could do what xbiff (from the X11 windowing system) does - run a background job that monitors the size of your system mailbox file. You could probably strip it down to a non X11 program fairly quickly.

It can be obtained from expo.lcs.mit.edu if you don't have X11 source.

--- 4. Use a homegrown comsat/biff replacement

From: fabrice@sj.ATE.SLB.COM (Fabrice Le Metayer)

There is a version of 'biff' writen by Mark Moraes, CSRI, University of Toronto, which will do exactly what you want. We have been running it here for several months and it works fine, except that I had to change it so it would close /var/spool/mail/<user>, or the process would eventually come up with "Too many files open". NB: I asked Fabrice about availability, and he's sending me a shar file with his mods for inclusion in the unedited-replies "with no guarantee.""

From: dank@moc.Jpl.Nasa.Gov (Dan Kegel)

Try running this on the mail server instead of comsat. We've used it here for a while.

/* ** Homebrew comsat replacement (rcomsat). ** ** Replaces comsat on a central mail server whose clients all remote ** mount /usr/spool/mail. ** In addition to notifying users by writing to their terminals on the server, ** it notifies them by writing to the bona-fide comsat daemon ** on every machine on the network. ** ** Change the path in "/etc/servers" (or "/etc/inetd.conf") to point ** to this, rather than the system comsat... */

NB: I tweaked Dan about availability, and they aren't on the internet, and the "origins are lost in the depths of time"... You can get it via with the unedited replies as noted at the top.

From: moran@ai.sri.com (Doug Moran)

Below is a program I wrote/modified to send notifications from the mailhost to the clients. ============================================================================== /* * in.comsat_broadcast * * Copyright Douglas B. Moran 1989. Permission to redistribute provided that * this comment remains intact. * * Douglas B. Moran, Artificial Intelligence Center, * SRI International, Internet: moran@ai.sri.com * Date Written: 8 February 1989 * * See also similar program by Richard Tobin, * Internet: richard%aiai.edinburgh.ac.uk@nss.cs.ucl.ac.uk * * Problem - mail is received by the primary server, but users are typically * not logged in to this server and would like to be notified (via biff) on * the host(s) where they are logged in. * * Solution - Have inetd run this program instead of comsat when it gets * a datagram on 512/udp. It will broadcast the datagram to some other port * on all relevant machines. Then have the real comsat listen on that port. *

NB: I tweaked him on availability, and he said...

I have submitted it to Sun-Spots-Digest for inclusion in the archive.

In doing so, I added a caveat that you might want to include in your summary: Unresolved problem as of SunOS 4.0.3: because the caching of NFS attributes of the mail file on the clients, the BIFF notification on the client may not get the updated mail file (with the new message) and thus the notification printed will simply be "New mail for USER@HOST has arrived:" -- Doug Moran

NB: The next 2 talk about a program by Steven Grimm. I tried to contact him via e-mail, but no answer yet. I just sent another letter and asked him to post availability info. to our sun-nets newsgroup.

From: John A. Murphy <jam@philabs.Philips.Com>

Here's the README from a set of programs written by steve grimm. While this worked, it still had some bugs. I sent him mail and he said we had a newer version that he was about to release. I haven't heard about it yet. < NB: same README/program that Roger sent just below>

From: Roger Burroughes <roger@cogsci.edinburgh.ac.uk>

I had this problem a while back, and was sent a version of comsat/biff that solves the problem - supplied by Steven Grimm <koreth@com.sun.ebay>, and has worked well. You may wish to contact him direct, or I can send you the necessary files. The README file is included below.

| This is a replacement for the standard BSD "biff" and "comsat" | programs, which notify users when new mail arrives. The old programs | were very limited; they would only notify a user if mail arrived in his | mailbox on the local host. This version allows monitoring of other | users' mailboxes, even on remote hosts. | | To install the programs, become root and do a make install. That | will install the manual pages, /usr/ucb/biff, and /usr/etc/comsat. | You will need to edit /etc/services and /etc/servers (or /etc/inetd.conf, | on some systems). Add a TCP biff service to /etc/services: | | rbiff 522/tcp | | and in servers or inetd.conf, comment out the line that causes | inetd to run comsat. In /etc/servers it looks like | | comsat udp /usr/etc/in.comsat | | and in inetd.conf, | | comsat dgram udp wait root /usr/etc/in.comsat in.comsat | | Add an entry to /etc/rc.local so that comsat starts at boot time: | | if [ -f /usr/etc/comsat ]; then | /usr/etc/comsat; (echo -n ' comsat') >/dev/console | fi | | You can remove /usr/etc/in.comsat if desired; it will no longer be | called. Restart inetd (on some systems, sending it a HUP signal will | cause it to reload its database) and run /usr/etc/comsat. You're | all set! | | If you're installing this on your system, drop me a line. I'm interested | to know how widely this catches on. I'm not opposed to replacing biff | with this for the next version of BSD (or SunOS), but I'd like to be | told about it first. Send me any suggestions or bug reports, too. | Enjoy! | | --- | These are my opinions, which you can probably ignore if you want to. | Steven Grimm Moderator, comp.{sources,binaries}.atari.st | koreth@ebay.sun.com sun!ebay!koreth |

------- 6. Per user program to check mail spool

From: "Fuat C. Baran" <fuat@cunixf.cc.columbia.edu>

Don't know about a biff hack, but if you don't mind spending one process per user who wants mail notification, I have a program called mw (mail watch) that runs in the background and periodically polls a mail spool file. When it notices new mail it display a one line header summary to the user's tty. I put this in my .profile... Available via anonymous ftp at: cunixf.cc.columbia.edu[128.59.40.130]:~ftp/pub/mw.tar.Z

That's all folks... Thanks to all the responders (credits inline above),

-- Wayne Little Internet: rwl@ee.umr.edu Phone: (314) 341-4546 USPS: Univ. of Missouri-Rolla, EE Dept., Rolla, MO 65401

"I have read in Plato and Cicero sayings that are very wise and very beautiful; but I never read in either of them: "Come unto me all ye that labour and are heavy laden." St. Augustine



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:06:10 CDT