true virtual hosting patch for 2.1 on RHEL6

Hi all,
Has anyone managed to get the mailman true virtual hosting patch for 2.1 working on Redhat Enterprise 6 as described at https://wiki.koumbit.net/VirtualMailman?
I have to apply the patch manually as it the patch fails in a few places, however once applied the patch doesn't seem to work as it did on RHEL5. Mails are sent, but the list ends up being called list-example.com@example.com, which will break the list for end users.
Unfortunately mailman3 is out of the question as it depends on python 2.7, which is too new for RHEL6. I can tolerate a custom mailman package, I can't support parallel custom versions of entire language stacks on the same box.
Regards, Graham

On 05/26/2013 06:33 PM, Graham Leggett wrote:
I'm not sure how that compares to what I'm familiar with. I have a branch at <https://code.launchpad.net/~msapiro/mailman/vhost> based on the work of Hans Ulrich Niedermann and predecessors. (See the FAQ at <http://wiki.list.org/x/jIA9> and the post at <http://mail.python.org/pipermail/mailman-developers/2006-March/018629.html>.)
Coincidently, this branch was just merged with the head of the 2.1 branch.
I do not use this branch. My disclaimer is "Please don't ask me to fix all the problems with this branch. I don't guarantee that anything will work. I ported the patches and fixed a few reported problems as a service to those who wish to use it. I don't use it and am not enthusiastic about maintaining it. If you use this branch and encounter problems and report those problems to mailman-users@python.org, I may fix them, but only if they are easy to fix." In general, I will try to fix reported problems if the fixes are not too involved.
This is highly reminiscent of cPanel except their list names are list_example.com@example.com and they accept mail to list@example.com for list_example.com@example.com by (in their case) teaching the Exim router about this convention.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

On 27 May 2013, at 4:05 AM, Mark Sapiro <mark@msapiro.net> wrote:
Hopefully this fix doesn't fall into the too involved category. This sanity check was failing even when the emailhost and domain were the same: --- bin/newlist-orig 2013-05-27 13:37:52.351141920 +0000 +++ bin/newlist 2013-05-27 13:38:31.080191760 +0000 @@ -163,7 +163,7 @@ urlhost = urlhost or ('lists.%s' % domain) # TODO: Not configurable yet if not emailhost: emailhost = domain - else: + elif emailhost != domain: usage(1, _('You cannot use an email host different from the domain part of the list name.')) if not mm_cfg.VIRTUAL_HOSTS.has_key(urlhost): _urlhost = repr(urlhost) Regards, Graham --

On 05/27/2013 07:57 AM, Graham Leggett wrote:
Hopefully this fix doesn't fall into the too involved category. This sanity check was failing even when the emailhost and domain were the same:
Fix accepted and committed to the branch at <https://code.launchpad.net/~msapiro/mailman/vhost>.
Thank you.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

On 27 May 2013, at 5:21 PM, Mark Sapiro <mark@msapiro.net> wrote:
Here is another small issue, when VIRTUAL_HOST_OVERVIEW was switched off to allow all virtual lists to appear on the same host, the host_name of the list wasn't passed in the URL. The attached patch fixes this. diff -u -r mailman-2.1.12/Mailman/MailList.py mailman-2.1.12-patched/Mailman/MailList.py --- mailman-2.1.12/Mailman/MailList.py 2013-05-28 10:39:09.333154778 +0000 +++ mailman-2.1.12-patched/Mailman/MailList.py 2013-05-28 10:40:57.874209489 +0000 @@ -252,6 +252,9 @@ def GetScriptURL(self, scriptname, absolute=0): # Using "local_part" here works for both site wide lists on # the default url host and for vhost lists on the vhost url host. + if not mm_cfg.VIRTUAL_HOST_OVERVIEW: + return Utils.ScriptURL(scriptname, self.web_page_url, absolute) + \ + '/' + self.local_part + '@' + self.host_name return Utils.ScriptURL(scriptname, self.web_page_url, absolute) + \ '/' + self.local_part Only in mailman-2.1.12-patched: autom4te.cache diff -u -r mailman-2.1.12/bin/newlist mailman-2.1.12-patched/bin/newlist --- mailman-2.1.12/bin/newlist 2013-05-28 10:39:09.339158852 +0000 +++ mailman-2.1.12-patched/bin/newlist 2013-05-28 10:21:04.730131451 +0000 @@ -165,7 +165,7 @@ emailhost = domain elif emailhost != domain: usage(1, C_('You cannot use an email host different from the domain part of the list name.')) - if not mm_cfg.VIRTUAL_HOSTS.has_key(urlhost): + if mm_cfg.VIRTUAL_HOST_OVERVIEW and not mm_cfg.VIRTUAL_HOSTS.has_key(urlhost): _urlhost = repr(urlhost) _emailhost = repr(emailhost) usage(1, C_('The Mailman config file lacks a line mapping urlhost to emailhost:\n add_virtualhost(%(_urlhost)s,\n %(_emailhost)s)')) Regards, Graham --

