------------------------------------------------------------
revno: 1357
committer: Mark Sapiro <m...@msapiro.net>
branch nick: 2.2
timestamp: Fri 2014-10-17 08:43:49 -0700
message:
  Implemented the ability to forward more bounces to the list owner.
modified:
  Mailman/Bouncer.py
  Mailman/Defaults.py.in
  Mailman/Gui/Bounce.py
  Mailman/Version.py
  Mailman/versions.py
  NEWS


--
lp:mailman/2.2
https://code.launchpad.net/~mailman-coders/mailman/2.2

Your team Mailman Checkins is subscribed to branch lp:mailman/2.2.
To unsubscribe from this branch go to 
https://code.launchpad.net/~mailman-coders/mailman/2.2/+edit-subscription
=== modified file 'Mailman/Bouncer.py'
--- Mailman/Bouncer.py	2012-02-18 02:19:56 +0000
+++ Mailman/Bouncer.py	2014-10-17 15:43:49 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 1998-2012 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-2014 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
@@ -89,6 +89,8 @@
             mm_cfg.DEFAULT_BOUNCE_YOU_ARE_DISABLED_WARNINGS_INTERVAL
         self.bounce_unrecognized_goes_to_list_owner = \
             mm_cfg.DEFAULT_BOUNCE_UNRECOGNIZED_GOES_TO_LIST_OWNER
+        self.bounce_notify_owner_on_bounce_increment = \
+            mm_cfg.DEFAULT_BOUNCE_NOTIFY_OWNER_ON_BOUNCE_INCREMENT
         self.bounce_notify_owner_on_disable = \
             mm_cfg.DEFAULT_BOUNCE_NOTIFY_OWNER_ON_DISABLE
         self.bounce_notify_owner_on_removal = \
@@ -135,6 +137,7 @@
                         siblist.Unlock()
             return
         info = self.getBounceInfo(member)
+        first_today = True
         if day is None:
             # Use today's date
             day = time.localtime()[:3]
@@ -155,6 +158,7 @@
             return
         elif info.date == day:
             # We've already scored any bounces for this day, so ignore it.
+            first_today = False
             syslog('bounce', '%s: %s already scored a bounce for date %s',
                    self.internal_name(), member,
                    time.strftime('%d-%b-%Y', day + (0,0,0,0,1,0)))
@@ -189,6 +193,9 @@
                 info.reset(0, info.date, info.noticesleft)
             else:
                 self.disableBouncingMember(member, info, msg)
+        elif self.bounce_notify_owner_on_bounce_increment and first_today:
+            self.__sendAdminBounceNotice(member, msg,
+                                         did=_('bounce score incremented'))
         # We've set/changed bounce info above.  We now need to tell the
         # MemberAdaptor to set/update it.  We do it here in case the
         # MemberAdaptor stores bounce info externally to the list object to
@@ -218,7 +225,7 @@
         if self.bounce_notify_owner_on_disable:
             self.__sendAdminBounceNotice(member, msg)
 
-    def __sendAdminBounceNotice(self, member, msg):
+    def __sendAdminBounceNotice(self, member, msg, did=_('disabled')):
         # BAW: This is a bit kludgey, but we're not providing as much
         # information in the new admin bounce notices as we used to (some of
         # it was of dubious value).  However, we'll provide empty, strange, or
