procmail
[Top] [All Lists]

Re: New Mail

1996-07-10 23:51:08
On Wed, 10 Jul 1996 23:24:16 -35900, 
lolson(_at_)acc(_dot_)jc(_dot_)edu (the bird with the lovely .signature) wrote:
On Wed, 10 Jul 1996, Alan Stebbens <stebbens(_at_)sgi(_dot_)com> wrote:
I used mail lolson < file to test it, the mail got there, but th mssage 
wasn't displayed.
Any ideas what is wrong?
:0c
| echo "You have new mail from $FROM bout $SUBJ" >/dev/console 
This is what I figured, but as I am on a tty which changes 
every time I log on, I need a way for it to find the right one.

This is not really something that belongs in Procmail anyway. It's the
task of your Comsat (biff etc) to notify you about mail, and no
concern of the mail delivery agent.
  Bash has mail notification built in, and then there's all those
souped-up (whatever)biff programs. Get one and try it out. 
  Or why don't you just put something like this in your .profile (for
interactive shells only, of course):

  tail -f $HOME/Mail/procmail.log | $HOME/bin/my-mail-delivery-notificator &

where my-mail-delivery-notificator looks something like

  #!/usr/local/bin/perl -n

  m/^From (.*)  /     && ($who = $1);
  m/^ Subject: (.*)/  && ($what = $1);
  m/^  Folder: (.*)/  && print "Mail from $who about $what in $1\n" if $what;

# The "if" is so that you don't get a spurious line when you start the
#  script. Er, you still get some output when you start it, but that's
#  ... uh ... a feature. 

Hope this helps,

/* era */

-- 
See <http://www.ling.helsinki.fi/~reriksso/> for mantra, disclaimer, etc.
* If you enjoy getting spam, I'd appreciate it if you'd register yourself
  at the following URL:  <http://www.ling.helsinki.fi/~reriksso/spam.html>

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