procmail
[Top] [All Lists]

Re: error when piping to a program

1998-06-12 14:05:47
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

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