@@ -230,7 +237,7 @@
             {'listname' : self.real_name,
              'addr'     : member,
              'negative' : '',
-             'did'      : _('disabled'),
+             'did'      : did,
              'but'      : '',
              'reenable' : '',
              'owneraddr': siteowner,

=== modified file 'Mailman/Defaults.py.in'
--- Mailman/Defaults.py.in	2014-05-03 03:25:48 +0000
+++ Mailman/Defaults.py.in	2014-10-17 15:43:49 +0000
@@ -1348,6 +1348,10 @@
 # failed to match by the bounce detector?
 DEFAULT_BOUNCE_UNRECOGNIZED_GOES_TO_LIST_OWNER = Yes
 
+# Does the list owner get a copy of every recognized bounce that increments
+# the score for a list member but doesn't result in a disable or probe?
+DEFAULT_BOUNCE_NOTIFY_OWNER_ON_BOUNCE_INCREMENT = No
+
 # Notifications on bounce actions.  The first specifies whether the list owner
 # should get a notification when a member is disabled due to bouncing, while
 # the second specifies whether the owner should get one when the member is

=== modified file 'Mailman/Gui/Bounce.py'
--- Mailman/Gui/Bounce.py	2005-08-27 01:40:17 +0000
+++ Mailman/Gui/Bounce.py	2014-10-17 15:43:49 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2004 by the Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 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
@@ -142,6 +142,15 @@
              <a href="?VARHELP=autoreply/autoresponse_admin_text">autoresponse
              message</a> for email to the -owner and -admin address.""")),
 
+            ('bounce_notify_owner_on_bounce_increment', mm_cfg.Toggle,
+             (_('No'), _('Yes')), 0,
+             _("""Should Mailman notify you, the list owner, when bounces
+             cause a member's bounce score to be incremented?"""),
+             _("""Setting this value to <em>Yes</em> will cause Mailman to
+             send a notice including a copy of the bounce message to the list
+             owners whenever a bounce increments a member's bounce score but
+             doesn't cause a disable or a probe to be sent.""")),
+
             ('bounce_notify_owner_on_disable', mm_cfg.Toggle,
              (_('No'), _('Yes')), 0,
              _("""Should Mailman notify you, the list owner, when bounces

=== modified file 'Mailman/Version.py'
--- Mailman/Version.py	2014-05-03 03:25:48 +0000
+++ Mailman/Version.py	2014-10-17 15:43:49 +0000
@@ -37,7 +37,7 @@
                (REL_LEVEL << 4)  | (REL_SERIAL << 0))
 
 # config.pck schema version number
-DATA_FILE_VERSION = 105
+DATA_FILE_VERSION = 106
 
 # qfile/*.db schema version number
 QFILE_SCHEMA_VERSION = 3

=== modified file 'Mailman/versions.py'
--- Mailman/versions.py	2014-05-03 03:25:48 +0000
+++ Mailman/versions.py	2014-10-17 15:43:49 +0000
@@ -382,6 +382,9 @@
         'bounce_unrecognized_goes_to_list_owner',
         mm_cfg.DEFAULT_BOUNCE_UNRECOGNIZED_GOES_TO_LIST_OWNER)
     add_only_if_missing(
+        'bounce_notify_owner_on_bounce_increment',
+        mm_cfg.DEFAULT_BOUNCE_NOTIFY_OWNER_ON_BOUNCE_INCREMENT)
+    add_only_if_missing(
         'bounce_notify_owner_on_disable',
         mm_cfg.DEFAULT_BOUNCE_NOTIFY_OWNER_ON_DISABLE)
     add_only_if_missing(

=== modified file 'NEWS'
--- NEWS	2014-09-22 02:12:49 +0000
+++ NEWS	2014-10-17 15:43:49 +0000
@@ -51,6 +51,16 @@
 
 2.1.19 (xx-xxx-xxxx)
 
+  New Features
+
+    - There is a new list attribute in the Bounce processing section.
+      bounce_notify_owner_on_bounce_increment if set to Yes will cause
+      Mailman to notify the list owner on every bounce that increments a
+      list member's score but doesn't result in a probe or disable.  There
+      is a new configuration setting setting
+      DEFAULT_BOUNCE_NOTIFY_OWNER_ON_BOUNCE_INCREMENT to set the default
+      for new lists.  This in turn defaults to No.  (LP: #1382150)
+
   Changed behavior
 
     - Mailman's log files, request.pck files and heldmsg-* files are no

_______________________________________________
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org

Reply via email to