From f431ffd2849dae99946fb22d7e1beb021989d7cb Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Fri, 22 Aug 2008 15:21:26 -0700 Subject: MTA/Postfix.py If the STANZA END for a list being removed is missing or munged, the remainder of the aliases and/or virtual-mailman file is lost. Fixed. --- Mailman/MTA/Postfix.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Mailman/MTA/Postfix.py b/Mailman/MTA/Postfix.py index 33cb9a47..daa9692f 100644 --- a/Mailman/MTA/Postfix.py +++ b/Mailman/MTA/Postfix.py @@ -1,4 +1,4 @@ -# Copyright (C) 2001-2005 by the Free Software Foundation, Inc. +# Copyright (C) 2001-2008 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 @@ -256,6 +256,7 @@ def _do_remove(mlist, textfile, virtualp): filteroutp = False start = '# STANZA START: ' + listname end = '# STANZA END: ' + listname + oops = '# STANZA START: ' while 1: line = infp.readline() if not line: @@ -270,6 +271,10 @@ def _do_remove(mlist, textfile, virtualp): # Discard the trailing blank line, but don't worry if # we're at the end of the file. infp.readline() + elif line.startswith(oops): + # Stanza end must be missing - start writing from here. + filteroutp = False + outfp.write(line) # Otherwise, ignore the line else: if line.strip() == start: -- cgit v1.2.3 From 37538af3aecffdc230059e36b0842c60a03b6065 Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Mon, 25 Aug 2008 20:08:10 -0700 Subject: Corrected encoding from gb2312 to utf-8 on templates postack.txt, postauth.txt, postheld.txt and unsub.txt. --- templates/zh_CN/postack.txt | 8 ++++---- templates/zh_CN/postauth.txt | 14 +++++++------- templates/zh_CN/postheld.txt | 10 +++++----- templates/zh_CN/unsub.txt | 20 ++++++++++---------- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/templates/zh_CN/postack.txt b/templates/zh_CN/postack.txt index 2fc80b71..df442f00 100644 --- a/templates/zh_CN/postack.txt +++ b/templates/zh_CN/postack.txt @@ -1,8 +1,8 @@ -您的名为 +鎮ㄧ殑鍚嶄负 %(subject)s -的邮件已经被 %(listname)s 邮件列表成功接收。 +鐨勯偖浠跺凡缁忚 %(listname)s 閭欢鍒楄〃鎴愬姛鎺ユ敹銆 -列表信息页为: %(listinfo_url)s -您的偏好设置为: %(optionsurl)s +鍒楄〃淇℃伅椤典负锛 %(listinfo_url)s +鎮ㄧ殑鍋忓ソ璁剧疆涓猴細 %(optionsurl)s diff --git a/templates/zh_CN/postauth.txt b/templates/zh_CN/postauth.txt index 8dfce787..400a5afb 100644 --- a/templates/zh_CN/postauth.txt +++ b/templates/zh_CN/postauth.txt @@ -1,12 +1,12 @@ -作为列表管理员,下面的邮件列表信件需要您的授权: +浣滀负鍒楄〃绠$悊鍛橈紝涓嬮潰鐨勯偖浠跺垪琛ㄤ俊浠堕渶瑕佹偍鐨勬巿鏉冿細 - 列表: %(listname)s@%(hostname)s - 发送者: %(sender)s - 主题: %(subject)s - 原因: %(reason)s + 鍒楄〃锛 %(listname)s@%(hostname)s + 鍙戦佽咃細 %(sender)s + 涓婚锛 %(subject)s + 鍘熷洜锛 %(reason)s -为了您的方便,请访问: +涓轰簡鎮ㄧ殑鏂逛究锛岃璁块棶锛 %(admindb_url)s -来通过或拒绝请求。 +鏉ラ氳繃鎴栨嫆缁濊姹傘 diff --git a/templates/zh_CN/postheld.txt b/templates/zh_CN/postheld.txt index 32c02c80..ff05d9be 100644 --- a/templates/zh_CN/postheld.txt +++ b/templates/zh_CN/postheld.txt @@ -1,14 +1,14 @@ -您发给 %(listname)s,主题为 +鎮ㄥ彂缁 %(listname)s锛屼富棰樹负 %(subject)s -的邮件被暂存,直到通过列表主持者审核。 +鐨勯偖浠惰鏆傚瓨锛岀洿鍒伴氳繃鍒楄〃涓绘寔鑰呭鏍搞 -邮件被暂存的原因是: +閭欢琚殏瀛樼殑鍘熷洜鏄細 %(reason)s -您的邮件或者将被发送给列表,或者您将收到列表主持者发给您的通知。 -如果您想取消本次发送,请访问下面的URL: +鎮ㄧ殑閭欢鎴栬呭皢琚彂閫佺粰鍒楄〃锛屾垨鑰呮偍灏嗘敹鍒板垪琛ㄤ富鎸佽呭彂缁欐偍鐨勯氱煡銆 +濡傛灉鎮ㄦ兂鍙栨秷鏈鍙戦侊紝璇疯闂笅闈㈢殑URL锛 %(confirmurl)s diff --git a/templates/zh_CN/unsub.txt b/templates/zh_CN/unsub.txt index 1b887275..cd4996e9 100644 --- a/templates/zh_CN/unsub.txt +++ b/templates/zh_CN/unsub.txt @@ -1,18 +1,18 @@ -退订邮件列表 %(listname)s 的确认通知 +閫璁㈤偖浠跺垪琛 %(listname)s 鐨勭‘璁ら氱煡 -我们接收到一个要把您的信箱地址,"%(email)s"从邮件列表 %(listaddr)s 移除 -的请求 %(remote)s 。为了确认您确实想退订此列表,请回复此信件,保持回信的 -主题不变。或者访问下面的网页: +鎴戜滑鎺ユ敹鍒颁竴涓鎶婃偍鐨勪俊绠卞湴鍧锛"%(email)s"浠庨偖浠跺垪琛 %(listaddr)s 绉婚櫎 +鐨勮姹 %(remote)s 銆備负浜嗙‘璁ゆ偍纭疄鎯抽璁㈡鍒楄〃锛岃鍥炲姝や俊浠讹紝淇濇寔鍥炰俊鐨 +涓婚涓嶅彉銆傛垨鑰呰闂笅闈㈢殑缃戦〉锛 %(confirmurl)s -或者向 %(requestaddr)s 发送一封仅包含下面一行信息的信件: +鎴栬呭悜 %(requestaddr)s 鍙戦佷竴灏佷粎鍖呭惈涓嬮潰涓琛屼俊鎭殑淇′欢: confirm %(cookie)s -注意,对大多数的邮件阅读器来说,简单的发送一封对此信件的回复就可以了,因 -为这样一般会保持回复信件的主题为正确的形式(主题中有多余的文本"Re:"是没关 -系的)。 +娉ㄦ剰锛屽澶у鏁扮殑閭欢闃呰鍣ㄦ潵璇达紝绠鍗曠殑鍙戦佷竴灏佸姝や俊浠剁殑鍥炲灏卞彲浠ヤ簡锛屽洜 +涓鸿繖鏍蜂竴鑸細淇濇寔鍥炲淇′欢鐨勪富棰樹负姝g‘鐨勫舰寮(涓婚涓湁澶氫綑鐨勬枃鏈"Re:"鏄病鍏 +绯荤殑)銆 -如果您并不想退订此邮件列表,请简单的忽略此信件。如果您认为是某人恶意的要 -将您从列表中移除,或者有其它的任何问题,请把他们发送给 %(listadmin)s 。 +濡傛灉鎮ㄥ苟涓嶆兂閫璁㈡閭欢鍒楄〃锛岃绠鍗曠殑蹇界暐姝や俊浠躲傚鏋滄偍璁や负鏄煇浜烘伓鎰忕殑瑕 +灏嗘偍浠庡垪琛ㄤ腑绉婚櫎锛屾垨鑰呮湁鍏跺畠鐨勪换浣曢棶棰橈紝璇锋妸浠栦滑鍙戦佺粰 %(listadmin)s 銆 -- cgit v1.2.3 From 8a5abde2e58368b605605e370bc3870eb51ca0e6 Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Fri, 19 Sep 2008 08:12:35 -0700 Subject: Since Mailman 2.1.1, 2.0.x outstanding subscription and held message requests have not been migrated properly. This is fixed. Bug #266106 (sf998384). Updated NEWS for this and some prior changes. --- Mailman/ListAdmin.py | 6 ++++-- NEWS | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/Mailman/ListAdmin.py b/Mailman/ListAdmin.py index 191b76f8..f862073b 100644 --- a/Mailman/ListAdmin.py +++ b/Mailman/ListAdmin.py @@ -553,7 +553,8 @@ class ListAdmin: assert len(info) == 6, 'Unknown subscription record layout' continue # Here's the new layout - self.__db[id] = when, addr, fullname, passwd, digest, lang + self.__db[id] = op, (when, addr, fullname, passwd, + digest, lang) elif op == HELDMSG: if len(info) == 5: when, sender, subject, reason, text = info @@ -562,7 +563,8 @@ class ListAdmin: assert len(info) == 6, 'Unknown held msg record layout' continue # Here's the new layout - self.__db[id] = when, sender, subject, reason, text, msgdata + self.__db[id] = op, (when, sender, subject, reason, + text, msgdata) # All done self.__closedb() diff --git a/NEWS b/NEWS index ddc79973..a7ddb27b 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,25 @@ Copyright (C) 1998-2008 by the Free Software Foundation, Inc. Here is a history of user visible changes to Mailman. +2.1.12? (xx-xxx-xxxx) + + Bug fixes and other patches + + - Fixed a bug in admin.py which would result in chunked pages of the + membership list for members whose address begins with a non-alphanumeric + character to not be visible or retrievable. + + - Changed ListAdmin.py to make rejected post messages From: the -owner + address instead of the -bounces address. + + - With MTA = 'Postfix', if the STANZA END for a list being removed is + missing or munged, the remainder of the aliases and/or virtual-mailman + file is lost. Fixed. + + - Since Mailman 2.1.1, 2.0.x outstanding subscription and held message + requests have not been migrated properly. This is fixed. + Bug #266106 (sf998384). + 2.1.11 (30-Jun-2008) New Features -- cgit v1.2.3 From 442dfb107a5dd011dcee55d3bb4f3b1ec58ac91a Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Sun, 21 Sep 2008 11:59:44 -0700 Subject: The immediately preceding fix for bug #266106 (sf998384) was incomplete. It fixed the underlying issue, but didn't fix an improperly converted request.pck file. This change adds code to detect and recover from an incorect conversion. --- Mailman/ListAdmin.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Mailman/ListAdmin.py b/Mailman/ListAdmin.py index f862073b..ec1307ac 100644 --- a/Mailman/ListAdmin.py +++ b/Mailman/ListAdmin.py @@ -538,7 +538,21 @@ class ListAdmin: except IOError, e: if e.errno <> errno.ENOENT: raise self.__db = {} - for id, (op, info) in self.__db.items(): + for id, x in self.__db.items(): + # A bug in versions 2.1.1 through 2.1.11 could have resulted in + # just info being stored instead of (op, info) + if len(x) == 2: + op, info = x + elif len(x) == 6: + # This is the buggy info. Check for digest flag. + if x[4] in (0, 1): + op = SUBSCRIPTION + else: + op = HELDMSG + self.__db[id] = op, x + continue + else: + assert False, 'Unknown record format in %s' % self.__filename if op == SUBSCRIPTION: if len(info) == 4: # pre-2.1a2 compatibility -- cgit v1.2.3 From c7b0eac7de83ed3afd584d733e2b73bf9789701a Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Sun, 21 Sep 2008 12:12:52 -0700 Subject: Changed cron/gate_news to continue processing the remaining lists on certain errors that can be caused by configuration of a particular list. Bug #265941 (sf775100). --- NEWS | 4 ++++ cron/gate_news | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index a7ddb27b..f364d41a 100644 --- a/NEWS +++ b/NEWS @@ -23,6 +23,10 @@ Here is a history of user visible changes to Mailman. requests have not been migrated properly. This is fixed. Bug #266106 (sf998384). + - Changed cron/gate_news to continue processing the remaining lists on + certain errors that can be caused by configuration of a particular list. + Bug #265941 (sf775100). + 2.1.11 (30-Jun-2008) New Features diff --git a/cron/gate_news b/cron/gate_news index a84731f3..a44257cd 100755 --- a/cron/gate_news +++ b/cron/gate_news @@ -1,6 +1,6 @@ #! @PYTHON@ # -# Copyright (C) 1998-2003 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2008 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 @@ -206,8 +206,11 @@ def process_lists(glock): # Open the newsgroup, but let most exceptions percolate up. try: conn, first, last = open_newsgroup(mlist) - except (socket.error, nntplib.NNTPError): - break + except (socket.error, nntplib.NNTPError), e: + syslog('fromusenet', + "%s: couldn't open newsgroup %s: skipping\n%s", + listname, mlist.linked_newsgroup, e) + continue syslog('fromusenet', '%s: [%d..%d]' % (listname, first, last)) try: try: -- cgit v1.2.3 From 37234c51e4d852f2a830db02885e06404bc9a7df Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Fri, 3 Oct 2008 14:59:00 -0700 Subject: Changed the stripping of trailing spaces from lines of the list headers and footers to leave a trailing space on a '-- ' signature separator. --- Mailman/Handlers/Decorate.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Mailman/Handlers/Decorate.py b/Mailman/Handlers/Decorate.py index 64d569db..81bf7d33 100644 --- a/Mailman/Handlers/Decorate.py +++ b/Mailman/Handlers/Decorate.py @@ -227,7 +227,8 @@ def decorate(mlist, template, what, extradict=None): template = Utils.to_percent(template) # Interpolate into the template try: - text = re.sub(r' *\r?\n', r'\n', template % d) + text = re.sub(r'(?m)(? Date: Tue, 14 Oct 2008 20:05:10 -0700 Subject: Changed a '$' to '%' in templates/ru/userpass.txt. --- templates/ru/userpass.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/ru/userpass.txt b/templates/ru/userpass.txt index 7efb934f..fbc9e706 100644 --- a/templates/ru/userpass.txt +++ b/templates/ru/userpass.txt @@ -1,5 +1,5 @@ 髻 商 嗽-韵 淄庞韵 琢 诹幸嫌商 辛蚁特 琢叟 邢男捎松 瘟 有捎纤 -伊佑偬松 $(fqdn_lname)s. 显 辛蚁特 琢 闻下认纳 奶 肆 韵窍, +伊佑偬松 %(fqdn_lname)s. 显 辛蚁特 琢 闻下认纳 奶 肆 韵窍, 拊下 哨团窝载 辛伊团砸 琢叟 邢男捎松, 粤 奶 韵窍, 拊下 显肆诹载友 显 邢男捎松 瘟 茉显 有捎纤 伊佑偬松. -- cgit v1.2.3 From d367b818564a55b316af471506a8e371f75520f8 Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Fri, 17 Oct 2008 15:04:39 -0700 Subject: Added digest.mbox and pending.pck to the 'list' files checked by check_perms. Launchpad bug #284802. --- bin/check_perms | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/check_perms b/bin/check_perms index 7bba0f74..3c8d3768 100755 --- a/bin/check_perms +++ b/bin/check_perms @@ -1,6 +1,6 @@ #! @PYTHON@ # -# Copyright (C) 1998-2007 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2008 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 @@ -334,6 +334,7 @@ def checkdata(): checkfiles = ('config.pck', 'config.pck.last', 'config.db', 'config.db.last', 'next-digest', 'next-digest-topics', + 'digest.mbox', 'pending.pck', 'request.db', 'request.db.tmp') if STATE.VERBOSE: print _('checking permissions on list data') -- cgit v1.2.3 From e027fb3db061d92f285b0ba50031c0990008097a Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Fri, 17 Oct 2008 15:33:48 -0700 Subject: Changed bin/arch to attempt to open the mbox before wiping the old archive. Launchpad bug #280418. --- bin/arch | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/bin/arch b/bin/arch index 40a75a0e..a98ae2af 100644 --- a/bin/arch +++ b/bin/arch @@ -1,6 +1,6 @@ #! @PYTHON@ # -# Copyright (C) 1998,1999,2000,2001,2002 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2008 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 @@ -161,6 +161,11 @@ def main(): # set the lock lifetime to 3 hours. XXX is this reasonable??? lock = LockFile(lockfile, lifetime=3*60*60) lock.lock() + # Try to open mbox before wiping old archive. + try: + fp = open(mbox) + except IOError, msg: + usage(3, _('Cannot open mbox file %(mbox)s: %(msg)s')) # Maybe wipe the old archives if wipe: if mlist.scrub_nondigest: @@ -177,10 +182,6 @@ def main(): shutil.rmtree(mlist.archive_dir()) if mlist.scrub_nondigest and saved: os.renames(savedir, atchdir) - try: - fp = open(mbox) - except IOError, msg: - usage(3, _('Cannot open mbox file %(mbox)s: %(msg)s')) archiver = HyperArchive(mlist) archiver.VERBOSE = verbose -- cgit v1.2.3 From 7267f4fe1452d61f528da083308fbe38d5e1603a Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Fri, 14 Nov 2008 14:09:30 -0800 Subject: Fixed a bug in AvoidDuplicates.py that caused it to fail if the address in the To: or Cc: header differed in case from the case-preserved member address. Bug #297795. --- Mailman/Handlers/AvoidDuplicates.py | 20 ++++++++++++-------- NEWS | 4 ++++ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/Mailman/Handlers/AvoidDuplicates.py b/Mailman/Handlers/AvoidDuplicates.py index fdcc49ca..038034c7 100644 --- a/Mailman/Handlers/AvoidDuplicates.py +++ b/Mailman/Handlers/AvoidDuplicates.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2003 by the Free Software Foundation, Inc. +# Copyright (C) 2002-2008 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 @@ -40,34 +40,38 @@ def process(mlist, msg, msgdata): # Short circuit if not recips: return + # There is an issue with addresses in To: or Cc: that differ in + # case from the MemberCPAddresses in recips. We can't just + # lower-case everything because we still want CP addresses in + # the final recips list, so we lower case the keys. # Seed this set with addresses we don't care about dup avoiding explicit_recips = {} listaddrs = [mlist.GetListEmail(), mlist.GetBouncesEmail(), mlist.GetOwnerEmail(), mlist.GetRequestEmail()] for addr in listaddrs: - explicit_recips[addr] = True + explicit_recips[addr.lower()] = True # Figure out the set of explicit recipients ccaddrs = {} for header in ('to', 'cc', 'resent-to', 'resent-cc'): addrs = getaddresses(msg.get_all(header, [])) if header == 'cc': for name, addr in addrs: - ccaddrs[addr] = name, addr + ccaddrs[addr.lower()] = name, addr for name, addr in addrs: if not addr: continue # Ignore the list addresses for purposes of dup avoidance - explicit_recips[addr] = True + explicit_recips[addr.lower()] = True # Now strip out the list addresses for addr in listaddrs: - del explicit_recips[addr] + del explicit_recips[addr.lower()] if not explicit_recips: # No one was explicitly addressed, so we can't do any dup collapsing return newrecips = [] for r in recips: # If this recipient is explicitly addressed... - if explicit_recips.has_key(r): + if explicit_recips.has_key(r.lower()): send_duplicate = True # If the member wants to receive duplicates, or if the recipient # is not a member at all, just flag the X-Mailman-Duplicate: yes @@ -81,8 +85,8 @@ def process(mlist, msg, msgdata): if send_duplicate: msgdata.setdefault('add-dup-header', {})[r] = True newrecips.append(r) - elif ccaddrs.has_key(r): - del ccaddrs[r] + elif ccaddrs.has_key(r.lower()): + del ccaddrs[r.lower()] else: # Otherwise, this is the first time they've been in the recips # list. Add them to the newrecips list and flag them as having diff --git a/NEWS b/NEWS index f364d41a..b58b8eef 100644 --- a/NEWS +++ b/NEWS @@ -27,6 +27,10 @@ Here is a history of user visible changes to Mailman. certain errors that can be caused by configuration of a particular list. Bug #265941 (sf775100). + - Fixed a bug in AvoidDuplicates.py that caused it to fail if the address + in the To: or Cc: header differed in case from the case-preserved member + address. Bug #297795. + 2.1.11 (30-Jun-2008) New Features -- cgit v1.2.3 From f0d392172bb2400927948004d2dc66c264ca2aa5 Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Thu, 20 Nov 2008 13:08:31 -0800 Subject: Fixed a problem in SecurityManager that caused it to not find the cookie when CheckCookie was not given a user and the user in the cookie had a %xx encoded character. Bug # 299220. --- Mailman/SecurityManager.py | 5 +++-- NEWS | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Mailman/SecurityManager.py b/Mailman/SecurityManager.py index 01610b43..572018e2 100644 --- a/Mailman/SecurityManager.py +++ b/Mailman/SecurityManager.py @@ -1,4 +1,4 @@ -# Copyright (C) 1998-2006 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2008 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 @@ -299,7 +299,8 @@ class SecurityManager: usernames.append(k[len(prefix):]) # If any check out, we're golden. Note: `@'s are no longer legal # values in cookie keys. - for user in [Utils.UnobscureEmail(u) for u in usernames]: + for user in [Utils.UnobscureEmail(urllib.unquote(u)) + for u in usernames]: ok = self.__checkone(c, authcontext, user) if ok: return True diff --git a/NEWS b/NEWS index b58b8eef..91418076 100644 --- a/NEWS +++ b/NEWS @@ -31,6 +31,10 @@ Here is a history of user visible changes to Mailman. in the To: or Cc: header differed in case from the case-preserved member address. Bug #297795. + - Fixed a problem in SecurityManager that caused it to not find the + cookie when CheckCookie was not given a user and the user in the cookie + had a %xx encoded character. Bug # 299220. + 2.1.11 (30-Jun-2008) New Features -- cgit v1.2.3