Abhilash Raj pushed to branch master at GNU Mailman / Mailman Core


Commits:
a8abd15b by Mark Sapiro at 2019-05-07T18:48:32Z
Remove spurious 'invalid FilterAction: discard. Treating as discard' 
log msg.

- - - - -
71d69365 by Abhilash Raj at 2019-05-07T18:48:32Z
Merge branch 'discard' into 'master'

Remove spurious 'invalid FilterAction: discard. Treating as discard' 
log msg.

Closes #592

See merge request mailman/mailman!507
- - - - -


3 changed files:

- src/mailman/docs/NEWS.rst
- src/mailman/handlers/mime_delete.py
- src/mailman/handlers/tests/test_mimedel.py


Changes:

=====================================
src/mailman/docs/NEWS.rst
=====================================
@@ -22,6 +22,8 @@ Bugs
   ``CC`` will now be removed from ``CC`` even if this results in no ``CC``.
   (Closes #575)
 * ``X-Mailman-Approved-At`` header now has correct timezone.  (Closes #584)
+* A spurious ``invalid FilterAction: discard. Treating as discard`` log
+  message is eliminated.  (Closes #592)
 
 Command line
 ------------


=====================================
src/mailman/handlers/mime_delete.py
=====================================
@@ -80,6 +80,8 @@ message.
             filebase = config.switchboards['bad'].enqueue(msg, msgdata)
             log.info('{} preserved in file base {}'.format(
                 msg.get('message-id', 'n/a'), filebase))
+    elif mlist.filter_action is FilterAction.discard:
+        pass
     else:
         log.error(
             '{} invalid FilterAction: {}.  Treating as discard'.format(


=====================================
src/mailman/handlers/tests/test_mimedel.py
=====================================
@@ -103,6 +103,13 @@ Message-ID: <ant>
         # There should be no messages in the 'bad' queue.
         get_queue_messages('bad', expected_count=0)
 
+    def test_dispose_discard_no_spurious_log(self):
+        self._mlist.filter_action = FilterAction.discard
+        mark = LogFileMark('mailman.error')
+        with self.assertRaises(DiscardMessage):
+            mime_delete.dispose(self._mlist, self._msg, {}, 'discarding')
+        self.assertEqual(mark.readline(), '')
+
     def test_dispose_bounce(self):
         self._mlist.filter_action = FilterAction.reject
         with self.assertRaises(RejectMessage) as cm:



View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/8e1cf75fcffca0d2e9a3abd21446416c57180df8...71d693654db95c3da4fff83db91b834070c3cc0a

-- 
View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/8e1cf75fcffca0d2e9a3abd21446416c57180df8...71d693654db95c3da4fff83db91b834070c3cc0a
You're receiving this email because of your account on gitlab.com.


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

Reply via email to