[comp.mail.elm] filters

taylor@hpldat.UUCP (Dave Taylor) (05/07/87)

From: rutgers!seismo!gould!novavax!utx1!chester@hplabs.HP.COM (Bernard Chester)
Subject: filters
To: hplabs!taylor@hplabs.HP.COM (Dave Taylor)
Date: Wed, 6 May 87 16:01:24 EDT

I tried to set up my filter as per the 1.5 filter guide example.
all mail got returned to the sender due to "unbalanced >" errors
from .forward processing.  Any suggestions?

we are running a gould 9080 under utx version 1.3, which is a
bsd port.  we all run kshell, i am not sure which shell is used by
the mail system.

Thanks for any help you can provide.

nichols@en.ecn.purdue.edu (Scott P Nichols) (01/22/91)

I am using the elm "filter" feature.  I have successfully forwarded
my mail to the filter, and have a set of filter-rules as to what
the filter is to do if I get mail from certain people or about 
certain subjects.  

My problem:

Is there a way to have the filter do more than one job on a letter?

i.e.  I get mail from somedude@chuck.pu.edu and I want to
        a)  send him a form thank you _and_
        b)  put the mail in my mailbox

If there is no way *yet* to do this with the elm filter, would
someone possibly have a shell-script for csh that would do the
same thing, that I could run using the EXECUTE command of filter?

Thanks,
Scott
-- 
O-        /\
|\     /\/vv\
      /vv\   \        	      __Insight from Oregon...Scott P. Nichols
_____/    \   ~~~~~~~~~~~~~~~~                      (nichols@en.ecn.purdue.edu)

mascio@convex.COM (John R.S. Mascio) (01/22/91)

In article <1991Jan21.160107.14157@en.ecn.purdue.edu> nichols@en.ecn.purdue.edu (Scott P Nichols) writes:
>My problem:
>
>Is there a way to have the filter do more than one job on a letter?
>
>i.e.  I get mail from somedude@chuck.pu.edu and I want to
>        a)  send him a form thank you _and_
>        b)  put the mail in my mailbox
>
>If there is no way *yet* to do this with the elm filter, would
>someone possibly have a shell-script for csh that would do the
>same thing, that I could run using the EXECUTE command of filter?
>

I solved this specific problem with the following line (all one line):

if ( lines > 1 ) ? execute "tee -a /oper/mascio/mailbox | \
	/usr/local/bin/vacation mascio" 

This put my mail in my mail box while I was on vacation this Xmas, and piped
the message into our vacation program which tells the sender that I am not
here and what ever message I have in my vacation file.  Just replace 
the last command with whatever appropriate script/binary that will
perform the "Thank You" response.

JRSM
---
mascio@convex.com                   John Raymond Stone Mascio        _
mascio@mcs.kent.edu                                              _|_|_)
UNIX SysAdmin - Engineering Operations / Convex Computer Corp   (_|_|

Disclaimer: My opinions are my own, and in no way reflect Convex's opinions
or policies, except accidentially.

fordke@infonode.ingr.com (Keith Ford x8614) (01/22/91)

In article <1991Jan21.160107.14157@en.ecn.purdue.edu> nichols@en.ecn.purdue.edu (Scott P Nichols) writes:
>Is there a way to have the filter do more than one job on a letter?

I use filter rules to pipe the letter to a temporary file, then call
a script file to do futher processing.

  if ( subject "junk" )
    then execute "cat - >/tmp/junk.$$; /usr/joe/bin/doJUNK $$"

The $$ in a ksh indicates the pid of the program.  Since multiple
copies of filter could be running simultaneously, this prevents
your temporary files from being over-written.

The /usr/joe/bin/doJUNK program is something like this:

    # where are we?
    cd /tmp
    # send this to jane
    elm -s "Junk" jane <junk.$1
    # add to one of my folders so I can read it
    cat junk.$1 >>/usr/joe/Mail/junk
    # put a copy out for the server
    mv junk.$1 /usr/server/junk.$1

Hope this helps.
-- 
| ...!uunet!ingr!fordke    OR    fordke@ingr.com
| Micro Magic BBS     (Fidonet: 1:373/12,   MaBell: +1 205 830 2362)
| "and the Trees are all kept equal by hatchet, axe, and saw." -Rush

iacovou@cs.umn.edu (Danny Iacovou) (01/22/91)

   Speaking of filters, here's an interesting "bug" that one of our
   users found. He created a filter to filter all mail from a mailing
   list to a folder. Simple right? Nope. The first letter began with 
   an "i", and he couldn't get it to filter out. Example:
    
      if ( from = "i----") then
         save -----

      if ( from = i----) then
         save -----

    none of the above cases worked. We then tried other words that began
    with "i" and they did not work either. Any ideas?

    

BTW: we are running elm 2.3 pl 6

-- 
--------------------------------------------------------------------------------
Neophytos Iacovou                                
University of Minnesota                     email:  iacovou@cs.umn.edu 
Computer Science Department                         ...!rutgers!umn-cs!iacovou