------------------------------------------------------------
revno: 1585
fixes bug: https://launchpad.net/bugs/1507241
committer: Mark Sapiro <m...@msapiro.net>
branch nick: 2.1
timestamp: Sat 2015-10-17 19:30:06 -0700
message:
  Invalid regexps in *_these_nonmembers, subscribe_auto_approval and
  ban_list are now logged.
modified:
  Mailman/MailList.py
  NEWS


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

Your team Mailman Checkins is subscribed to branch lp:mailman/2.1.
To unsubscribe from this branch go to 
https://code.launchpad.net/~mailman-coders/mailman/2.1/+edit-subscription
=== modified file 'Mailman/MailList.py'
--- Mailman/MailList.py	2015-10-16 04:06:52 +0000
+++ Mailman/MailList.py	2015-10-18 02:30:06 +0000
@@ -1604,9 +1604,19 @@
                     if re.search(pattern, email, re.IGNORECASE):
                         matched = pattern
                         break
-                except re.error:
+                except re.error, e:
                     # BAW: we should probably remove this pattern
-                    pass
+                    # The GUI won't add a bad regexp, but at least log it.
+                    # The following kludge works because the ban_list stuff
+                    # is the only caller with no at_list.
+                    attr_name = at_list or 'ban_list'
+                    syslog('error',
+                           '%s in %s has bad regexp "%s": %s',
+                           attr_name,
+                           self.internal_name(),
+                           pattern,
+                           str(e)
+                          )
             elif at_list and pattern.startswith('@'):
                 # XXX Needs to be reviewed for list@domain names.
                 # this refers to the members of another list in this

=== modified file 'NEWS'
--- NEWS	2015-10-16 04:06:52 +0000
+++ NEWS	2015-10-18 02:30:06 +0000
@@ -22,6 +22,9 @@
 
   Bug fixes and other patches
 
+    - Invalid regexps in *_these_nonmembers, subscribe_auto_approval and
+      ban_list are now logged.  (LP: #1507241)
+
     - Refactored the GetPattern list method to simplify extending @listname
       syntax to new attributes in the future.  Changed Moderate.py to use the
       GetPattern method to process the *_these_nonmembers lists.

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

Reply via email to