aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Sapiro <mark@msapiro.net>2010-02-27 09:57:24 -0800
committerMark Sapiro <mark@msapiro.net>2010-02-27 09:57:24 -0800
commit136ceb7679d51fa50504bbcdbf09c224c188e2ec (patch)
tree1cbeb6aff4ce6fbfbd10360c5b430a671155125d
parent3eaeb16bbe2eeb039bd37a190f8ddf5d36533c57 (diff)
downloadmailman2-136ceb7679d51fa50504bbcdbf09c224c188e2ec.tar.gz
mailman2-136ceb7679d51fa50504bbcdbf09c224c188e2ec.tar.xz
mailman2-136ceb7679d51fa50504bbcdbf09c224c188e2ec.zip
Added a urlhost argument to the MailList.MailList.Create() method to
allow bin/newlist and the the create CGI to pass urlhost so the host will be correct in the listinfo link on the emptyarchive page. Bug #529100.
-rw-r--r--Mailman/Cgi/create.py5
-rw-r--r--Mailman/MailList.py11
-rw-r--r--NEWS5
-rwxr-xr-xbin/newlist4
4 files changed, 16 insertions, 9 deletions
diff --git a/Mailman/Cgi/create.py b/Mailman/Cgi/create.py
index 7e21b981..dd862208 100644
--- a/Mailman/Cgi/create.py
+++ b/Mailman/Cgi/create.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2008 by the Free Software Foundation, Inc.
+# Copyright (C) 2001-2010 by the Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -187,7 +187,8 @@ def process_request(doc, cgidata):
oldmask = os.umask(002)
try:
try:
- mlist.Create(listname, owner, pw, langs, emailhost)
+ mlist.Create(listname, owner, pw, langs, emailhost,
+ urlhost=hostname)
finally:
os.umask(oldmask)
except Errors.EmailAddressError, e:
diff --git a/Mailman/MailList.py b/Mailman/MailList.py
index 674017d1..6083fb12 100644
--- a/Mailman/MailList.py
+++ b/Mailman/MailList.py
@@ -1,4 +1,4 @@
-# Copyright (C) 1998-2008 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-2010 by the Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -290,7 +290,8 @@ class MailList(HTMLFormatter, Deliverer, ListAdmin,
continue
self._gui.append(getattr(Gui, component)())
- def InitVars(self, name=None, admin='', crypted_password=''):
+ def InitVars(self, name=None, admin='', crypted_password='',
+ urlhost=None):
"""Assign default values - some will be overriden by stored state."""
# Non-configurable list info
if name:
@@ -322,7 +323,7 @@ class MailList(HTMLFormatter, Deliverer, ListAdmin,
self.host_name = mm_cfg.DEFAULT_HOST_NAME or mm_cfg.DEFAULT_EMAIL_HOST
self.web_page_url = (
mm_cfg.DEFAULT_URL or
- mm_cfg.DEFAULT_URL_PATTERN % mm_cfg.DEFAULT_URL_HOST)
+ mm_cfg.DEFAULT_URL_PATTERN % (urlhost or mm_cfg.DEFAULT_URL_HOST))
self.owner = [admin]
self.moderator = []
self.reply_goes_to_list = mm_cfg.DEFAULT_REPLY_GOES_TO_LIST
@@ -471,7 +472,7 @@ class MailList(HTMLFormatter, Deliverer, ListAdmin,
# List creation
#
def Create(self, name, admin, crypted_password,
- langs=None, emailhost=None):
+ langs=None, emailhost=None, urlhost=None):
assert name == name.lower(), 'List name must be all lower case.'
if Utils.list_exists(name):
raise Errors.MMListAlreadyExistsError, name
@@ -499,7 +500,7 @@ class MailList(HTMLFormatter, Deliverer, ListAdmin,
self._full_path = Site.get_listpath(name, create=1)
# Don't use Lock() since that tries to load the non-existant config.pck
self.__lock.lock()
- self.InitVars(name, admin, crypted_password)
+ self.InitVars(name, admin, crypted_password, urlhost=urlhost)
self.CheckValues()
if langs is None:
self.available_languages = [self.preferred_language]
diff --git a/NEWS b/NEWS
index 66a92cd1..5ee5bb91 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,11 @@ Here is a history of user visible changes to Mailman.
Bug Fixes and other patches
+ - Added a urlhost argument to the MailList.MailList.Create() method to
+ allow bin/newlist and the the create CGI to pass urlhost so the host
+ will be correct in the listinfo link on the emptyarchive page.
+ Bug #529100.
+
- Added the List-Post header to the default list of headers retained in
messages in the MIME digest. Bug #526143.
diff --git a/bin/newlist b/bin/newlist
index 6e02de97..c14b77f3 100755
--- a/bin/newlist
+++ b/bin/newlist
@@ -1,6 +1,6 @@
#! @PYTHON@
#
-# Copyright (C) 1998-2009 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-2010 by the Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -198,7 +198,7 @@ def main():
else:
langs = [lang, mm_cfg.DEFAULT_SERVER_LANGUAGE]
mlist.Create(listname, owner_mail, pw, langs=langs,
- emailhost=host_name)
+ emailhost=host_name, urlhost=urlhost)
finally:
os.umask(oldmask)
except Errors.BadListNameError, s: