making a mail-answering script... ?

making a mail-answering script... ?

Post by Willem Kost » Thu, 28 Apr 1994 04:26:43

Hi there,

How can I make a script that filters some of my mail when I am not logged
in. I want to perform certain actions, when the subject field has a certain
value. I thought I could do that with the filter command that comes with
elm, but I can't get it going. This thing should also work when I log off (
or disconnect or something).

Thanks in advance.


electronic carbon copy)


1. mail answering script -- "getwd: can't stat ."

I have a script that's I've hacked together from various responses to a
previous post, but I think I'm not calling it right.

When I test it by feeding it mail via a pipe (ie. cat test.mail |csh
mail-handler) it works perfectly, sending the generic response to the
address on the From: line, but when I set it up for my incoming mail, it

Here's the script:
-------------------------------  CUT HERE  --------------------------------
#! /bin/csh
set from = ( `tee /nyx/tmp/ssprunk/$$ | grep From:` )
set subject = ( `grep -i '^Subject:' < /nyx/tmp/ssprunk/$$` )
rm -f /nyx/tmp/ssprunk/$$
if ( "$from:q" !~ linux* | "$from:q" !~ ssprunk* | "$from:q" !~ [D,d]eamon*) then

mail -s "$subject" "$from[2]:q" <<END_MESSAGE
Hi there,
        I just received your mail.  I'll get back to you as
soon as possible.
----------------------------  CUT HERE -----------------------------------

And here is the entry in my .forward file:
ssprunk, "|/bin/csh -f -c /u/s/s/ssprunk/mail-handler"

Can anyone help me fix this?  I know this can be replaced with "vacation",
but I'm planning on adding options for specific mail-processing functions


Stephen Sprunk           \   "All I want is peace on earth and goodwill

PGP 2.1 Public Key by finger   \  sort of thing."    -- NSA Guy

2. Files on Disk

3. Looking for site with pre-made scripts like a script that reports on disk space.

4. Where is ifconfig?

5. answer to making man work!

6. linux keyboard

7. Mail problem because a perl script reads /var/spool/mail/login?

8. booting x86 v5.5.1 problems

9. How to use command mailx or mail to send mail from within a script

10. Making a modem act as an answering machine

11. making modem answer, for file transfer

12. making the modem answer

13. Form to Mail Script Won't Mail