Re: [EXIM] Suggestions: Some hooks for Exim

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Malcolm Beattie
Fecha:  
A: Nigel Metheringham
Cc: gvz, exim-users
Asunto: Re: [EXIM] Suggestions: Some hooks for Exim
Nigel Metheringham writes:
>
> gvz@??? said:
> } However, I'd like to know what some other users think about the
> } implementation of three hooks for Exim for external programs.
>
> } The hooks should act on the SMTP-sender passing the "MAIL FROM", the
> } "RCPT TO" and the "HELO"-command.
>
> I really am trying not to suggest that exim be perl enabled....
> but failing!


I intend to do that when my tuit supply increases. As a first cut,
adding a perl director should be pretty easy, usage something like
    check_phase_of_moon:
        driver = perl
        file = Moon.pm
        sub = check_phase


where Moon.pm contains

    sub check_phase {
        ...
        return undef; # fail (i.e. pass on to next director)
        ...
        return $transport; # pass on to transport
        ...
        return "foo@???"; # like smartuser new_address = ...
        ...
        die "panic with message...";
    }


All the exim variables ($local_part, $domain, etc.) would be
available from within Perl, either via a hash like $exim{local_part}
or directly via $local_part. (The latter would need a tie or at
least an sv_magic() for each variable and may be slow--it needs
checking).

Having a perl transport too (where the message is passed to perl code
running within the exim process ) may or may not be of use. I suspect
it wouldn't be worth it.

--Malcolm

--
Malcolm Beattie <mbeattie@???>
Unix Systems Programmer
Oxford University Computing Services

--
*** Exim information can be found at http://www.exim.org/ ***