aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Sapiro <mark@msapiro.net>2017-02-14 19:15:58 -0800
committerMark Sapiro <mark@msapiro.net>2017-02-14 19:15:58 -0800
commita852463283f44357fec29e0bce49f3cc83ed9c2f (patch)
tree3b881fc1e890ae5d9f05770408ef1e28378bfe19
parent78fb8983ae8873ba1ff0640e556eb61b88dba9a7 (diff)
downloadmailman2-a852463283f44357fec29e0bce49f3cc83ed9c2f.tar.gz
mailman2-a852463283f44357fec29e0bce49f3cc83ed9c2f.tar.xz
mailman2-a852463283f44357fec29e0bce49f3cc83ed9c2f.zip
Catch NotAMemberError when member is removed before probe bounce returns.
Diffstat (limited to '')
-rw-r--r--Mailman/Queue/BounceRunner.py34
-rw-r--r--NEWS3
2 files changed, 24 insertions, 13 deletions
diff --git a/Mailman/Queue/BounceRunner.py b/Mailman/Queue/BounceRunner.py
index 651039d6..2d14f284 100644
--- a/Mailman/Queue/BounceRunner.py
+++ b/Mailman/Queue/BounceRunner.py
@@ -29,6 +29,7 @@ from email.Utils import parseaddr
from Mailman import mm_cfg
from Mailman import Utils
from Mailman import LockFile
+from Mailman.Errors import NotAMemberError
from Mailman.Message import UserNotification
from Mailman.Bouncer import _BounceInfo
from Mailman.Bouncers import BouncerAPI
@@ -151,19 +152,26 @@ class BounceMixin:
mlist.Lock()
try:
op, addr, bmsg = mlist.pend_confirm(token)
- info = mlist.getBounceInfo(addr)
- if not info:
- # info was deleted before probe bounce was received.
- # Just create a new info.
- info = _BounceInfo(addr,
- 0.0,
- time.localtime()[:3],
- mlist.bounce_you_are_disabled_warnings
- )
- mlist.disableBouncingMember(addr, info, bmsg)
- # Only save the list if we're unlocking it
- if not locked:
- mlist.Save()
+ # For Python 2.4 compatibility we need an inner try because
+ # try: ... except: ... finally: requires Python 2.5+
+ try:
+ info = mlist.getBounceInfo(addr)
+ if not info:
+ # info was deleted before probe bounce was received.
+ # Just create a new info.
+ info = _BounceInfo(addr,
+ 0.0,
+ time.localtime()[:3],
+ mlist.bounce_you_are_disabled_warnings
+ )
+ mlist.disableBouncingMember(addr, info, bmsg)
+ # Only save the list if we're unlocking it
+ if not locked:
+ mlist.Save()
+ except NotAMemberError:
+ # Member was removed before probe bounce returned.
+ # Just ignore it.
+ pass
finally:
if not locked:
mlist.Unlock()
diff --git a/NEWS b/NEWS
index 7d2498c3..d2992721 100644
--- a/NEWS
+++ b/NEWS
@@ -26,6 +26,9 @@ Here is a history of user visible changes to Mailman.
Bug fixes and other patches
+ - Fixed an uncaught NotAMemberError when a member is removed before a
+ probe bounce for the member is returned. (LP: #1664729)
+
- Fixed a TypeError thrown in the roster CGI when called with a listname
containing a % character. (LP: #1661810)