procmail
[Top] [All Lists]

Re: error when piping to a program

1998-06-12 14:45:48
Edward:

Thanks for the quick reply! Yourself and David W. Tamkin were both a great help.
Like you said, putting everything in parens instead of backquotes fixed.

I had gotten that recipe somewhere off the web, but after checking the 
procmailex man pages, the backquoutes didn't make sense, but since it worked 
for 
local mail, I was a bit confused.



To: peter(_dot_)delevoryas(_at_)Central
CC: procmail(_at_)informatik(_dot_)rwth-aachen(_dot_)de
Subject: Re: error when piping to a program

Excerpts from mail: (12-Jun-98) error when piping to a program by Peter 
Delevoryas
I've got a weird one here.
My recipe seems to work ok within my domain, but mail from another domain
makes the thing stop working. 

Here is the recipe causing the problem:

[snip]
LASTFOLDER=/export/home/dcs/mail

There's no reason to set the LASTFOLDER variable. It's an informative
variable for your purposes only. Procmail sets it to whatever the delivering
recipe's action/location is. Setting it yourself does nothing.

[snip]
:0
* $ ^Subject: $SEND_SUBJECT_PREFIX\/$SEND_FILENAME_REGEXP$
| `cd /export/ftp/pub; /export/dcs/SCRIPTS/test.p $MATCH $FROM`

I'm not sure if it's necessary or not, but, if I were writing this recipe, I
would change your action line to the following:

| (cd /export/ftp/pub; /export/dcs/SCRIPTS/test.p $MATCH $FROM)

Here is the log excerpt when it tried to process. Note the last line, that 
is 
what is causing the problem. The 'FOLDER' variable is what I don't 
understand

From pdel(_at_)ssdstage(_dot_)Ebay(_dot_)Sun(_dot_)COM  Fri Jun 12 12:05:36 
1998
 Subject: FILE: pdel_061298_10:58:48.tar.Z
  Folder:  `cd /export/ftp/pub; /export/dcs/SCRIPTS/test.p $MATCH $FROM     
800
/bin/sh: procmail-send: not found

It looks like the problem is that the "test.p" script can't find the command
"procmail-send" in its path. Do you set PATH in your ~/.procmailrc? (You
should.) Do you set PATH in the script? Try modifying "test.p" to use a full
path to "procmail-send".

But since you say you only have this problem when you receive mail from
outside users, I think the more likely scenario is that mail from outside
users is being delivered to you on a different server, one that doesn't have
mounted whatever disk volume that has "procmail-send" on it. To test this,
you could put the following line up near the top of your ~/.procmailrc:

LOG=`uname -a`

and then have someone send you e-mail from both within your domain and from
outide. If the logfile shows different hostnames, you could solve the problem
in one of two ways: (a) move "procmail-send" to be in the same location as
"test.p" or some other location that you know for sure is mounted on the
machine where outside e-mail is delivered, or (b) change your ~/.forward file
to forward all mail to a single machine (one that you know has the requisite
disk volumes mounted) and do your procmail execution only on that machine.
Here's an example of such a ~/.forward file:

"|IFS=' ';if test .`/bin/uname -n` = .XXXX ; then p=/your/path/to/procmail && 
test -f $p && exec $p -Yf- || exit 75; else exec /usr/lib/sendmail -oi 
YYYY(_at_)XXXX; fi"

where XXXX is the hostname of the machine and YYYY is your userid.

Hope this helps,
Ed

________________________________________________________

          ______
         /_____/\         Peter Delevoryas
        /____ \\ \        IR Business Technologist 
       /_____\ \\ /       Sun Microsystems, Inc. 
      /_____/ \/ / /      Broomfield, CO 
     /_____/ /   \//\     
     \_____\//\   / /     
      \_____/ / /\ /      
       \_____/ \\ \       Direct: (303) 272-7064 
         \_____\/         Email:  pdel(_at_)Central(_dot_)Sun(_dot_)COM
 
Online answerbooks:  http://docs.sun.com/ab2 

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