-
Notifications
You must be signed in to change notification settings - Fork 0
/
mailman-2.1.12-newlist-urlhost.patch
92 lines (89 loc) · 4.33 KB
/
mailman-2.1.12-newlist-urlhost.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
Patch by Mark Sapiro <[email protected]> for mailman >= 2.1.13, which adds the 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. This fixes upstream bug
ID #529100, see https://bugs.launchpad.net/mailman/+bug/529100
This patch has been backported for mailman 2.1.12 by Robert Scheck <[email protected]> for
Red Hat Enterprise Linux 6. http://bazaar.launchpad.net/~mailman-coders/mailman/2.1/revision/1225
is the original base of this backported patch.
--- mailman-2.1.12/Mailman/Cgi/create.py 2009-02-23 22:23:35.000000000 +0100
+++ mailman-2.1.12/Mailman/Cgi/create.py.newlist-urlhost 2012-03-02 14:52:35.300787309 +0100
@@ -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 @@
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:
--- mailman-2.1.12/Mailman/MailList.py 2009-02-23 22:23:35.000000000 +0100
+++ mailman-2.1.12/Mailman/MailList.py.newlist-urlhost 2012-03-02 14:52:17.198518224 +0100
@@ -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 @@
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 @@
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 @@
# 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 @@
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]
--- mailman-2.1.12/bin/newlist 2012-03-02 14:49:44.642675933 +0100
+++ mailman-2.1.12/bin/newlist.newlist-urlhost 2012-03-02 14:54:38.413853165 +0100
@@ -1,6 +1,6 @@
#! @PYTHON@
#
-# 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
@@ -197,7 +197,8 @@
langs = [lang]
else:
langs = [lang, mm_cfg.DEFAULT_SERVER_LANGUAGE]
- mlist.Create(listname, owner_mail, pw, langs=langs)
+ mlist.Create(listname, owner_mail, pw, langs=langs,
+ emailhost=host_name, urlhost=urlhost)
finally:
os.umask(oldmask)
except Errors.BadListNameError, s: