procmail
[Top] [All Lists]

Extracting name from $FROM

1997-11-05 06:35:17
Hey'all,

I'm have a procmail recipe that beeps me with certain messages:

First I set:

SUBJECT=`formail -xSubject:`    # Subject: field
TO=`formail -xTo:`              # To: field
FROM=`formail -xFrom:`         # From: field

Then I put:

#
# Send PAGE if subject = PAGER
#
:0 Hbc
* ^TO charlesg
* ^Subject:.*PAGER
| (echo ${FROM}; echo ${SUBJECT#" PAGER "} ) | rsh modemsvr epage charlesg -

The recipe itself could actually be anything but I ran some tests with the
stucture:

  Subject: PAGER Message message message message

Now I would like the pager to show:

  Message message message message, Name

Right now, the $FROM variable gives me something like:

  Charles Gagnon <charlesg(_at_)CollTech(_dot_)COM>

Any suggestions,

TIA.


-- 
Charles Gagnon                   | All opinions expressed herein are
Collective Technologies          | fictitious. Any ressemblance with
Charlesg(_at_)CollTech(_dot_)COM            | actual opinions, living or dead is
at: Bell Atlantic T&E, N.Y.      | purely concidental.

   After finding no qualified candidates for the position of principal, the
   school board is extremely pleased to announce the appointment of David
   Steele to the post.
        -- Philip Streifer, Superintendent of Schools, Barrington, Rhode
           Island

<Prev in Thread] Current Thread [Next in Thread>
  • Extracting name from $FROM, Charles Gagnon <=