procmail
[Top] [All Lists]

Re: selective 'biff'

1996-04-25 22:34:26
Pardon if this has been asked bfore, I haven't seen it but my eyes aren't
that good (nor my memory)

I'd like to be notified of new mail if and only if it matches a certain
criteria.  I tried to use the 'write' command (to echo the FROM and
SUBJECT) but it never seems to be able to figure out my tty...

I have been running 'tail -f ~/.procmail.log' in the background, but I
don't want to see all my listserv mail, just some certain ones.

Any help/pointers appreciated.

One way is to do something like the following:

    a. make your ~/.procmailrc update a file separate from your normal
       maildrop, possibly logging the important headers of the incoming
       important mail.

    b. make "xbiff" watch the urgent mail log file.

Here's a sample ~/.procmailrc recipe set; of course, you'll have to
define the criteria by which you categorize mail as "important".  The
following are examples:

    URGENTLOG=$HOME/Mail/urgentmail.log
    FLAGMAIL="formail -XDate: -XFrom: -XSubject: > $URGENTLOG"

    # Mail from the boss is always important
    :0c
    * ^From: *The Boss
    | $FLAGMAIL

    # Mail from doofus is never important
    :0Ec
    * ^(From|Reply-To|Sender): *Doofus
    { } 

    # Mail marked urgent is important
    :0Ec
    * ^Precedence: *urgent
    | $FLAGMAIL

    # original mail with "important" or "urgent" is important,
    # but not replies.
    :0Ec
    * ^Subject:.*(important|urgent)
    * ! ^Subject: *Re:
    | $FLAGMAIL

Then, invoke "xbiff" with something like this:

    xbiff -file $HOME/Mail/urgentmail.log

When "xbiff" beeps, you'll have received important mail.  At which
point, you can tail the urgent mail log (or check your real maildrop)
and see who it's from.

Once nice thing about this setup is you have a record of any important
mail you have received.

G'luck.

Alan

+--------------------------+-------------------------------+
| Alan Stebbens            | Silicon Graphics, Inc. (SGI)  |
| Email: stebbens(_at_)sgi(_dot_)com  | M/S: 9L991                    |
| Voice: (415) 933-6437    | 2011 N. Shoreline Blvd.       |
| Fax:   (415) 933-0785    | Mountain View, CA, 94043-1389 |
+--------------------------+-------------------------------+

<Prev in Thread] Current Thread [Next in Thread>