procmail
[Top] [All Lists]

Re: CC, notify and logging

2001-09-03 05:07:04
On  0, Tim Holmes <tim(_at_)unixtechs(_dot_)org> wrote:
I've been trying to test this receipe you created. I thought it was a
pretty sweet idea, and instead of trying to muttle through some perl
script to forward email notifications to my pager, I'd use something
like this.

Well, I set up the LOGABSTRACT=no and that seems to work for the most
part.  But it won't play the sound I have set up in the file, so it puts
that entry in the log.

play: play: No such file or directory
procmail: Program failure (127) of "play"

I've used play, `which play`, and even /usr/bin/play, and I always get
an error.  Here's another one of the errors I've gotten.

/usr/bin/play: basename: command not found
/usr/bin/play: uname: command not found
/usr/bin/play: sox: command not found
procmail: Program failure (127) of "/usr/bin/play"

Since I couldn't manage to get the *.wav to play, I thought I'd just
have a file saying "Email from 'so-n-so'" emailed to my text pager.
Basically using a command like:

cat test-file | mail pagerem(_at_)il(_dot_)address

Well I've found that I need to give the path names for everything.  So I
had to change that to:

/bin/cat $HOME/test-file | /bin/mail pagerem(_at_)il(_dot_)address

Well the mail gets put in it's folder, and 'sometimes' the page goes
though.  but I get this in my log.

From timh  Sun Sep  2 14:04:20 2001
 Subject: TEST
  Folder:  /bin/cat $HOME/test-file | /bin/mail pagerem(_at_)il(_dot_)address
From timh  Sun Sep  2 14:04:20 2001
 Subject: TEST
  Folder: /var/spool/mail/timh

Why does it do that?  And of course it can't, and doesn't over write
/bin/cat, or anything else of that nature, but why does it create that
line in the log?

Should I create a script instead, to then send the message to the text
pager?  Or should I edit this to read something else?  Here's the
receipe I'm trying to use.

:0
* ^From:(_dot_)*$USER(_at_)`hostname`
{
        LOGABSTRACT=all
      :0 hwic
      | /bin/cat $HOME/test-file | /bin/mail $USER(_at_)page(_dot_)`hostname`

      :0
      misc
}


Try the following receipe

:0
* ^From:(_dot_)*$USER(_at_)`hostname`
{
        LOGABSTRACT=no
        :0 hwic
        | /bin/mail $USER(_at_)page(_dot_)`hostname` < $HOME/test-file

        LOGABSTRACT=all
        :0
        misc
}

That should record only the delivery to 'misc' folder. I am assuming that's
what you want.

In your original receipe, you had 2 ORs (|)

      | /bin/cat $HOME/test-file | /bin/mail $USER(_at_)page(_dot_)`hostname`

I can't give a good explanation of the 2 ORs on the same command line. It is
not interpreted as a pipe in procmail.

-- 

Subba Rao
subba9(_at_)home(_dot_)com
http://members.home.net/subba9/

GPG public key ID CCB7344E
Key fingerprint = A8DD 4CBA 1E9B D962 A55B  2B55 BAFE 92C5 CCB7 344E
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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