True Virtual Hosting With Mailman Hack

[sourceforge seems to be down, so I post this here]
Hi there,
We developped a reliable solution for running lists with the same name on different domains on the same Mailman installation.
I implemented that on top of the Mailman 2.1.1-5.1 Debian stable package. All that is needed is to patch 2 files (bin/newlist, Mailman/MailList.py) in the mailman install, and here is the patch:
http://bugs.koumbit.net/file_download.php?file_id=3&type=bug
There's only one caveat right now: Mailman/Cgi/create.py might need to get patched too, but I haven't got around looking at it yet, and it "just works", for now.
I don't know what's the current status of virtual hosting support on Mailman, but this patch is a simple hack that should bring joy in the homes of all Mailman admins around the world. :)
I got my inspiration and part of the code from:
http://mithrandr.moria.org/blog/139.html
All it does is to add the domain to the internal_name() of a list. The real_name is kept as is, and the getListAddress() does the Right Thing.
This makes Mailman generate aliases like:
list-example.com: "|/var/lib/mailman/mail/mailman post list-example.com"
Care will have to be taken on the MTA side to map those list-example.com to list@example.com. We are using alternc.org to manage our server, so we are using LDAP, so everything went pretty smoothly. :) But I guess it will require some magic on the Postfix side or something...
Cheers,
A.
PS: for those wanting to see more, you can come to our Wiki:
http://koumbit.net/wiki/VirtualMailman
You'll probably have a little trouble finding your way if you don't read french though. :) Babelfish might help, haven't tried.
----- End forwarded message -----

The Anarcat <anarcat@anarcat.ath.cx> wrote:
[sourceforge seems to be down, so I post this here]
Hi there,
We developped a reliable solution for running lists with the same name on different domains on the same Mailman installation.
http://bugs.koumbit.net/file_download.php?file_id=3&type=bug
I've implemented a patch like this some time ago, and it has somewhat grown during time due to various bugs we found out. I didn't check your patch, since I'm writing this offline, but here are some gotchas that weren't so obvious for us: _setValue in Mailman/Gui/General.py has to be patched, or your list admins won't be able to make real_name case changes. This bug can also be found in (some?) cPanel versions. There's also some usage of internal_name in HasExplicitDest() in MailList.py, which would make Mailman hold messages errorneously under certain circumstances: -------------- diff -Nru mailman-2.1.4/Mailman/MailList.py mailman-2.1.4.patched/Mailman/MailList.py --- mailman-2.1.4/Mailman/MailList.py 2003-12-01 01:54:16.000000000 +0100 +++ mailman-2.1.4.patched/Mailman/MailList.py 2004-01-09 15:22:16.463664000 +0100 @@ -1243,7 +1243,7 @@ to or cc addrs.""" # BAW: fall back to Utils.ParseAddr if the first test fails. # this is the list's full address - listfullname = '%s@%s' % (self.internal_name(), self.host_name) + listfullname = self.getListAddress() recips = [] # check all recipient addresses against the list's explicit addresses, # specifically To: Cc: and Resent-to: @@ -1259,7 +1259,7 @@ addr = addr.lower() localpart = addr.split('@')[0] if (# TBD: backwards compatibility: deprecated - localpart == self.internal_name() or + localpart == self.real_name.lower() or # exact match against the complete list address addr == listfullname): return 1 --------------
All it does is to add the domain to the internal_name() of a list. The real_name is kept as is, and the getListAddress() does the Right Thing.
Hope you did not forget to use .lower() on self.real_name in getListAddress(), like we did. ;-) There, so you now know all the mistakes we made (and found out about). Regards, Zoran

The Anarcat <anarcat@anarcat.ath.cx> wrote:
[sourceforge seems to be down, so I post this here]
Hi there,
We developped a reliable solution for running lists with the same name on different domains on the same Mailman installation.
http://bugs.koumbit.net/file_download.php?file_id=3&type=bug
I've implemented a patch like this some time ago, and it has somewhat grown during time due to various bugs we found out. I didn't check your patch, since I'm writing this offline, but here are some gotchas that weren't so obvious for us: _setValue in Mailman/Gui/General.py has to be patched, or your list admins won't be able to make real_name case changes. This bug can also be found in (some?) cPanel versions. There's also some usage of internal_name in HasExplicitDest() in MailList.py, which would make Mailman hold messages errorneously under certain circumstances: -------------- diff -Nru mailman-2.1.4/Mailman/MailList.py mailman-2.1.4.patched/Mailman/MailList.py --- mailman-2.1.4/Mailman/MailList.py 2003-12-01 01:54:16.000000000 +0100 +++ mailman-2.1.4.patched/Mailman/MailList.py 2004-01-09 15:22:16.463664000 +0100 @@ -1243,7 +1243,7 @@ to or cc addrs.""" # BAW: fall back to Utils.ParseAddr if the first test fails. # this is the list's full address - listfullname = '%s@%s' % (self.internal_name(), self.host_name) + listfullname = self.getListAddress() recips = [] # check all recipient addresses against the list's explicit addresses, # specifically To: Cc: and Resent-to: @@ -1259,7 +1259,7 @@ addr = addr.lower() localpart = addr.split('@')[0] if (# TBD: backwards compatibility: deprecated - localpart == self.internal_name() or + localpart == self.real_name.lower() or # exact match against the complete list address addr == listfullname): return 1 --------------
All it does is to add the domain to the internal_name() of a list. The real_name is kept as is, and the getListAddress() does the Right Thing.
Hope you did not forget to use .lower() on self.real_name in getListAddress(), like we did. ;-) There, so you now know all the mistakes we made (and found out about). Regards, Zoran
participants (2)
-
The Anarcat
-
Zoran Dzelajlija