mailman.patch 11 KB

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