procmail
[Top] [All Lists]

Re: New Mail

1996-07-10 21:17:52
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?

Yes, echo and xmessage do not work the same way.  Echo produces
output to STDOUT (which is probably the log file or /dev/null, when
mail is being deliverd), while xmessage places a message on the
$DISPLAY.

If you wish to have "output" produced at the time mail is delivered,
you must have a good definition of where the output should go, and
then tell "echo" to put it there.

Ie: if you want the output to go /dev/console, then do this:

    :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 what I have come up with so far.  There must be an easier way:

FROM=`formail -rtzxTo:`
SUBJ=`formail -rtzxSubject:`
TTY=/dev/`who | grep lolson | awk '{print $2}'`
:0c
| echo "You have new mail from $FROM about $SUBJ" > $TTY

Until NeXTime,
   _        _    __                 __
\_|_)  _ o | |  / ()  ,_  o |)     /\_\/|\  ,   _          \\\'        _///
  |   |/ | |/   >-   /  | | |/)   |    ||/ / \_/ \_/|/|     \\\//    _/ //
 (\__/|_/|/|_/  \___/   |/|/| \/   \__/ |_/ \/ \_/  | |_/    \_-//'_/  //<'
           |\   Computer Science Major(_at_)Jamestown College      \///   <//'
  ________ |/_______   ____   ____ _    _________   __        / >>    \\\'
 /_  __/ / / / ____/  / __ \ / __ \ |  / / ____/ | / /  of   /,)-^>>  _/
  / / / /_/ / __/    / /_/ // /_/ / | / / __/ /  |/ /  The  (/    \\ //
 / / / __  / /___   / __, // __  /| |/ / /___/ /|  /  Black        //
/_/ /_/ /_/_____/  /_/  |_/_/ /_/ |___/_____/_/ |_/  Tower        ((
THE RAVEN'S LOFT   URL: http://acc.jc.edu/~lolson/  .signature V5.0

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