Barry Warsaw pushed to branch master at mailman / Mailman
Commits:
36d114b3 by Aurélien Bompard at 2016-07-19T11:08:17+02:00
Cover another header match import case
- - - - -
88212f9d by Barry Warsaw at 2016-11-26T05:13:49+00:00
Merge branch 'fix-import-header-filters' into 'master'
Cover another header match import case
This branch just covers one more import conversion case seen in the wild.
See merge request !163
- - - - -
2 changed files:
- src/mailman/utilities/importer.py
- src/mailman/utilities/tests/test_import.py
Changes:
=====================================
src/mailman/utilities/importer.py
=====================================
--- a/src/mailman/utilities/importer.py
+++ b/src/mailman/utilities/importer.py
@@ -336,7 +336,7 @@ def import_config_pck(mlist, config_dict):
for line_pattern in line_patterns.splitlines():
if len(line_pattern.strip()) == 0:
continue
- for sep in (': ', ':.', ':'):
+ for sep in (': ', ':.*', ':.', ':'):
header, sep, pattern = line_pattern.partition(sep)
if sep:
# We found it.
=====================================
src/mailman/utilities/tests/test_import.py
=====================================
--- a/src/mailman/utilities/tests/test_import.py
+++ b/src/mailman/utilities/tests/test_import.py
@@ -336,6 +336,7 @@ class TestBasicImport(unittest.TestCase):
('^Subject: dev-\r\n^Subject: staging-', 3, False),
('from: .*[email protected]\r\nfrom: .*@jw-express.com',
2, False),
+ ('^Subject:.*\\Wwas:\\W', 3, False),
('^Received: from smtp-.*\\.fedoraproject\\.org\r\n'
'^Received: from mx.*\\.redhat.com\r\n'
'^Resent-date:\r\n'
@@ -372,6 +373,7 @@ class TestBasicImport(unittest.TestCase):
('subject', 'staging-', 'discard'),
('from', '.*[email protected]', 'reject'),
('from', '.*@jw-express.com', 'reject'),
+ ('subject', '\\Wwas:\\W', 'discard'),
('received', 'from smtp-.*\\.fedoraproject\\.org', 'hold'),
('received', 'from mx.*\\.redhat.com', 'hold'),
('resent-date', '.*', 'hold'),
View it on GitLab:
https://gitlab.com/mailman/mailman/compare/86162ef47bbf9ab71faceed9eaa656ebb8e1ec63...88212f9d5c9a13e8e723d90a42f00d0f9b66d929
_______________________________________________
Mailman-checkins mailing list
[email protected]
Unsubscribe:
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org