HAP(1)

NAME
hap - watch for the arrival of new mail

SYNOPSIS
hap [ -seconds ] [ -hVbskqvtmiA ] [ --long-option ... ] [ file [ ... file ]]

DESCRIPTION
hap starts a background process which periodically checks the contents of your system mailbox (or any set of files you specify) and notifies you when new mail messages appear. It continues running in the background until its parent process exits, at which time it does too, or it can be forced to stop with the hap --kill command.

If you have a terminal capable of saving and restoring the cursor position (like the Digital Equipment VT100), hap will use this feature to always put your mail notifications at the top of the screen. If your terminal can't do this, they'll just appear wherever the cursor is when the mail arrives.

hap understands the mbox file format used by Berkeley Mail and traditional AT&T mail; the mtxt format used by Columbia University's MM; the BABYL format used by Emacs RMAIL; the MMDF format that I think MH uses sometimes; and MH's directory-of-mail-files mailbox format.

If you use hap regularly, you'll probably want to include it in your .profile or .login file with whatever options you prefer. If you want to put it in your .cshrc file instead, be sure to use the conditional

    if ($?prompt) hap

so that only interactive shells will start hap running.

Filenames beginning with % refer to system mailboxes. The filename % is your mailbox, and %user is user's mailbox.

OPTIONS

--help -h
    Summarize the options.

--version -V
    Report the version of hap you're using.

--kill -k
    Force all the hap processes you have running to quit.

-seconds
    Check for mail every seconds seconds instead of the default 30.

--biff -b
    Emulate net.personality BIFF <biff@bit.net>. Hours of fun for the whole family.

--silent -s
    Don't beep when mail arrives

--quote -q
    Report the first nonblank line of each new message.

--verbose -v
    Like --quote, but include as many as five lines intead of one.

--terse -t
    Give only a very brief summary of new mail, in the upper right corner of the screen.

--mesg -m
    Respect the setting of mesg: don't check the mail while messages are turned off.

--no-inverse -i
    Don't use inverse video to make mail notices stand out.

--address -A
    Announce the addresses of senders and recipients rather than their names.

FILES

/usr/spool/mail/*

/var/spool/mail/*

/usr/mail/*

/var/mail/*
    system mailboxes

SEE ALSO
biff(1)
Arthur Miller, Death of a Salesman

AUTHOR
Eric Fischer, etaoin@uchicago.edu

BUGS
Output with the --biff option should arguably be limited to 20 lines of 22 characters each.

The --quote and --verbose options cannot guard against someone reading over your shoulder.

What's a postmark to one mailer is regular text to another, and hap can't tell the difference.

The termcap entries for xterm and iris-ansi-net fail to mention that they can save and restore the cursor position, even though they emulate the VT100. hap silently corrects this.

The --kill option can't distinguish between a hap process and another process whose name happens to end with hap, and tries to kill both.

If your mail is kept in an unusual place, hap may not be able to find it, particularly if you don't have any mail when the process is started. You can avoid the problem by explicitly passing the path to your mail file as an argument to hap or by setting the $MAIL environmental variable to your mail file.

If a mail file shrinks and then immediately grows again, hap may fail to notice that the file ever got smaller.

It's too slow on large notifications because of allocating and deallocating memory.