Re: [exim-dev] Milter api

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Todd Lyons
Fecha:  
A: exim-dev
Asunto: Re: [exim-dev] Milter api
On Fri, Feb 4, 2011 at 10:37 AM, Andreas Metzler
<eximusers@???> wrote:
> On 2011-02-03 Todd Lyons <tlyons@???> wrote:
>> but I have always felt like we exclude ourselves from some nice
>> software options because we don't support the milter interface.
> Afaiui milters get passed the message at eached ehlo verb, and can
> not only return a status but also modify the contents. I think more or


There are callbacks defined for each stage of the smtp conversation, a
few of the obvious ones:
xxfi_connect: same as acl_smtp_connect
xxfi_envfrom: same as acl_smtp_mail
xxfi_envrcpt: same as acl_smtp_rcpt
xxfi_eom: same as acl_smtp_data

Some callbacks that don't match cleanly:
xxfi_eoh: essentially the same as acl_smtp_predata

Some callbacks that would have to be synthesized:
xxfi_header: called once for each header

Don't profess to fully understand:
xxfi_body: I can't tell yet if it's called at the beginning of the
body verb, or at the "\r\n.\r\n" sequence.

I do have some irc buddies who used to work at sendmail and maintain
their own milters who I can lean on for support in understanding these
things :-)

> the only consistent way to integrate milters would be in adding a
> milter verb to the ACL language.


That is the approach at this point, it is fluid however, subject to
change if a good argument can be made or if there is something better
that can be devised.

> And here the fun starts: When is the
> milter run? At the start of the ACL, bottom, do I suddenly need to add
> a milter statement to every single one of the ACLs (even the ones I am
> not currently using)?


General concept:
1. A milter definition in the global section, can have multiple named
milters (milter1 milter2 milter3, etc)
2. Call a milter by a milter verb in whatever acl stage you need it.
Don't call them where you don't need them or they aren't required (for
example, a milter which checks the Date header doesn't need to be
called at connect, mail from, or rcpt to, only after the message
headers have been received).
3. Results are returned in defined $milter_* variables, analyze them
using ${if } or ${lookup } (or whatever) to determine action to take.

This is all still fluid...it's in the early stages. If there are any
suggestions (other than pounding sand :-) or comments, feel free to
shoot them at us.
--
Regards...      Todd
I seek the truth...it is only persistence in self-delusion and
ignorance that does harm.  -- Marcus Aurealius