Update of /cvsroot/mailman/mailman/cron
In directory sc8-pr-cvs1:/tmp/cvs-serv4504

Modified Files:
        disabled 
Log Message:
main(): If we get NotAMemberError when sending the next notification,
log this and delete the member.


Index: disabled
===================================================================
RCS file: /cvsroot/mailman/mailman/cron/disabled,v
retrieving revision 2.8
retrieving revision 2.9
diff -u -d -r2.8 -r2.9
--- disabled    21 Oct 2002 22:36:57 -0000      2.8
+++ disabled    18 Aug 2003 02:56:07 -0000      2.9
@@ -1,19 +1,19 @@
 #! @PYTHON@
 #
-# Copyright (C) 2001,2002 by the Free Software Foundation, Inc.
+# Copyright (C) 2001-2003 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
 # as published by the Free Software Foundation; either version 2
 # of the License, or (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software 
+# along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 """Process disabled members, recommended once per day.
@@ -73,6 +73,7 @@
 from Mailman import MailList
 from Mailman import Pending
 from Mailman import MemberAdaptor
+from Mailman import Errors
 from Mailman.Bouncer import _BounceInfo
 from Mailman.Logging.Syslog import syslog
 from Mailman.i18n import _
@@ -198,7 +199,16 @@
             for member in notify:
                 syslog('bounce', 'Notifying disabled member %s for list: %s',
                        member, mlist.internal_name())
-                mlist.sendNextNotification(member)
+                try:
+                    mlist.sendNextNotification(member)
+                except Errors.NotAMemberError:
+                    # There must have been some problem with the data we have
+                    # on this member.  Most likely it's that they don't have a
+                    # password assigned.  Log this and delete the member.
+                    syslog('bounce',
+                           'NotAMemberError when sending disabled notice: %s',
+                           member)
+                    mlist.ApprovedDeleteMember(member, 'cron/disabled')
             mlist.Save()
         finally:
             mlist.Unlock()



_______________________________________________
Mailman-checkins mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/mailman-checkins

Reply via email to