Subject: A script that reports whether new mail has arrived in each folder

From: Shlomi Fish <[email-masked]>
Date: Sun, 10 Dec 2000 10:05:10 +0200 (IST)

Hi!

I have several mail folders, in the regular flat format (not maildir). I
wish to have a script that will tell me whether new mail has arrived in
each one of the folders. New mail is defined as mail that has the "N" tag
in pine.

TIA,

	Shlomi Fish

----------------------------------------------------------------------
Shlomi Fish        [email-masked] 
Home Page:         http://t2.technion.ac.il/~shlomif/
Home E-mail:       [email-masked]

The prefix "God Said" has the extraordinary logical property of 
converting any statement that follows it into a true one.

---

From: "Nadav Har'El" <[email-masked]>
Date: Sun, 10 Dec 2000 10:25:57 +0200

> each one of the folders. New mail is defined as mail that has the "N" tag

You might want to use newmail/wnewmail (they come with elm, you most likely
you have these installed).

Alternatively, what I personally do, for exactly the situation you describe,
is to have

MAILPATH=/var/mail/nyh:/home/nyh/procmail/mail?You have new mail in $_.

(this is in zsh, but there's probably a bash equivalent if you want. It
looks in my default mailbox (/var/mail/nyh) and all mailboxes in the
/home/nyh/procmail/mail directory.).

This doesn't do exactly what you want (it doesn't look inside the mail and
look for the N, instead it checks if the last-modification date of the file
is newer then the last time it was read), but works beautifully: whenever I
log in I see a list of "you have new mail in ..." lines, and also before
the shell prints a prompt it checks for mail again and prints messages for
new mail that hasn't been announced yet - so I see new mail almost as soon
as it arrives (assuming I'm using the shell, and not stuck inside a long
editing session, for example).

To make things even less synchronous, and to get announcements of email
while I'm not using the shell (e.g., I tend not to be using the shell when I'm
in the bathroom) I also send announcements of "important" mail to my cellphone,
but that's another subject altogether.

-- 
Nadav Har'El                        |      Sunday, Dec 10 2000, 13 Kislev 5761
[email-masked]             |-----------------------------------------
Phone: +972-53-245868, ICQ 13349191 |Always keep your words soft and sweet,
http://nadav.harel.org.il           |just in case you have to eat them.