-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Sidney Markowitz writes:
> Malte S. Stretz said:
> > Btw, what do you think about renaming the class ::DnsResolver
> > to ::Dns::Resolver?
> 
> I don't feel strongly one way or the other about it. That decision is for
> those of you who have a better feel for the aesthetics of O-O Perl.

I'd be fine with it.  no backwards compat is required as it's never
been released yet.

> > I have written a Mail::MTAMark::Query module
> 
> I like that. The lack of control we have over Mail::SPF::Query's use of
> Net::DNS has been bothering me.

fwiw, if you do do that, it'd be very useful to include a polling mode,
assuming MTAMark has a similar multi-stage mode in the protocol similar to
SPF (where the results for one DNS lookup could mean that another DNS
lookup will be required).

In summary:

SPF has a mode whereby a lookup could return data that requires *another*
DNS lookup, e.g. the "include:foo.com" directive.

Currently we have to use Mail::SPF::Query as a single method call, and
allow it to run all necessary queries by itself and simply wait for it to
return.  A more efficient way would be to have a polling mode, so we can
process our own code while waiting for results, and poll for results
intermittently -- similar to how we do DNSBL and URIBL lookups.

The way to do this is something like this:

    sub start_lookups() {
      # start the initial set of DNS lookups.
      # add them to an "in progress" hashtable.
      # return without waiting for results.
    }

    sub poll() {
      # check for completed lookups, process them.
      # add completed ones to a "completed" hash.
      # if a result requires a follow-on lookup, start it here and add
      # to the "in progress" hashtable.  don't block waiting for any
      # results.
      # (optionally) return a flag if all lookups have completed.
    }

    sub wait_for_completion() {
      # using an alarm() for timeout, call poll() until either
      # all results are in, or the timeout is hit.
      # return results.
    }

Then in the calling code, call start() at the start of the
Mail::SpamAssassin::PerMsgStatus::check() function (there's a plugin
API for that), call poll() from check_tick(), and call
wait_for_completion() from the plugin API used to collect DNSBL
results.   This is the general approach used in DNSBL and URIBL
rules.

The benefits of this are that the lookups can take place in parallel with
DNSBL, URIBL and set-0 tests, instead of adding just another long-running
serial test.

PS: I mentioned to Meng ages ago that we might like to get
Mail::SPF::Query relicensed under the ASL so that we could bundle our own
modified version of that module; he was OK with that iirc. if anyone wants
to hack on M:S:Q I'm sure that still applies.

- --j.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Exmh CVS

iD8DBQFCnKpfMJF5cimLx9ARAsj3AJ93OkxRadt9r1rwPL8afBHvolbg8QCfZZ18
zox5BsKni95PB2Mo86/5OW8=
=IAeM
-----END PGP SIGNATURE-----

Reply via email to