mailman/mailman.patch

Tue, 28 Aug 2012 18:36:35 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 28 Aug 2012 18:36:35 +0200
changeset 579
6b18bb69901e
parent 7
5443cb9b550a
child 631
08b1736686fa
permissions
-rw-r--r--

Correct the paths of patched scripts, refine password generation,
mitigate fdatasync(2) detection problems, correct dependencies, remove
outdated autoconf components, correct conf file paths and attributes,
complete and correct log file rotation handing, and note warnings
useful for diagnosing builds.

michael@7 1 Index: Mailman/Archiver/pipermail.py
michael@371 2 --- Mailman/Archiver/pipermail.py.orig 2009-02-23 22:23:35 +0100
michael@371 3 +++ Mailman/Archiver/pipermail.py 2009-03-27 11:55:18 +0100
michael@371 4 @@ -123,9 +123,10 @@
michael@7 5 if parentID is not None and self.articleIndex.has_key(parentID):
michael@7 6 parent = self.getArticle(archive, parentID)
michael@371 7 myThreadKey = (parent.threadKey + article.date + '.'
michael@371 8 - + str(article.sequence) + '-')
michael@371 9 + + str(article.sequence)
michael@371 10 + + '/' + article.msgid + '-')
michael@7 11 else:
michael@371 12 - myThreadKey = article.date + '.' + str(article.sequence) + '-'
michael@371 13 + myThreadKey = article.date + '.' + str(article.sequence) + '/' + article.msgid + '-'
michael@7 14 article.threadKey = myThreadKey
michael@7 15 key = myThreadKey, article.msgid
michael@7 16 self.setThreadKey(archive, key, article.msgid)
michael@371 17 @@ -420,7 +421,7 @@
michael@7 18 parent = self.database.getArticle(self.archive,
michael@7 19 article.parentID)
michael@371 20 article.threadKey = (parent.threadKey + article.date + '.'
michael@371 21 - + str(article.sequence) + '-')
michael@371 22 + + str(article.sequence) + '/' + article.msgid + '-')
michael@7 23 self.database.setThreadKey(self.archive,
michael@7 24 (article.threadKey, article.msgid),
michael@7 25 msgid)
michael@371 26 @@ -635,10 +636,10 @@
michael@7 27 if parentID:
michael@7 28 parent = self.database.getArticle(arch, parentID)
michael@371 29 article.threadKey = (parent.threadKey + article.date + '.'
michael@371 30 - + str(article.sequence) + '-')
michael@371 31 + + str(article.sequence) + '/' + article.msgid + '-')
michael@7 32 else:
michael@371 33 article.threadKey = (article.date + '.'
michael@371 34 - + str(article.sequence) + '-')
michael@371 35 + + str(article.sequence) + '/' + article.msgid + '-')
michael@7 36 key = article.threadKey, article.msgid
michael@7 37
michael@7 38 self.database.setThreadKey(arch, key, article.msgid)
michael@7 39 Index: Mailman/Commands/cmd_subscribe.py
michael@371 40 --- Mailman/Commands/cmd_subscribe.py.orig 2009-02-23 22:23:35 +0100
michael@371 41 +++ Mailman/Commands/cmd_subscribe.py 2009-03-27 11:55:18 +0100
michael@7 42 @@ -84,6 +84,7 @@
michael@7 43 if password is None:
michael@7 44 password = Utils.MakeRandomPassword()
michael@7 45 if address is None:
michael@7 46 + h = None
michael@7 47 realname, address = parseaddr(res.msg['from'])
michael@7 48 if not address:
michael@7 49 # Fall back to the sender address
michael@7 50 Index: Mailman/HTMLFormatter.py
michael@371 51 --- Mailman/HTMLFormatter.py.orig 2009-02-23 22:23:35 +0100
michael@371 52 +++ Mailman/HTMLFormatter.py 2009-03-27 11:55:18 +0100
michael@7 53 @@ -44,7 +44,7 @@
michael@7 54 realname = self.real_name
michael@7 55 hostname = self.host_name
michael@7 56 listinfo_link = Link(self.GetScriptURL('listinfo'), realname).Format()
michael@7 57 - owner_link = Link('mailto:' + self.GetOwnerEmail(), ownertext).Format()
michael@7 58 + owner_link = Link('mailto:' + self.GetOwnerEmail(), realname + '-owner').Format()
michael@7 59 innertext = _('%(listinfo_link)s list run by %(owner_link)s')
michael@7 60 return Container(
michael@7 61 '<hr>',
michael@7 62 Index: Mailman/Handlers/Decorate.py
michael@371 63 --- Mailman/Handlers/Decorate.py.orig 2009-02-23 22:23:35 +0100
michael@371 64 +++ Mailman/Handlers/Decorate.py 2009-03-27 11:55:18 +0100
michael@371 65 @@ -205,6 +205,7 @@
michael@7 66 del msg['content-transfer-encoding']
michael@7 67 del msg['content-disposition']
michael@7 68 msg['Content-Type'] = 'multipart/mixed'
michael@7 69 + msg['Mime-version'] = '1.0'
michael@7 70
michael@7 71
michael@7 72
michael@7 73 Index: Mailman/Handlers/Scrubber.py
michael@371 74 --- Mailman/Handlers/Scrubber.py.orig 2009-02-23 22:23:35 +0100
michael@371 75 +++ Mailman/Handlers/Scrubber.py 2009-03-27 11:55:18 +0100
michael@371 76 @@ -368,6 +368,8 @@
michael@7 77 t = unicode(t, 'ascii', 'replace')
michael@7 78 try:
michael@7 79 # Should use HTML-Escape, or try generalizing to UTF-8
michael@7 80 + if len(charset) == 0:
michael@7 81 + charset = 'us-ascii'
michael@7 82 t = t.encode(charset, 'replace')
michael@7 83 except (UnicodeError, LookupError, ValueError,
michael@7 84 AssertionError):
michael@7 85 Index: Mailman/Queue/OutgoingRunner.py
michael@371 86 --- Mailman/Queue/OutgoingRunner.py.orig 2009-02-23 22:23:35 +0100
michael@371 87 +++ Mailman/Queue/OutgoingRunner.py 2009-03-27 11:55:18 +0100
michael@7 88 @@ -89,6 +89,7 @@
michael@7 89 syslog('error', 'Cannot connect to SMTP server %s on port %s',
michael@7 90 mm_cfg.SMTPHOST, port)
michael@7 91 self.__logged = True
michael@7 92 + self._snooze(0)
michael@7 93 return True
michael@7 94 except Errors.SomeRecipientsFailed, e:
michael@7 95 # Handle local rejects of probe messages differently.
michael@7 96 Index: Mailman/htmlformat.py
michael@371 97 --- Mailman/htmlformat.py.orig 2009-02-23 22:23:35 +0100
michael@371 98 +++ Mailman/htmlformat.py 2009-03-27 11:55:18 +0100
michael@7 99 @@ -300,7 +300,8 @@
michael@7 100 charset = 'us-ascii'
michael@7 101 if self.language:
michael@7 102 charset = Utils.GetCharSet(self.language)
michael@7 103 - output = ['Content-Type: text/html; charset=%s\n' % charset]
michael@7 104 + output = ['Content-Type: text/html; charset=%s' % charset]
michael@7 105 + output.append('Cache-control: no-cache\n')
michael@7 106 if not self.suppress_head:
michael@7 107 kws.setdefault('bgcolor', self.bgcolor)
michael@7 108 tab = ' ' * indent
michael@7 109 Index: bin/check_perms
michael@371 110 --- bin/check_perms.orig 2009-02-23 22:23:35 +0100
michael@371 111 +++ bin/check_perms 2009-03-27 11:55:18 +0100
michael@7 112 @@ -82,7 +82,7 @@
michael@7 113 return os.stat(path)[ST_MODE]
michael@7 114
michael@7 115 def statgidmode(path):
michael@7 116 - stat = os.stat(path)
michael@7 117 + stat = os.lstat(path)
michael@7 118 return stat[ST_MODE], stat[ST_GID]
michael@7 119
michael@7 120 seen = {}
michael@7 121 Index: bin/config_list
michael@371 122 --- bin/config_list.orig 2009-02-23 22:23:35 +0100
michael@371 123 +++ bin/config_list 2009-03-27 11:55:18 +0100
michael@7 124 @@ -307,6 +307,11 @@
michael@7 125 in mm_cfg.OPTINFO.items()
michael@7 126 if validval & bitval]
michael@7 127 gui._setValue(mlist, k, validval, fakedoc)
michael@7 128 + # Ugly hack, but seems to be needed since
michael@7 129 + # new_member_options isn't really a number in gui.
michael@7 130 + # -- tfheen, 2003-12-06
michael@7 131 + if k == "new_member_options":
michael@7 132 + mlist.new_member_options = validval
michael@7 133 # BAW: when to do gui._postValidate()???
michael@7 134 finally:
michael@7 135 if savelist and not checkonly:
michael@7 136 Index: bin/mailmanctl
michael@371 137 --- bin/mailmanctl.orig 2009-02-23 22:23:35 +0100
michael@371 138 +++ bin/mailmanctl 2009-03-27 11:55:18 +0100
michael@371 139 @@ -424,6 +424,12 @@
michael@371 140 os.dup2(devnull, 1)
michael@371 141 os.dup2(devnull, 2)
michael@371 142
michael@7 143 + # Be sure to close any open std{in,out,err}
michael@7 144 + devnull = os.open('/dev/null', 0)
michael@7 145 + os.dup2(devnull, 0)
michael@7 146 + os.dup2(devnull, 1)
michael@7 147 + os.dup2(devnull, 2)
michael@7 148 +
michael@7 149 # Instead of cd'ing to root, cd to the Mailman installation home
michael@7 150 os.chdir(mm_cfg.PREFIX)
michael@7 151 # Set our file mode creation umask
michael@7 152 Index: bin/newlist
michael@371 153 --- bin/newlist.orig 2009-02-23 22:23:35 +0100
michael@371 154 +++ bin/newlist 2009-03-27 11:58:07 +0100
michael@371 155 @@ -88,12 +88,16 @@
michael@7 156 defined in your Defaults.py file or overridden by settings in mm_cfg.py).
michael@7 157
michael@7 158 Note that listnames are forced to lowercase.
michael@7 159 +
michael@7 160 +The list admin address need to be a fully-qualified address, like
michael@7 161 +owner@example.com, not just owner.
michael@7 162 """
michael@7 163
michael@7 164 import sys
michael@371 165 import os
michael@7 166 import getpass
michael@7 167 import getopt
michael@7 168 +import grp
michael@7 169
michael@7 170 import paths
michael@7 171 from Mailman import mm_cfg
michael@7 172 @@ -122,6 +126,9 @@
michael@7 173
michael@7 174
michael@7 175 def main():
michael@7 176 + gid = grp.getgrnam(mm_cfg.MAILMAN_GROUP)[2]
michael@7 177 + if os.getgid() != mm_cfg.MAILMAN_GROUP:
michael@7 178 + os.setgid(gid)
michael@7 179 try:
michael@7 180 opts, args = getopt.getopt(sys.argv[1:], 'hql:u:e:',
michael@7 181 ['help', 'quiet', 'language=',
michael@371 182 @@ -204,7 +211,7 @@
michael@7 183 except Errors.BadListNameError, s:
michael@7 184 usage(1, _('Illegal list name: %(s)s'))
michael@7 185 except Errors.EmailAddressError, s:
michael@7 186 - usage(1, _('Bad owner email address: %(s)s'))
michael@7 187 + usage(1, _('Bad owner email address: %(s)s. Owner addresses need to be fully-qualified names, like "owner@example.com", not just "owner".'))
michael@7 188 except Errors.MMListAlreadyExistsError:
michael@7 189 usage(1, _('List already exists: %(listname)s'))
michael@7 190
michael@7 191 Index: bin/update
michael@371 192 --- bin/update.orig 2009-02-23 22:23:35 +0100
michael@371 193 +++ bin/update 2009-03-27 11:55:18 +0100
michael@371 194 @@ -554,9 +554,11 @@
michael@7 195 file20 = os.path.join(mm_cfg.DATA_DIR, 'pending_subscriptions.db')
michael@7 196 file214 = os.path.join(mm_cfg.DATA_DIR, 'pending.pck')
michael@7 197 db = None
michael@7 198 + ver = None
michael@7 199 # Try to load the Mailman 2.0 file
michael@7 200 try:
michael@7 201 fp = open(file20)
michael@7 202 + ver = "20"
michael@7 203 except IOError, e:
michael@7 204 if e.errno <> errno.ENOENT: raise
michael@7 205 else:
michael@371 206 @@ -568,6 +570,7 @@
michael@7 207 # Try to load the Mailman 2.1.x where x < 5, file
michael@7 208 try:
michael@7 209 fp = open(file214)
michael@7 210 + ver = "214"
michael@7 211 except IOError, e:
michael@7 212 if e.errno <> errno.ENOENT: raise
michael@7 213 else:
michael@371 214 @@ -601,8 +604,12 @@
michael@7 215 # data[0] is the address being unsubscribed
michael@7 216 addrops_by_address.setdefault(data[0], []).append((key, val))
michael@7 217 elif op == Pending.SUBSCRIPTION:
michael@7 218 - # data[0] is a UserDesc object
michael@7 219 - addr = data[0].address
michael@7 220 + if ver == "20":
michael@7 221 + # data is tuple (emailaddr, password, digest)
michael@7 222 + addr = data[0]
michael@7 223 + else:
michael@7 224 + # data[0] is a UserDesc object
michael@7 225 + addr = data[0].address
michael@7 226 subs_by_address.setdefault(addr, []).append((key, val))
michael@7 227 elif op == Pending.RE_ENABLE:
michael@7 228 # data[0] is the mailing list's internal name
michael@7 229 Index: scripts/driver
michael@371 230 --- scripts/driver.orig 2009-02-23 22:23:35 +0100
michael@371 231 +++ scripts/driver 2009-03-27 11:55:18 +0100
michael@371 232 @@ -98,6 +98,15 @@
michael@7 233 module = getattr(pkg, scriptname)
michael@7 234 main = getattr(module, 'main')
michael@7 235 try:
michael@7 236 + import os
michael@7 237 + request_method = os.environ.get('REQUEST_METHOD')
michael@7 238 + if not request_method in ['GET', 'POST', 'HEAD']:
michael@7 239 + print "Status: 405 Method not allowed"
michael@7 240 + print "Content-type: text/plain"
michael@7 241 + print
michael@7 242 + print "The method is not allowed"
michael@7 243 + sys.exit()
michael@7 244 +
michael@7 245 try:
michael@7 246 sys.stderr = logger
michael@7 247 sys.stdout = tempstdout

mercurial