I'm working on some utilities to integrate the Namazu search engine with Mailman, along the lines of Tom Morrison's very nice instruction posted at http://mail.python.org/pipermail/mailman-users/2004-June/037580.html.  The integration on the Namazu side is pretty straightforward and I've already written a piece that customizes Namazu templates on a per-list basis with information from Mailman's MailList module.  See nmzproc at http://www.fmp.com/namazu

There's only one thing holding up the train on the Mailman end, and that's the fact that the only list name substitution token available in archtoc.html and archtocnombox.html is %(listname)s, which is replaced with the lists real_name, including any capitalization which the list admin may chose to use in the "pretty" name for the list.  The Mailman templates need to be modified to generate a small search form, as per Tom Morrison's instructions, and the action attribute of the form needs to be a full path to a directory containing Namazu components, e.g. action="/mailman/%(listname)s/namazu.cgi".  If Namazu is set up for a list, and the list admin decides he wants to change the real_name for the list to display all in caps, the link to Namazu will break.

One line of code would fix this:

--- HyperArch.py.orig   2006-10-16 20:25:22.000000000 -0500
+++ HyperArch.py        2006-10-16 20:28:35.000000000 -0500
@@ -752,6 +752,7 @@
         listname = mlist.internal_name()
         mbox = os.path.join(mlist.archive_dir()'.mbox', listname'.mbox')
         d = {"listname": mlist.real_name,
+             "internal": mlist.internal_name(),
              "listinfo": mlist.GetScriptURL('listinfo', absolute=1),
              "fullarch": '../%s.mbox/%s.mbox' % (listname, listname),
              "size": sizeof(mbox, mlist.preferred_language),

This would give us a %(internal)s name for the list in the TOC index.html file which would be lower case and independent of administrative changes to the displayed list name.

I can do this easily for myself, but I'd like to put together and release a set of tools to integrate Namazu with Mailman.  Telling people to use alternate Mailman templates, or giving them a patch for existing templates, is one thing.  Telling them to patch the Mailman Archiver code is rather more radical, and if this small change could get the blessing of the Mailman
developers going forward it would make my work on the Namazu integration stuff a lot easier.

MailmanWiki: DEV/Mailman 2.2/0008 (last edited 2015-03-04 05:22:56 by msapiro)