1 |
Patch by Mark Sapiro <mark@msapiro.net> for mailman >= 2.1.13, which adds the urlhost argument to |
2 |
the MailList.MailList.Create() method to allow bin/newlist and the the create CGI to pass urlhost |
3 |
so the host will be correct in the listinfo link on the emptyarchive page. This fixes upstream bug |
4 |
ID #529100, see https://bugs.launchpad.net/mailman/+bug/529100 |
5 |
|
6 |
This patch has been backported for mailman 2.1.12 by Robert Scheck <robert@fedoraproject.org> for |
7 |
Red Hat Enterprise Linux 6. http://bazaar.launchpad.net/~mailman-coders/mailman/2.1/revision/1225 |
8 |
is the original base of this backported patch. |
9 |
|
10 |
--- mailman-2.1.12/Mailman/Cgi/create.py 2009-02-23 22:23:35.000000000 +0100 |
11 |
+++ mailman-2.1.12/Mailman/Cgi/create.py.newlist-urlhost 2012-03-02 14:52:35.300787309 +0100 |
12 |
@@ -1,4 +1,4 @@ |
13 |
-# Copyright (C) 2001-2008 by the Free Software Foundation, Inc. |
14 |
+# Copyright (C) 2001-2010 by the Free Software Foundation, Inc. |
15 |
# |
16 |
# This program is free software; you can redistribute it and/or |
17 |
# modify it under the terms of the GNU General Public License |
18 |
@@ -187,7 +187,8 @@ |
19 |
oldmask = os.umask(002) |
20 |
try: |
21 |
try: |
22 |
- mlist.Create(listname, owner, pw, langs, emailhost) |
23 |
+ mlist.Create(listname, owner, pw, langs, emailhost, |
24 |
+ urlhost=hostname) |
25 |
finally: |
26 |
os.umask(oldmask) |
27 |
except Errors.EmailAddressError, e: |
28 |
--- mailman-2.1.12/Mailman/MailList.py 2009-02-23 22:23:35.000000000 +0100 |
29 |
+++ mailman-2.1.12/Mailman/MailList.py.newlist-urlhost 2012-03-02 14:52:17.198518224 +0100 |
30 |
@@ -1,4 +1,4 @@ |
31 |
-# Copyright (C) 1998-2008 by the Free Software Foundation, Inc. |
32 |
+# Copyright (C) 1998-2010 by the Free Software Foundation, Inc. |
33 |
# |
34 |
# This program is free software; you can redistribute it and/or |
35 |
# modify it under the terms of the GNU General Public License |
36 |
@@ -290,7 +290,8 @@ |
37 |
continue |
38 |
self._gui.append(getattr(Gui, component)()) |
39 |
|
40 |
- def InitVars(self, name=None, admin='', crypted_password=''): |
41 |
+ def InitVars(self, name=None, admin='', crypted_password='', |
42 |
+ urlhost=None): |
43 |
"""Assign default values - some will be overriden by stored state.""" |
44 |
# Non-configurable list info |
45 |
if name: |
46 |
@@ -322,7 +323,7 @@ |
47 |
self.host_name = mm_cfg.DEFAULT_HOST_NAME or mm_cfg.DEFAULT_EMAIL_HOST |
48 |
self.web_page_url = ( |
49 |
mm_cfg.DEFAULT_URL or |
50 |
- mm_cfg.DEFAULT_URL_PATTERN % mm_cfg.DEFAULT_URL_HOST) |
51 |
+ mm_cfg.DEFAULT_URL_PATTERN % (urlhost or mm_cfg.DEFAULT_URL_HOST)) |
52 |
self.owner = [admin] |
53 |
self.moderator = [] |
54 |
self.reply_goes_to_list = mm_cfg.DEFAULT_REPLY_GOES_TO_LIST |
55 |
@@ -471,7 +472,7 @@ |
56 |
# List creation |
57 |
# |
58 |
def Create(self, name, admin, crypted_password, |
59 |
- langs=None, emailhost=None): |
60 |
+ langs=None, emailhost=None, urlhost=None): |
61 |
assert name == name.lower(), 'List name must be all lower case.' |
62 |
if Utils.list_exists(name): |
63 |
raise Errors.MMListAlreadyExistsError, name |
64 |
@@ -499,7 +500,7 @@ |
65 |
self._full_path = Site.get_listpath(name, create=1) |
66 |
# Don't use Lock() since that tries to load the non-existant config.pck |
67 |
self.__lock.lock() |
68 |
- self.InitVars(name, admin, crypted_password) |
69 |
+ self.InitVars(name, admin, crypted_password, urlhost=urlhost) |
70 |
self.CheckValues() |
71 |
if langs is None: |
72 |
self.available_languages = [self.preferred_language] |
73 |
--- mailman-2.1.12/bin/newlist 2012-03-02 14:49:44.642675933 +0100 |
74 |
+++ mailman-2.1.12/bin/newlist.newlist-urlhost 2012-03-02 14:54:38.413853165 +0100 |
75 |
@@ -1,6 +1,6 @@ |
76 |
#! @PYTHON@ |
77 |
# |
78 |
-# Copyright (C) 1998-2008 by the Free Software Foundation, Inc. |
79 |
+# Copyright (C) 1998-2010 by the Free Software Foundation, Inc. |
80 |
# |
81 |
# This program is free software; you can redistribute it and/or |
82 |
# modify it under the terms of the GNU General Public License |
83 |
@@ -197,7 +197,8 @@ |
84 |
langs = [lang] |
85 |
else: |
86 |
langs = [lang, mm_cfg.DEFAULT_SERVER_LANGUAGE] |
87 |
- mlist.Create(listname, owner_mail, pw, langs=langs) |
88 |
+ mlist.Create(listname, owner_mail, pw, langs=langs, |
89 |
+ emailhost=host_name, urlhost=urlhost) |
90 |
finally: |
91 |
os.umask(oldmask) |
92 |
except Errors.BadListNameError, s: |