aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Sapiro <mark@msapiro.net>2008-02-29 09:47:36 -0800
committerMark Sapiro <mark@msapiro.net>2008-02-29 09:47:36 -0800
commitd14353a411404216f3d93d7397d91647b0959da5 (patch)
tree67fd659bc1cd5a896876b3ee8b8df3f223783ecd
parent7acc4e9c0f3bce4831ca1399fa7aade621ed6b70 (diff)
downloadmailman2-d14353a411404216f3d93d7397d91647b0959da5.tar.gz
mailman2-d14353a411404216f3d93d7397d91647b0959da5.tar.xz
mailman2-d14353a411404216f3d93d7397d91647b0959da5.zip
Changed add_members, clone_member and sync_members to catch or avoid
MembershipIsBanned exception and report appropriately.
Diffstat (limited to '')
-rw-r--r--NEWS3
-rwxr-xr-xbin/add_members3
-rwxr-xr-xbin/clone_member6
-rwxr-xr-xbin/sync_members2
4 files changed, 14 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 5bfc440a..e6cc5ac7 100644
--- a/NEWS
+++ b/NEWS
@@ -155,6 +155,9 @@ Internationalization
moving the entry aside and logging the fact after the third dequeue of
the same entry.
+ - Fixed the command line scripts add_members, sync_members and
+ clone_member to properly handle banned addresses (1904737).
+
Miscellaneous
- Brad Knowles' mailman daily status report script updated to 0.0.17.
diff --git a/bin/add_members b/bin/add_members
index fdc3f02b..03f0af3a 100755
--- a/bin/add_members
+++ b/bin/add_members
@@ -135,6 +135,9 @@ def addall(mlist, members, digest, ack, outfp):
mlist.ApprovedAddMember(userdesc, ack, 0)
except Errors.MMAlreadyAMember:
print >> tee, _('Already a member: %(member)s')
+ except Errors.MembershipIsBanned, pattern:
+ print >> tee, ('%s:' %
+ member), _('Banned address (matched %(pattern)s)')
except Errors.MMBadEmailError:
if userdesc.address == '':
print >> tee, _('Bad/Invalid email address: blank line')
diff --git a/bin/clone_member b/bin/clone_member
index 1f2a03ac..915c540f 100755
--- a/bin/clone_member
+++ b/bin/clone_member
@@ -129,6 +129,12 @@ def dolist(mlist, options):
if not options.quiet:
print _(' address not found:'), options.fromaddr
return
+ # Check for banned to address.
+ pattern = mlist.GetBannedPattern(options.toaddr)
+ if pattern:
+ if not options.quiet:
+ print ' ', _('Banned address (matched %(pattern)s)')
+ return
# Now change the membership address
try:
diff --git a/bin/sync_members b/bin/sync_members
index 4a21624c..13d0b2b0 100755
--- a/bin/sync_members
+++ b/bin/sync_members
@@ -260,6 +260,8 @@ def main():
print _('Added : %(s)s')
except Errors.MMAlreadyAMember:
pass
+ except Errors.MembershipIsBanned, pattern:
+ print ('%s:' % addr), _('Banned address (matched %(pattern)s)')
for laddr, addr in addrs.items():
# Should be a member, otherwise our test above is broken