Re: [exim] pipe transport woes

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Douglas Choma
Ημερομηνία:  
Προς: Dave Evans
Υ/ο: exim-users
Αντικείμενο: Re: [exim] pipe transport woes
On Dec 17, 2006, at 2:40 AM, Dave Evans wrote:

> On Sat, Dec 16, 2006 at 11:49:44PM -0800, Douglas Choma wrote:
>> #!/bin/sh
>> date >>/tmp/script.log
>> id >>/tmp/script.log
>> cat - >>/tmp/script.log
>> exit 0
>>
>> When executed from an Exim transport, the script.log file contains
>> only the results from "id"...
>
> My guess would be that PATH isn't what you think it is, for some
> reason.
> On my system, "date" and "cat" are in /bin and "id" is in /usr/bin,
> so if your
> PATH doesn't include /bin for some reason this would do it.
>
> You might also try removing all the ">>/tmp/script.log" bits, and
> instead
> adding "exec >>/tmp/script.log 2>&1" as the first line after #!/bin/sh



You were absolutely right! cat and date are in /bin (on Debian).
But what I don't understand is why the PATH is different for a shell
running from Exim. Shouldn't it be the same environment that the
user would normally operate within?

Thanks again for the solution though, adding absolute paths to my
binaries does the trick.