[Mailman-Developers] Hooks for external archivers

Barry Warsaw barry at python.org
Fri Jun 2 00:05:24 CEST 2006


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

On Thu, 1 Jun 2006 12:01:11 +0100
Gareth McCaughan <gmccaughan at synaptics-uk.com> wrote:

> Suppose you're using Mailman with a separate archiving system
> such as Lurker or mod_mbox or something. Then there are a few
> points at which the external archiver needs to be informed of
> what Mailman is up to, including at least these:
> 
>   - Creation of a new list
>   - Some changes to config of an existing list
>   - Arrival of a new message
>   - Removal of a list (maybe)
> 
> At the moment (I'm using 2.1.8) I think the only such notification
> is for the arrival of a new message, at which point
> PUBLIC_EXTERNAL_ARCHIVER or PRIVATE_EXTERNAL_ARCHIVER gets invoked.
> 
> In my local setup, I've tentatively added a new hook that I've
> equally tentatively called LIST_INFO_UPDATE_COMMAND; if it's not
> None, it gets invoked whenever a list object's Save method is
> called (after %-formatting using the list's configvars plus an
> extra entry for the list's canonical name). That works well
> for my needs, but I'm under no delusion that it's clearly optimal.
> 
> Is there a Right Thing that I should have done instead? If not,
> should Mailman grow some more hooks for interaction with external
> archivers?

I think Mailman should definitely grow more hooks.  In fact, it really
should grow a framework for extensions as well, so that your extensions
can live outside the Mailman source code (a good thing for many
reasons).  Obviously something like this can't go in Mailman 2.1, but
it could go into Mailman 2.2.

Off the top of my head, the general idea is that you'd define a file
system location for your extension to live, and Mailman would map that
into its Mailman.extension package.  There it would look for modules to
load that provided an interface for getting notifications of certain
events.  I think designing the framework is fairly straight-forward.
The real issue is what kinds of hooks you'd like to see, and what kind
of information should get passed to each hook.

Maybe you'd like to outline your thoughts on that in the wiki
<wiki.list.org>? If we can come up with a decent list of hooks and hook
information, then it probably wouldn't be a difficult feaure to add,
and I think it could be rather powerful for sites that want lots of
special customization.

> (Here's a possibly tempting Wrong Thing: don't have separate hooks,
> just check everything whenever a new message arrives. But this is
> inefficient, and more importantly it means that changes to list
> information won't be noticed until the next message is sent, which
> for low-traffic lists might be some time after the change.)

Yeah, I wouldn't do that! :)

- -Barry
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iQCVAwUBRH9kp3EjvBPtnXfVAQLxFgP/TB0oiONf3308+FoJEc8P2ami1quwqe5s
DwuNh/ZEtdcxRYEQcbab9DHF5rEFerfXjIUjAz+ezex9So8U6HuDDhqUhYPlNa3h
9HZ5KAPSwHQCAINMrtzsZGiljUeryP2iUAJmzZ89kECODm7tfP+gvmBPH8nx1+nw
TWV4ylTXLYM=
=ybK0
-----END PGP SIGNATURE-----


More information about the Mailman-Developers mailing list