Loading ...
Sorry, an error occurred while loading the content.

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

Expand Messages
  • Shlomi Fish
    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
    Message 1 of 2 , Dec 10, 2000
    View Source
    • 0 Attachment
      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 shlomif@...
      Home Page: http://t2.technion.ac.il/~shlomif/
      Home E-mail: shlomif@...

      The prefix "God Said" has the extraordinary logical property of
      converting any statement that follows it into a true one.
    • Nadav Har'El
      ... 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
      Message 2 of 2 , Dec 10, 2000
      View Source
      • 0 Attachment
        On Sun, Dec 10, 2000, Shlomi Fish wrote about "[hackers-il] A script that reports whether new mail has arrived in each folder":
        > 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.

        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
        nyh@... |-----------------------------------------
        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.
      Your message has been successfully submitted and would be delivered to recipients shortly.