On 05/28/2013 04:48 AM, Graham Leggett wrote:
Actually, that patch is not what's required. The comment is wrong. @hostname is required for all vhosts lists regardless of the host name in the URL or the setting of VIRTUAL_HOST_OVERVIEW. A correct patch is attached. As for the patch below, I see what you're trying to do, but I'm nervous about untended consequences of creating lists in domains not in VIRTUAL_HOSTS. I think the patch should be OK, but as I say, I'm nervous about it. I will definitely commit the attached patch, and I'll think about the other. Do you have any motivation for it other than just not wanting to bother with adding add_virtualhost() to mm_cfg.py?
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

On 29 May 2013, at 1:50 AM, Mark Sapiro <mark@msapiro.net> wrote:
I will give this a try and confirm.
For me it causes a number of showstoppers, the first is that we can't automate the creation of the mailing lists in our environment, where running a command is easy but editing a shared system config file is hard. Over and above that we are forced to host the sites on separate virtual hosts, which in turn requires multiple digital certificates for us instead of just one. It also adds significant complexity to our environment, instead of keeping life simple for us.
I chose the VIRTUAL_HOST_OVERVIEW flag because it was already there and it seemed a sensible alignment, but I could change it to add an additional flag to control this.
Regards, Graham

On 06/01/2013 06:08 AM, Graham Leggett wrote:
I have committed this to my branch at <http://launchpad.net/~msapiro/mailman/vhost/>.
After giving it more thought, I committed that one too plus a merge of the latest head of the 2.1 branch.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

On 05/26/2013 06:33 PM, Graham Leggett wrote:
I'm not sure how that compares to what I'm familiar with. I have a branch at <https://code.launchpad.net/~msapiro/mailman/vhost> based on the work of Hans Ulrich Niedermann and predecessors. (See the FAQ at <http://wiki.list.org/x/jIA9> and the post at <http://mail.python.org/pipermail/mailman-developers/2006-March/018629.html>.)
Coincidently, this branch was just merged with the head of the 2.1 branch.
I do not use this branch. My disclaimer is "Please don't ask me to fix all the problems with this branch. I don't guarantee that anything will work. I ported the patches and fixed a few reported problems as a service to those who wish to use it. I don't use it and am not enthusiastic about maintaining it. If you use this branch and encounter problems and report those problems to mailman-users@python.org, I may fix them, but only if they are easy to fix." In general, I will try to fix reported problems if the fixes are not too involved.
This is highly reminiscent of cPanel except their list names are list_example.com@example.com and they accept mail to list@example.com for list_example.com@example.com by (in their case) teaching the Exim router about this convention.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

On 27 May 2013, at 4:05 AM, Mark Sapiro <mark@msapiro.net> wrote:
Hopefully this fix doesn't fall into the too involved category. This sanity check was failing even when the emailhost and domain were the same: --- bin/newlist-orig 2013-05-27 13:37:52.351141920 +0000 +++ bin/newlist 2013-05-27 13:38:31.080191760 +0000 @@ -163,7 +163,7 @@ urlhost = urlhost or ('lists.%s' % domain) # TODO: Not configurable yet if not emailhost: emailhost = domain - else: + elif emailhost != domain: usage(1, _('You cannot use an email host different from the domain part of the list name.')) if not mm_cfg.VIRTUAL_HOSTS.has_key(urlhost): _urlhost = repr(urlhost) Regards, Graham --

