Re: [exim] Save a mail and then execute a script

Páxina inicial
Borrar esta mensaxe
Responder a esta mensaxe
Autor: W B Hacker
Data:  
Para: exim users
Asunto: Re: [exim] Save a mail and then execute a script
Julien Balmont wrote:
> Hi all, thanks for helping me.
>
> I'm not an expert in Exim, but I now understand how it works, and i'm trying
> to do the following:
> an email arrives, it is saved to a file, then an external PHP script is
> called.
>
> I've already made two routers and two transports (see below).
> My issue with what I made:
> The mail goes through router my_file, then to transport local_copy_incoming
> but never goes to router my_script.
>
> Is there a way to do what I want to do? Please help, i'm searching for a
> long time ago now.


As soon as the first router is matched, traversal ceases and processing
jumps to the transport dsignated by that router.

Place an 'unseen' after a router if you want the stored message data to
be processed again before being 'used up' by the first delivery.

See below.

>
> //ROUTERS
>
> my_file:
> driver = accept
> domains = domain.com
> no_expn
> retry_use_local_part
> transport = local_copy_incoming
>

unseen

> my_script:
> driver = accept
> domains = domain.com
> no_expn
> retry_use_local_part
> transport = to_my_script
>


*snip*

FWIW, Exim can hand-off to anything executable, stoabel, or sideways,
but PHP is not the greatest of choices for this sort of work.

Fisrt - Exim can probably do what you want with its own resources.

Next best might be perl, with which Exim is more 'comfortable' fit.

It isn't just about your language preferences.

It is also about how variables and strings and character encoding and
such are handled - e.g. - 'not always the same way'.

HTH,

Bill