Re: [Exim] pipe outgoing messages

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Todd Jagger
Fecha:  
A: exim-users
Asunto: Re: [Exim] pipe outgoing messages
Hi, Thanks for the reply. I didn't notice it right away.


At 07:46 AM 2/25/2002, Greg Ward wrote:
>On 22 February 2002, Todd Jagger said:
> > Here's the system_filter entry:
> >
> > if $message_headers contains "X-insert-tag-here" then
> >     pipe "/usr/local/bin/python /usr/local/tmda/bin/tmda-sendmail"
> > seen finish
> > endif

>
>That looks like a sensible way to do it, assuming that your "X-" tag
>is
>a solid guarantee that this really is outgoing mail.


Agreed. Right now I just want to see if I can get tmda to properly tag
an outgoing message with a dated address by being called *somehow* from
an Exim pipe command. Once I see it can be done then adjustments can
be made to tighten up the procedure. Since the tmda stuff should be
called by the user perhaps a specific router + transport with the
pipe_as_creator variable set might be a better way to do it. But so
far no matter how I'm setting it up now it's bombing on the python
scripts of tmda. :-/



> > And the error output by Exim is:
> >
> >       Child process of address_pipe transport returned 127 from
> > command:
> >      /usr/local/bin/python

> >
> > ------ pipe to |/usr/local/bin/python
> /usr/local/tmda/bin/tmda-sendmail
> >         generated by message filter ------

> >
> > env: python: No such file or directory
>
>Check the first line of tmda-sendmail; I bet it is
>
> #!/usr/bin/env python
>
>which is a lovely hack used in the Python world to avoid having to
>hardcode the path to the Python interpreter. Unfortunately, it's not
>100% reliable, and really should not be used in a production
>environment. Change it to
>
> #!/usr/local/bin/python
>
>and I bet you'll be fine.


You're exactly right. Now I get a new and different error. :-) But
it's not failing on the env part any more. I'm getting a deferred "75"
error from a child process. I'm not sure how to debug from here; I'm
not a python coder. But I'd sure like to figure out a way to get tmda
working with non-unix mail clients and Exim seems like a good way to do
that either through a system filter or a special transport+router.

Here's the router and transport I've set up that does the same thing as
the system filter entry:

# tmda test transport
tmda:
driver = pipe
command = "/usr/local/bin/python /usr/local/tmda/bin/tmda-sendmail"
pipe_as_creator
return_fail_output

And the router (listed first):

# Test router for tmda
tmda_outgoing:
driver = lookuphost
transport = tmda
condition = "$message_headers contain X-TMDA-Flag: on"


These pass the message to the pipe just like the system filter entry,
but they're both returning:

"... T=tmda defer (0): Child process of tmda transport returned 75
(could mean temporary error) from command: /usr/local/bin/python "

I'm going to see if the tmda-workers might have some suggestion how to
debug what's happening after Exim is handing off the message to
tmda-sendmail.


>However, given your Exim "pipe" command, I don't really understand why
>your kernel is even consulting the #! line. Which OS is this?


OpenBSD 3.0.

Thanks for helping.

Regards,
Todd