Hello,
I work for a large university and was recently put in charge of consolidating a bunch of mailman lists from multiple domains onto 1 server.
First problem that I encountered was the single namespace issue with virtual domains, so i removed the stock Mailman 2.1.12 that came with Ubuntu, downloaded Mailman 2.1.7 and patched it with mailman-2.1.7-release-to-vhost.patch from http://ndim.fedorapeople.org/stuff/mailman-vhost/.
That went pretty smooth, compiled and installed without any major issues.
put these in mm_cfg.py: DEFAULT_EMAIL_HOST = 'lists.dept.university.edu' DEFAULT_URL_HOST = 'lists.dept.university.edu' add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST) add_virtualhost('lists.domain1.net', 'lists.domain1.net') add_virtualhost('lists.domain2.net', 'lists.domain2.net') POSTFIX_STYLE_VIRTUAL_DOMAINS = ['lists.domain1.net', 'lists.domain2.net']
After that I setup Postfix, added a new list "test-list" which was automatically created in the right place - /path/to/mailman/lists/lists.domain1.net/test-list/ So no problem here. I subscribed to the list, confirmed the subscription and sent couple of test messages. Everything worked great.
Next i went to browse the archives and encountered another problem. The URLs for the Public archives were not right, but I got around it with a simple Apache rewrite:
RewriteCond %{REQUEST_URI} !^/pipermail/([a-z]+)\.(.*)?$ [NC]
RewriteRule ^/pipermail/(.*)$ /pipermail/%{SERVER_NAME}/$1 [R=301,L]
Basically all it does is insert "lists.domainX.net" between /pipermail/ and /test-list/. Public archives are now working with http://lists.domain1.net/pipermail/lists.domain1.net/test-list/
Next I tried to test Private archives and this is where I hit the wall and need some help with.
The listinfo page for my test-list showed that the URL for the private archives was http://lists.domain1.net/private/test-list, so i figured i would be able to fix it with the same rewrite rule that i used for the Public archives. However, because private CGI wrapper expects the list name right after /private/, this URL http://lists.domain1.net/private/lists.domain1.com/test-list/ did not work, and all i got was the error message saying that "list lists.domain1.net does not exist"
Next, I changed my rewrite rule to redirect me to http://lists.domain1.com/private/test-list@lists.domain1.com instead
RewriteCond %{REQUEST_URI} !^/private/(.*)@(.*)?$ [NC]
RewriteRule ^/private/(.*)/$ /private/$1@%{SERVER_NAME} [R=301,L]
This redirected me to the login page and seemed to work great, until I tried to login and got hit with the message that "test-list" does not exist.
After a little digging, I traced the problem to the incorrect html from action, private.py and private.html template file. With my very limited [read "non-existing"] Python knowledge I managed to pass some arguments to the private.html and change the form action from http://lists.domain1.com/private/test-list/ to http://lists.domain1.com/private/test-list@lists.domain1.com and was able to login, but now i got another error - "Private archive file not found". I looked at the log file and saw the following error message:
Jan 26 09:31:18 2010 (21196) Private archive file not found: /path/to/mailman/archives/private/test-list@lists.domain1.net
Just for the hell of it I decided to create a symbolic link and see if it will work
ln -s /path/to/mailman/archives/private/lists.domain1.net/test-list /path/to/mailman/archives/private/test-list@lists.domain1.net
This seemed to work and i was able to pull up the Private archive page, however all the links were missing "/private/test-list@lists.domain1.net" and looked like "http://lists.domain1.com/2010-January/" [this part is not really important right now. i guess i will deal with this problem later.]
Now it looks like the "path" variable in private.py (line 70 or very close) is causing the issue:
path = os.environ.get('PATH_INFO')
According to the debug log my PATH_INFO is test-list@lists.domain1.net, so I figured I should be able to fix it like so:
path = os.path.join(os.environ.get('SERVER_NAME'), <LIST NAME HERE>) [ end result has to be "lists.domain1.net/test-list ]
But i could not figure out how to pass the list name to os.path.join() and no matter what I did i either ended up with undeclared variable or some other related error.
I really hope someone would be able to help me out here or point me in the right direction.
Thank you in advance,
- Igor