Part of my mail server migration is to create a centralised mailing list management location, as this was popular with the previous mail server using ezmlm. This would require http://admin-site.example.org/lists/foo.org/ to manage foo.org lists, and http://admin-site.example.org/lists/bar.org/ to manage bar.org lists. No problem, only a short patch and some RewriteRule hacks necessary. ;)
Here's the patch to Mailman/Utils.py:
--- Utils.py.orig Wed Feb 25 10:05:29 2004
+++ Utils.py Wed Feb 25 10:06:06 2004
@@ -633,6 +633,12 @@
# Strip off the port if there is one
if port and host.endswith(':' + port):
host = host[:-len(port)-1]
+ uri = os.environ.get('REQUEST_URI', os.environ.get('SCRIPT_URL', None))
+ if uri:
+ if uri.startswith('/lists/'):
+ host = uri[7:]
+ if host.find('/') > -1:
+ host = host[:host.find('/')]
if mm_cfg.VIRTUAL_HOST_OVERVIEW and host:
return host.lower()
else:
This checks if '/lists/' is at the begnning of the URI, and if so, assumes that a hostname is going to follow.
Next, change DEFAULT_URL_PATTERN in your mm_cfg.py file:
DEFAULT_URL_PATTERN = 'https://admin-site.example.org/lists/%s/
Finally, add some rewrite magic to your apache virtual host:
RewriteRule ^/lists/([^/]*)/(.*) /usr/local/mailman/cgi-bin/$2 [T=application/x-httpd-cgi]
RewriteEngine On
The downside is that you can enter any host after lists, and mailman shows pages. But people can't create lists on a hostname that isn't configured in mailman itself (add_virtual_host in mm_cfg.py), so it's not too disasterous.
is there a patch to have duplicate list names over different virtual domains?
Check out http://mithrandr.moria.org/blog/139.html (``True'' virtual mailman lists) for such a patch.