UGSD wrote:
>
>After not being able to create a list, I had another issue (not seen in 
>2.1.7), where the alias file was created in the form of 
>
>lists.domain1.net=list-name-unsubscribe: "|/path/to/mailman unsubscribe 
>lists.domain1.net=list-name"
>
>which mailman did not understand and complained that 
>"lists.domain1.net=list-name" not found.


Alias creation works just fine for me with my original 2.1.13 patch at
<http://www.msapiro.net/mm/2.1.13_vhost.patch>. Lists in the
DEFAULT_URL_HOST domain get aliases like:

# STANZA START: mailman
# CREATED: Sun Jan 31 12:57:36 2010
mailman:      "|/usr/local/mailman/mail/mailman post mailman"
mailman-admin: "|/usr/local/mailman/mail/mailman admin mailman"
mailman-bounces: "|/usr/local/mailman/mail/mailman bounces mailman"
etc.

Lists in the virtual domains get aliases like

# STANZA START: [email protected]
# CREATED: Sun Jan 31 12:57:37 2010
lists.msapiro.net=test: "|/usr/local/mailman/mail/mailman post
[email protected]"
lists.msapiro.net=test-admin: "|/usr/local/mailman/mail/mailman admin
[email protected]"
lists.msapiro.net=test-bounces: "|/usr/local/mailman/mail/mailman
bounces [email protected]"
etc.

and entries in virtual-mailman like

# STANZA START: [email protected]
# CREATED: Sun Jan 31 12:57:37 2010
[email protected]               lists.msapiro.net=test
[email protected]         lists.msapiro.net=test-admin
[email protected]       lists.msapiro.net=test-bounces

This is as it should be. The only requirement being that the virtual
domains (lists.msapiro.net in this example) be in the
POSTFIX_STYLE_VIRTUAL_DOMAINS list in mm_cfg.py as in:

POSTFIX_STYLE_VIRTUAL_DOMAINS = ['lists.msapiro.net']



>So i had to use my mod_rewrite trick, modify Mailman/Cgi/pryvate.py
>
[...]
>
>Now i was able to see the private archive table of contents, but none of the 
>links were functional, so clicking on a link pointing to
>
>http://lists.domain1.net/private/[email protected]/2010-January/thread.html
> reloads the page, adding another "2010-Janury" in the browser address bar
>
>
>http://lists.domain1.net/private/[email protected]/2010-January/2010-January/thread.html
>http://lists.domain1.net/private/[email protected]/2010-January/2010-January/2010-January/thread.html
>
>and so on. Unfortunately i haven't been able to get around this issue yet.


I fixed the archiving for both private and public archives so no
rewriting is involved. private.py does the right thing with my
additional patches. I also patched the GetBaseArchiveURL() method to
include the virtual host directory in the public archive URL.

Finally, I had an issue which almost caused me to give up in disgust.
The original patch adds a _GetURLHost() function to Mailman.Utils.py
which gets the host name from the invoking URL. This got the name from
the SERVER_NAME environment variable which is not the preferred place
and is different from the URL host in my test environment. It should
use HTTP_HOST.

The bottom line for me now is I can take a 2.1.13 base distribution,
patch it with the patch at
<http://www.msapiro.net/mm/2.1.13_vhost.patch> and patch that with the
vhost_extra_patch.txt patch attached to this post, and I think that
list creation and the web interface work. I haven't tested posting
because my testbed uses Exim, but I think it should work.

-- 
Mark Sapiro <[email protected]>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan

=== modified file 'Mailman/Archiver/Archiver.py'
--- Mailman/Archiver/Archiver.py        2010-01-28 21:09:44 +0000
+++ Mailman/Archiver/Archiver.py        2010-01-31 23:35:58 +0000
@@ -159,8 +159,12 @@
         else:
             hostname = re.match('[^:]*://([^/]*)/.*', url).group(1)\
                        or mm_cfg.DEFAULT_URL_HOST
+            if hostname == mm_cfg.DEFAULT_URL_HOST:
+                fullname = self.local_part
+            else:
+                fullname = os.path.join(hostname, self.local_part)
             url = mm_cfg.PUBLIC_ARCHIVE_URL % {
-                'listname': self.local_part,
+                'listname': fullname,
                 'hostname': hostname
                 }
             if not url.endswith('/'):

=== modified file 'Mailman/Cgi/private.py'
--- Mailman/Cgi/private.py      2010-01-28 22:27:15 +0000
+++ Mailman/Cgi/private.py      2010-01-31 23:40:33 +0000
@@ -29,7 +29,7 @@
 from Mailman import i18n
 from Mailman.htmlformat import *
 from Mailman.Logging.Syslog import syslog
-from Mailman.Site import get_mboxpath
+from Mailman.Site import get_archpath, get_mboxpath
 
 # Set up i18n.  Until we know which list is being requested, we use the
 # server's default.
@@ -76,21 +76,23 @@
         print doc.Format()
         syslog('mischief', 'Private archive hostile path: %s', path)
         return
-    # BAW: This needs to be converted to the Site module abstraction
-    true_filename = os.path.join(
-        mm_cfg.PRIVATE_ARCHIVE_FILE_DIR, tpath)
+    listname = parts[0].lower()
 
-    listname = parts[0].lower() # NDIM XXX use Utils.GetListname
     mboxfile = ''
     if len(parts) > 1:
         mboxfile = parts[1]
+        tpath = SLASH.join(parts[1:])
+    else:
+        tpath = ''
 
     # See if it's the list's mbox file is being requested
     if listname.endswith('.mbox') and mboxfile.endswith('.mbox') and \
            listname[:-5] == mboxfile[:-5]:
-        listname = listname[:-5]
+        listname = Utils.GetListName([listname[:-5]])
     else:
         mboxfile = ''
+        listname = Utils.GetListName([listname])
+    true_filename = os.path.join(get_archpath(listname), tpath)
 
     # If it's a directory, we have to append index.html in this script.  We
     # must also check for a gzipped file, because the text archives are

=== modified file 'Mailman/Utils.py'
--- Mailman/Utils.py    2010-01-28 22:27:15 +0000
+++ Mailman/Utils.py    2010-01-31 21:55:34 +0000
@@ -253,7 +253,7 @@
 
 
 # Helper function for CGI scripts
-def _GetURLHost(envar='SERVER_NAME'):
+def _GetURLHost(envar='HTTP_HOST'):
     # NDIM XXX: Not pretty logic.
     web_server_name = os.environ.get(envar)
     if web_server_name:

------------------------------------------------------
Mailman-Users mailing list [email protected]
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Reply via email to