Re: [Exim] Problem with transport_filter

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Philip Hazel
Ημερομηνία:  
Προς: Lichi Cosmin
Υ/ο: exim-users
Αντικείμενο: Re: [Exim] Problem with transport_filter
On Fri, 4 Jul 2003, Lichi Cosmin wrote:

> This is the output when I run exim with -t and I send a message
> from root to a user, with a simple transport_filter in configure
> file.


<snip>

> changed uid/gid: privilege not needed
> uid=0 gid=0 pid=3261
> auxiliary group list: <none>


You have built Exim with EXIM_USER=root, which is not a good idea. But
that shouldn't stop it working.

<snip>

> --------> cosmin@??? <--------
> locking /var/spool/exim/db/retry.lockfile
> locked /var/spool/exim/db/retry.lockfile
> no retry data available
> search_tidyup called
> root@clichi-vm:/var/spool/mail# changed uid/gid: local delivery to cosmin <cosmin@???> transport=local_delivery
> uid=1000 gid=100 pid=3263


OK, so it's running as uid=1000 at this point.

> auxiliary group list: <none>
> home=/home/cosmin current=/home/cosmin
> set_process_info: 3263 delivering 19YQvV-0000qb-GT to cosmin using local_delivery
> direct command:
> argv[0] = /usr/test/bin/bd/filter
> direct command after expansion:
> argv[0] = usr/test/bin/bd/filter


Hmm. There is something wrong there. It has lost a / at the start of the
command. When I run my test for a transport filter, I see this:

  direct command:
    argv[0] = /bin/sh
    argv[1] = -c
    argv[2] = cat; exit 99
  direct command after expansion:
    argv[0] = /bin/sh
    argv[1] = -c
    argv[2] = cat; exit 99


Notice that argv[0] is the same before and after expansion. If your case
really has lost the / it would explain the error, because the error is
what you get on some OS for a non-existent command.

Is this repeatable? Does it always lose the /? I've looked at the code,
and it is very simple, and should not change any string that doesn't
contain an expansion item (something containing a $ or a \).

So I'm mystified. If this is a repeatable error, you'll have to try
inserting additional debugging into the transport.c module (I will tell
you what to insert) so we can try to track down the problem.

> The program used as transport_filter is working...
> This is the output when I send a mail from root to root
> with the transport_filter


> changed uid/gid: local delivery to root <root@???> transport=local_delivery
> uid=0 gid=0 pid=3373


It is a bad idea to do local deliveries as root. Just in case somehow it
tries to write the wrong file... Most people make root an alias for a
sysadmin.

> direct command:
> argv[0] = /usr/test/bin/bd/filter
> direct command after expansion:
> argv[0] = /usr/test/bin/bd/filter


This time the expansion has not lost the / from the command name. That
is totally WEIRD.

--
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.
Get the Exim 4 book:    http://www.uit.co.uk/exim-book