On 05/27/2013 07:57 AM, Graham Leggett wrote:
Hopefully this fix doesn't fall into the too involved category. This sanity check was failing even when the emailhost and domain were the same:
Fix accepted and committed to the branch at <https://code.launchpad.net/~msapiro/mailman/vhost>.
Thank you.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

On 27 May 2013, at 5:21 PM, Mark Sapiro <mark@msapiro.net> wrote:
Here is another small issue, when VIRTUAL_HOST_OVERVIEW was switched off to allow all virtual lists to appear on the same host, the host_name of the list wasn't passed in the URL. The attached patch fixes this. diff -u -r mailman-2.1.12/Mailman/MailList.py mailman-2.1.12-patched/Mailman/MailList.py --- mailman-2.1.12/Mailman/MailList.py 2013-05-28 10:39:09.333154778 +0000 +++ mailman-2.1.12-patched/Mailman/MailList.py 2013-05-28 10:40:57.874209489 +0000 @@ -252,6 +252,9 @@ def GetScriptURL(self, scriptname, absolute=0): # Using "local_part" here works for both site wide lists on # the default url host and for vhost lists on the vhost url host. + if not mm_cfg.VIRTUAL_HOST_OVERVIEW: + return Utils.ScriptURL(scriptname, self.web_page_url, absolute) + \ + '/' + self.local_part + '@' + self.host_name return Utils.ScriptURL(scriptname, self.web_page_url, absolute) + \ '/' + self.local_part Only in mailman-2.1.12-patched: autom4te.cache diff -u -r mailman-2.1.12/bin/newlist mailman-2.1.12-patched/bin/newlist --- mailman-2.1.12/bin/newlist 2013-05-28 10:39:09.339158852 +0000 +++ mailman-2.1.12-patched/bin/newlist 2013-05-28 10:21:04.730131451 +0000 @@ -165,7 +165,7 @@ emailhost = domain elif emailhost != domain: usage(1, C_('You cannot use an email host different from the domain part of the list name.')) - if not mm_cfg.VIRTUAL_HOSTS.has_key(urlhost): + if mm_cfg.VIRTUAL_HOST_OVERVIEW and not mm_cfg.VIRTUAL_HOSTS.has_key(urlhost): _urlhost = repr(urlhost) _emailhost = repr(emailhost) usage(1, C_('The Mailman config file lacks a line mapping urlhost to emailhost:\n add_virtualhost(%(_urlhost)s,\n %(_emailhost)s)')) Regards, Graham --

On 05/28/2013 04:48 AM, Graham Leggett wrote:
Actually, that patch is not what's required. The comment is wrong. @hostname is required for all vhosts lists regardless of the host name in the URL or the setting of VIRTUAL_HOST_OVERVIEW. A correct patch is attached. As for the patch below, I see what you're trying to do, but I'm nervous about untended consequences of creating lists in domains not in VIRTUAL_HOSTS. I think the patch should be OK, but as I say, I'm nervous about it. I will definitely commit the attached patch, and I'll think about the other. Do you have any motivation for it other than just not wanting to bother with adding add_virtualhost() to mm_cfg.py?
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

On 29 May 2013, at 1:50 AM, Mark Sapiro <mark@msapiro.net> wrote:
I will give this a try and confirm.
For me it causes a number of showstoppers, the first is that we can't automate the creation of the mailing lists in our environment, where running a command is easy but editing a shared system config file is hard. Over and above that we are forced to host the sites on separate virtual hosts, which in turn requires multiple digital certificates for us instead of just one. It also adds significant complexity to our environment, instead of keeping life simple for us.
I chose the VIRTUAL_HOST_OVERVIEW flag because it was already there and it seemed a sensible alignment, but I could change it to add an additional flag to control this.
Regards, Graham

On 06/01/2013 06:08 AM, Graham Leggett wrote:
I have committed this to my branch at <http://launchpad.net/~msapiro/mailman/vhost/>.
After giving it more thought, I committed that one too plus a merge of the latest head of the 2.1 branch.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (2)
-
Graham Leggett
-
Mark Sapiro