aboutsummaryrefslogtreecommitdiffstats
path: root/Mailman/Queue/BounceRunner.py
diff options
context:
space:
mode:
Diffstat (limited to 'Mailman/Queue/BounceRunner.py')
-rw-r--r--Mailman/Queue/BounceRunner.py34
1 files changed, 21 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()