diff --git a/mailman-3.3.8.tar.gz b/mailman-3.3.8.tar.gz deleted file mode 100644 index f0165b590d0b5edee3804873b8332e0356872053..0000000000000000000000000000000000000000 Binary files a/mailman-3.3.8.tar.gz and /dev/null differ diff --git a/mailman-3.3.9.tar.gz b/mailman-3.3.9.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..c88568d8433815543c8fa7103ae85f5508617ea5 Binary files /dev/null and b/mailman-3.3.9.tar.gz differ diff --git a/mailman-subject-prefix.patch b/mailman-subject-prefix.patch deleted file mode 100644 index c57a6e22c18e27f6e2cde0cc8114e285650a349a..0000000000000000000000000000000000000000 --- a/mailman-subject-prefix.patch +++ /dev/null @@ -1,192 +0,0 @@ -From d54000d8223e6f1567f669f72cb09970491fdbb2 Mon Sep 17 00:00:00 2001 -From: Neal Gompa -Date: Sat, 13 May 2023 07:27:41 -0400 -Subject: [PATCH] Cover subject prefix cases for empty subjects and non-ascii - charsets -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -The subject_prefix handler has several bugs around empty subjects -and lacked coverage for lists with a non-ascii charset. - -Co-authored-by: Aurélien Bompard -Signed-off-by: Neal Gompa ---- - src/mailman/handlers/subject_prefix.py | 6 +- - .../handlers/tests/test_subject_prefix.py | 82 +++++++++++++++++-- - 2 files changed, 78 insertions(+), 10 deletions(-) - -diff --git a/src/mailman/handlers/subject_prefix.py b/src/mailman/handlers/subject_prefix.py -index 577149cee..a20b45115 100644 ---- a/src/mailman/handlers/subject_prefix.py -+++ b/src/mailman/handlers/subject_prefix.py -@@ -39,12 +39,11 @@ def ascii_header(mlist, msgdata, subject, prefix, prefix_pattern, ws): - if charset not in ASCII_CHARSETS: - return None - subject_text = EMPTYSTRING.join(str(subject).splitlines()) -+ subject_text = re.sub(prefix_pattern, '', subject_text) - # Replace empty subject. - if subject_text.strip() == '': - with _.using(mlist.preferred_language.code): - subject_text = _('(no subject)') -- else: -- subject_text = re.sub(prefix_pattern, '', subject_text) - msgdata['stripped_subject'] = subject_text - rematch = re.match(RE_PATTERN, subject_text, re.I) - if rematch: -@@ -85,12 +84,11 @@ def all_same_charset(mlist, msgdata, subject, prefix, prefix_pattern, ws): - except UnicodeEncodeError: - return None - subject_text = EMPTYSTRING.join(chunks) -+ subject_text = re.sub(prefix_pattern, '', subject_text) - # Replace empty subject. - if subject_text.strip() == '': - with _.using(mlist.preferred_language.code): - subject_text = _('(no subject)') -- else: -- subject_text = re.sub(prefix_pattern, '', subject_text) - msgdata['stripped_subject'] = subject_text - rematch = re.match(RE_PATTERN, subject_text, re.I) - if rematch: -diff --git a/src/mailman/handlers/tests/test_subject_prefix.py b/src/mailman/handlers/tests/test_subject_prefix.py -index 0b13f5068..960afa49a 100644 ---- a/src/mailman/handlers/tests/test_subject_prefix.py -+++ b/src/mailman/handlers/tests/test_subject_prefix.py -@@ -34,6 +34,13 @@ class TestSubjectPrefix(unittest.TestCase): - def setUp(self): - self._mlist = create_list('test@example.com') - self._process = config.handlers['subject-prefix'].process -+ language_manager = getUtility(ILanguageManager) -+ if 'xx' not in language_manager: -+ language_manager.add('xx', 'utf-8', 'Freedonia') -+ -+ def tearDown(self): -+ # The LanguageManager may need a 'remove' method. -+ del getUtility(ILanguageManager)._languages['xx'] - - def test_isdigest(self): - # If the message is destined for the digest, the Subject header does -@@ -115,6 +122,15 @@ class TestSubjectPrefix(unittest.TestCase): - self._process(self._mlist, msg, {}) - self.assertEqual(str(msg['subject']), '[Test] A test message') - -+ def test_multiline_subject_non_ascii_list(self): -+ # The subject appears on multiple lines on a non-ascii list. -+ self._mlist.preferred_language = 'xx' -+ self._mlist.preferred_language.charset = 'utf-8' -+ msg = Message() -+ msg['Subject'] = '\n A test message' -+ self._process(self._mlist, msg, {}) -+ self.assertEqual(str(msg['subject']), '[Test] A test message') -+ - def test_i18n_prefix(self): - # The Subject header is encoded, but the prefix is still added. - msg = Message() -@@ -131,7 +147,7 @@ class TestSubjectPrefix(unittest.TestCase): - msg['Subject'] = '[Test] ' - self._process(self._mlist, msg, {}) - subject = msg['subject'] -- self.assertEqual(str(subject), '[Test] ') -+ self.assertEqual(str(subject), '[Test] (no subject)') - - def test_prefix_only_all_same(self): - # Incoming subject is only the prefix. -@@ -142,7 +158,7 @@ class TestSubjectPrefix(unittest.TestCase): - self._process(self._mlist, msg, {}) - self._mlist.preferred_language.charset = old_charset - subject = msg['subject'] -- self.assertEqual(str(subject), '[Test] ') -+ self.assertEqual(str(subject), '[Test] (no subject)') - - def test_prefix_only_mixed(self): - # Incoming subject is only the prefix. -@@ -150,7 +166,7 @@ class TestSubjectPrefix(unittest.TestCase): - msg['Subject'] = '=?utf-8?Q?[Test]_?=' - self._process(self._mlist, msg, {}) - subject = msg['subject'] -- self.assertEqual(str(subject), '[Test] ') -+ self.assertEqual(str(subject), '[Test] (no subject)') - - def test_re_only(self): - # Incoming subject is only Re:. -@@ -226,15 +242,13 @@ class TestSubjectPrefix(unittest.TestCase): - def test_decode_header_returns_string(self): - # Under some circumstances, email.header.decode_header() returns a - # string value. Ensure we can handle that. -- manager = getUtility(ILanguageManager) -- manager.add('xx', 'iso-8859-1', 'Xlandia') - self._mlist.preferred_language = 'xx' - msg = Message() - msg['Subject'] = 'Plain text' - self._process(self._mlist, msg, {}) - subject = msg['subject'] - self.assertEqual(subject.encode(), -- '=?iso-8859-1?q?=5BTest=5D_Plain_text?=') -+ '=?utf-8?q?=5BTest=5D_Plain_text?=') - - def test_unknown_encoded_subject(self): - msg = Message() -@@ -280,3 +294,59 @@ class TestSubjectPrefix(unittest.TestCase): - self._process(self._mlist, msg, {}) - self.assertEqual(str(msg['subject']), - '[Test] This is a folded subject header.') -+ -+ def test_non_ascii_list(self): -+ # The mailing list has a non-ascii language -+ self._mlist.preferred_language = 'xx' -+ msg = Message() -+ msg['Subject'] = 'A test message' -+ self._process(self._mlist, msg, {}) -+ self.assertEqual(str(msg['subject']), '[Test] A test message') -+ -+ def test_no_subject(self): -+ # The email has no subject -+ msg = Message() -+ msg['Subject'] = '' -+ self._process(self._mlist, msg, {}) -+ self.assertEqual(str(msg['subject']), '[Test] (no subject)') -+ -+ def test_no_subject_non_ascii_list(self): -+ # The email has no subject on a non-ascii list -+ self._mlist.preferred_language = 'xx' -+ msg = Message() -+ msg['Subject'] = '' -+ self._process(self._mlist, msg, {}) -+ self.assertEqual(str(msg['subject']), '[Test] (no subject)') -+ -+ def test_no_real_subject(self): -+ # The email has no subject -+ msg = Message() -+ msg['Subject'] = '[Test] ' -+ self._process(self._mlist, msg, {}) -+ self.assertEqual(str(msg['subject']), '[Test] (no subject)') -+ -+ def test_no_real_subject_non_ascii_list(self): -+ # The email has no subject on a non-ascii list -+ self._mlist.preferred_language = 'xx' -+ msg = Message() -+ msg['Subject'] = '[Test] ' -+ self._process(self._mlist, msg, {}) -+ self.assertEqual(str(msg['subject']), '[Test] (no subject)') -+ -+ def test_non_ascii_subject_and_list(self): -+ # The mailing list has a non-ascii language and the subject is -+ # non-ascii with the same encoding. -+ self._mlist.preferred_language = 'xx' -+ msg = Message() -+ msg['Subject'] = '=?utf-8?q?d=C3=A9sirable?=' -+ self._process(self._mlist, msg, {}) -+ self.assertEqual(str(msg['subject']), '[Test] d\xe9sirable') -+ -+ def test_non_ascii_empty_subject_and_non_ascii_list(self): -+ # The mailing list has a non-ascii language and the subject is -+ # non-ascii with the same encoding, but actually empty. -+ self._mlist.preferred_language = 'xx' -+ msg = Message() -+ msg['Subject'] = '=?utf-8?q?[Test]_?=' -+ self._process(self._mlist, msg, {}) -+ self.assertEqual(str(msg['subject']), '[Test] (no subject)') --- -2.40.0 - diff --git a/mailman-use-either-importlib_resources-or-directly-importlib.patch b/mailman-use-either-importlib_resources-or-directly-importlib.patch deleted file mode 100644 index c133d607e09fbd554757a9b62a68b3e64ea4858a..0000000000000000000000000000000000000000 --- a/mailman-use-either-importlib_resources-or-directly-importlib.patch +++ /dev/null @@ -1,73 +0,0 @@ -From dd56f4a645d65b8022a07dd37bb803250a157ea8 Mon Sep 17 00:00:00 2001 -From: Neal Gompa -Date: Sat, 13 May 2023 08:04:39 -0400 -Subject: [PATCH] Use importlib.resources for Python 3.9+ and - importlib_resources otherwise - -This makes it possible to use Mailman 3 in environments where importlib_resources -is not available. - -Signed-off-by: Neal Gompa ---- - setup.py | 2 +- - src/mailman/__init__.py | 5 +++++ - src/mailman/testing/__init__.py | 23 +++++++++++++++++++++++ - 3 files changed, 29 insertions(+), 1 deletion(-) - -diff --git a/setup.py b/setup.py -index 5448b7cf9..c3d0f83fe 100644 ---- a/setup.py -+++ b/setup.py -@@ -121,7 +121,7 @@ case second 'm'. Any other spelling is incorrect.""", - 'flufl.bounce>=4.0', - 'flufl.i18n>=3.2', - 'flufl.lock>=5.1', -- 'importlib_resources>=1.1.0', -+ 'importlib_resources>=1.1.0 ; python_version<"3.9"', - 'gunicorn', - 'lazr.config', - 'python-dateutil>=2.0', -diff --git a/src/mailman/__init__.py b/src/mailman/__init__.py -index ad94ffdbd..0d78b38ea 100644 ---- a/src/mailman/__init__.py -+++ b/src/mailman/__init__.py -@@ -37,3 +37,8 @@ if 'build_sphinx' not in sys.argv: # pragma: nocover - else: - from mailman.core.i18n import initialize - initialize() -+ -+# Switch over to the internal importlib.resources module on Python 3.9+ -+if sys.version_info >= (3, 9, 0): -+ import importlib.resources -+ sys.modules['importlib_resources'] = importlib.resources -diff --git a/src/mailman/testing/__init__.py b/src/mailman/testing/__init__.py -index e69de29bb..2b2ed536a 100644 ---- a/src/mailman/testing/__init__.py -+++ b/src/mailman/testing/__init__.py -@@ -0,0 +1,23 @@ -+# Copyright (C) 2009-2020 by the Free Software Foundation, Inc. -+# -+# This file is part of GNU Mailman. -+# -+# GNU Mailman 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 3 of the License, or (at your option) -+# any later version. -+# -+# GNU Mailman 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 -+# GNU Mailman. If not, see . -+ -+import sys -+ -+# Switch over to the internal importlib.resources module on Python 3.9+ -+if sys.version_info >= (3, 9, 0): -+ import importlib.resources -+ sys.modules['importlib_resources'] = importlib.resources --- -2.40.0 - diff --git a/mailman.spec b/mailman.spec index b0097e397909ab42d84a7cb1f2894b762e385a31..47c80a7bfd2a362cf20cfb78a2dc5c52cc2594a8 100644 --- a/mailman.spec +++ b/mailman.spec @@ -6,8 +6,8 @@ %{?python_enable_dependency_generator} Name: mailman -Version: 3.3.8 -Release: 2 +Version: 3.3.9 +Release: 1 Epoch: 3 Summary: The GNU mailing list manager License: GPLv3 @@ -19,8 +19,6 @@ Source3: mailman3.service Source4: mailman3.logrotate Source5: mailman3-digests.service Source6: mailman3-digests.timer -Patch0001: mailman-subject-prefix.patch -Patch0002: mailman-use-either-importlib_resources-or-directly-importlib.patch BuildArch: noarch BuildRequires: glibc-langpack-en BuildRequires: python%{python3_pkgversion}-devel >= 3.5 python%{python3_pkgversion}-setuptools @@ -205,6 +203,13 @@ done %{_datadir}/selinux/*/mailman3.pp %changelog +* Tue Jul 09 2024 yaoxin - 3:3.3.9-1 +- Update to 3.3.9 + * Python 3.9 is now the minimum supported version of Python. + * config.mta.remove_dkim_headers now applies to messages to -owner. + * Bogus Message-ID headers that have been observed in the wild are now fixed. +- Please see log: https://docs.mailman3.org/projects/mailman/en/latest/src/mailman/docs/NEWS.html#news-3-3-9 + * Mon Dec 25 2023 wangkai <13474090681@163.com> - 3:3.3.8-2 - Fix install error due to flufl.i18n,flufl.lock upgrade