[comp.mail.elm] Can I use the "filter" program?

jeff@cjsa.WA.COM (Jeffery Small) (05/31/89)

I am running smail 2.5 under elm and need to automatically forward a set of
mail messages which match a certain pattern, to another site.  Is there any
way to get "filter" working without running sendmail or is there another
method of achieving the same result?

--
Jeffery Small    (206) 485-5596            uw-beaver!uw-nsr!uw-warp
C. Jeffery Small and Associates                                    !cjsa!jeff
19112 152nd Ave NE - Woodinville, WA  98072           uunet!nwnexus

chip@ateng.ateng.com (Chip Salzenberg) (06/02/89)

[Followups directed to comp.mail.misc]

According to jeff@cjsa.WA.COM (Jeffery Small):
>I am running smail 2.5 under elm and need to automatically forward a set of
>mail messages which match a certain pattern, to another site.  Is there any
>way to get "filter" working without running sendmail or is there another
>method of achieving the same result?

Filter may work.

IMHO, a better solution is the "deliver" program, which by some mysterious
coincidence was written by yours truly.  With deliver, you write shell
script(s) which are executed for each incoming message.  Those shell scripts
control what is done with the message.  Forwarding based on sender,
recipient, contents, time of day, phase of moon, etcetera, etcetera are a
SMOSP (Small Matter Of Shell Programming).

Deliver is currently at patchlevel eight.  It's available via anonymous UUCP
from ateng.  Here are the files in ~uucp/deliver:

  -rw-r--r--   1 network    26101 Feb 15 20:36 deliver.01.Z
  -rw-r--r--   1 network    18446 Feb 15 20:36 deliver.02.Z
  -rw-r--r--   1 network    21081 Feb 15 20:36 deliver.03.Z

Here is an L.sys (Systems) entry:

  ateng Any ACU 2400 18138824934 ogin:--ogin:--ogin: nuucp

-- 
Chip Salzenberg             <chip@ateng.com> or <uunet!ateng!chip>
A T Engineering             Me?  Speak for my company?  Surely you jest!
	  "It's no good.  They're tapping the lines."

dheller@cory.Berkeley.EDU (Dan Heller) (06/02/89)

In article <1989Jun1.193715.908@ateng.ateng.com> chip@ateng.ateng.com (Chip Salzenberg) writes:
> According to jeff@cjsa.WA.COM (Jeffery Small):
> >I am running smail 2.5 under elm and need to automatically forward a set of
> >mail messages which match a certain pattern, to another site.  Is there any
> >way to get "filter" working without running sendmail or is there another
> >method of achieving the same result?
> 
> IMHO, a better solution is the "deliver" program, which by some mysterious

Why is a separte program necessary?  I don't know-- I think I should
really get and build Elm so I know what I'm talking about when it comes
to issues like this.  but in mush, all you have to do is:

pick -s "pattern" | mail -f <address>

This forwards all messages matching a particular pattern to another site.
Dan Heller	<island!argv@sun.com>

chip@vector.Dallas.TX.US (Chip Rosenthal) (06/02/89)

dheller@cory.Berkeley.EDU.UUCP (Dan Heller) writes:
>chip@ateng.ateng.com (Chip Salzenberg) writes:
>> IMHO, a better solution is the "deliver" program
>Why is a separte program necessary?

Because "deliver" is a very powerful generalized tool.  It just happens
that it solves the original problem very nicely.  I've got an entire
system for gatewaying an Internet mailing list into USENET built upon
deliver.
-- 
Chip Rosenthal / chip@vector.Dallas.TX.US / Dallas Semiconductor / 214-450-5337
"I wish you'd put that starvation box down and go to bed" - Albert Collins' Mom

chip@ateng.ateng.com (Chip Salzenberg) (06/04/89)

According to dheller@cory.Berkeley.EDU (Dan Heller):
>Why is a separte program necessary?  I don't know-- I think I should
>really get and build Elm so I know what I'm talking about when it comes
>to issues like this.  but in mush, all you have to do is:
>
>pick -s "pattern" | mail -f <address>
>
>This forwards all messages matching a particular pattern to another site.

Elm is quite capable of taking an already-arrived message and sending a copy
of it to another user.  The "bounce" command performs that function.

However, the original question referred to the "filter" program, provided
with Elm, which forwards mail *at the time of its arrival*.  My pointer to
deliver is based on my own (biased) opinion that deliver is a better solution
than filter to the forward-on-arrival problem.

scott@grlab.UUCP (Scott Blachowicz) (06/05/89)

/ grlab:comp.mail.elm / dheller@cory.Berkeley.EDU (Dan Heller) / 12:21 am  Jun  2, 1989 /
> In article <1989Jun1.193715.908@ateng.ateng.com> chip@ateng.ateng.com (Chip Salzenberg) writes:
>...
> Why is a separte program necessary?  I don't know-- I think I should
> really get and build Elm so I know what I'm talking about when it comes
> to issues like this.  but in mush, all you have to do is:
> 
> pick -s "pattern" | mail -f <address>
Except that requires that the command be issued and the mail gets
dropped in your spool file before it can be dealt with. I know that the
pick command could be done every time you run mush from your .mushrc or
by setting up a script to run from cron every so often. Regardless of
how you do it it shows up in your spool file, which triggers the
programs that look for new mail (newmail, biff, whatever). I use my
spool file for my "to do" list and reminders. I frequently get mail that
I want filed away for future reference or just deleted out of hand, so
it's real convenient for it to never end up in my spool file. I've got
my filter-rules set up to look for ":save:" in the Subject line of a
message...when found, the message is piped to a script of mine that
cat's the message to the end of a specified mailbox. For instance, I
might be looking through news articles, the run an article through the
command "mailx -s 'filter program info :save:elm' scott", so I can have
the article for future reference.

BTW, I usually use mush for looking at my mailboxes so I can do
commands like "pick -s 'pattern' | save +foo" or
"folder +myfolder | pick -ago -3m | save +old/myfolder | delete" to "age"
the messages in my mailboxes.

Scott Blachowicz     scott@grlab.UUCP