Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-mailman-hyperkitty for openSUSE:Factory checked in at 2021-11-20 02:38:49 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-mailman-hyperkitty (Old) and /work/SRC/openSUSE:Factory/.python-mailman-hyperkitty.new.1895 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-mailman-hyperkitty" Sat Nov 20 02:38:49 2021 rev:3 rq:932256 version:1.2.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-mailman-hyperkitty/python-mailman-hyperkitty.changes 2021-05-10 15:40:38.477260343 +0200 +++ /work/SRC/openSUSE:Factory/.python-mailman-hyperkitty.new.1895/python-mailman-hyperkitty.changes 2021-11-20 02:39:53.136632572 +0100 @@ -1,0 +2,8 @@ +Wed Nov 17 08:25:00 UTC 2021 - Andreas Schneider <a...@cryptomilk.org> + +- Update to version 1.2.0 + * Update the authentication to call Hyperkitty using the API key as a part of + Authorization HTTP header instead of url parameter. +- Removed obsolete python-mailman-hyperkitty-reflect-changes-in-mailman-core.patch + +------------------------------------------------------------------- Old: ---- mailman-hyperkitty-1.1.0.tar.gz python-mailman-hyperkitty-reflect-changes-in-mailman-core.patch New: ---- mailman-hyperkitty-1.2.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-mailman-hyperkitty.spec ++++++ --- /var/tmp/diff_new_pack.GLIR0D/_old 2021-11-20 02:39:53.652630869 +0100 +++ /var/tmp/diff_new_pack.GLIR0D/_new 2021-11-20 02:39:53.656630856 +0100 @@ -20,14 +20,12 @@ # mailman is built only for primary python3 flavor %define pythons python3 Name: python-mailman-hyperkitty -Version: 1.1.0 +Version: 1.2.0 Release: 0 Summary: Mailman archiver plugin for HyperKitty License: GPL-3.0-only URL: https://gitlab.com/mailman/mailman-hyperkitty/ Source: https://files.pythonhosted.org/packages/source/m/mailman-hyperkitty/mailman-hyperkitty-%{version}.tar.gz -# https://gitlab.com/mailman/mailman-hyperkitty/commit/84e05811fb71aa105fd85fd14399bff813ed744d -Patch0: python-mailman-hyperkitty-reflect-changes-in-mailman-core.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -55,8 +53,7 @@ Mailman archiver plugin for HyperKitty %prep -%setup -q -n mailman-hyperkitty-%{version} -%patch0 -p1 +%autosetup -n mailman-hyperkitty-%{version} -p1 %build %python_build ++++++ mailman-hyperkitty-1.1.0.tar.gz -> mailman-hyperkitty-1.2.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mailman-hyperkitty-1.1.0/PKG-INFO new/mailman-hyperkitty-1.2.0/PKG-INFO --- old/mailman-hyperkitty-1.1.0/PKG-INFO 2017-05-26 11:59:51.000000000 +0200 +++ new/mailman-hyperkitty-1.2.0/PKG-INFO 2021-10-13 06:42:27.616553500 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: mailman-hyperkitty -Version: 1.1.0 +Version: 1.2.0 Summary: Mailman archiver plugin for HyperKitty Home-page: https://gitlab.com/mailman/mailman-hyperkitty/ Author: HyperKitty Developers @@ -21,11 +21,24 @@ provided by the ``HyperKitty`` python package. It is also available online at the following URL: http://hyperkitty.readthedocs.org. + All documentation on installing HyperKitty Plugin can be found in the + documentation provided by the following URL: + http://hyperkitty.readthedocs.io/en/latest/install.html#connecting-to-mailman. + The source code is available on GitLab https://gitlab.com/mailman/mailman-hyperkitty. It is developed by the same people who develop HyperKitty, so you can use the same communication channels to reach them. + Changelog + ========= + + 1.2.0 + ----- + + - Update the authentication to call Hyperkitty using the API key as a part of + Authorization HTTP header instead of url parameter. + Copyright & Licensing ===================== @@ -33,7 +46,7 @@ This module is licensed under the `GPL v3.0 <http://www.gnu.org/licenses/gpl-3.0.html>`_ - Copyright (C) 2014-2017 by the Free Software Foundation, Inc. + Copyright (C) 2014-2021 by the Free Software Foundation, Inc. Keywords: email Platform: UNKNOWN diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mailman-hyperkitty-1.1.0/README.rst new/mailman-hyperkitty-1.2.0/README.rst --- old/mailman-hyperkitty-1.1.0/README.rst 2017-05-26 11:48:07.000000000 +0200 +++ new/mailman-hyperkitty-1.2.0/README.rst 2021-10-13 06:42:16.000000000 +0200 @@ -13,11 +13,24 @@ provided by the ``HyperKitty`` python package. It is also available online at the following URL: http://hyperkitty.readthedocs.org. +All documentation on installing HyperKitty Plugin can be found in the +documentation provided by the following URL: +http://hyperkitty.readthedocs.io/en/latest/install.html#connecting-to-mailman. + The source code is available on GitLab https://gitlab.com/mailman/mailman-hyperkitty. It is developed by the same people who develop HyperKitty, so you can use the same communication channels to reach them. +Changelog +========= + +1.2.0 +----- + +- Update the authentication to call Hyperkitty using the API key as a part of + Authorization HTTP header instead of url parameter. + Copyright & Licensing ===================== @@ -25,4 +38,4 @@ This module is licensed under the `GPL v3.0 <http://www.gnu.org/licenses/gpl-3.0.html>`_ -Copyright (C) 2014-2017 by the Free Software Foundation, Inc. +Copyright (C) 2014-2021 by the Free Software Foundation, Inc. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mailman-hyperkitty-1.1.0/mailman-hyperkitty.cfg new/mailman-hyperkitty-1.2.0/mailman-hyperkitty.cfg --- old/mailman-hyperkitty-1.1.0/mailman-hyperkitty.cfg 2015-08-19 16:03:45.000000000 +0200 +++ new/mailman-hyperkitty-1.2.0/mailman-hyperkitty.cfg 2021-10-13 06:41:42.000000000 +0200 @@ -13,6 +13,8 @@ # address will be used by Mailman to forward incoming emails to HyperKitty # for archiving. It does not need to be publicly available, in fact it's # better if it is not. +# However, if your Mailman installation is accessed via HTTPS, the URL needs +# to match your SSL certificate (e.g. https://lists.example.com/hyperkitty). base_url: http://localhost/hyperkitty/ # Shared API key, must be the identical to the value in HyperKitty's diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mailman-hyperkitty-1.1.0/mailman3-hyperkitty.spec new/mailman-hyperkitty-1.2.0/mailman3-hyperkitty.spec --- old/mailman-hyperkitty-1.1.0/mailman3-hyperkitty.spec 2015-08-19 16:17:56.000000000 +0200 +++ new/mailman-hyperkitty-1.2.0/mailman3-hyperkitty.spec 2021-08-20 22:11:38.000000000 +0200 @@ -5,15 +5,16 @@ %endif %global upstream_name mailman-hyperkitty +%global prerel 1 Name: mailman3-hyperkitty -Version: 1.0.0 -Release: 1%{?dist} +Version: 1.1.1 +Release: %{?prerel:0.}1%{?dist} Summary: Mailman archiver plugin for HyperKitty License: GPLv3 URL: https://gitlab.com/mailman/%{upstream_name} -Source0: https://pypi.python.org/packages/source/m/%{upstream_name}/%{upstream_name}-%{version}.tar.gz +Source0: https://pypi.python.org/packages/source/m/%{upstream_name}/%{upstream_name}-%{version}%{?prerel:.dev0}.tar.gz BuildArch: noarch @@ -39,7 +40,7 @@ %prep -%setup -q -n %{upstream_name}-%{version} +%setup -q -n %{upstream_name}-%{version}%{?prerel:.dev0} %build @@ -56,7 +57,7 @@ %check -%{__python3} setup.py test +%{__python3} -m nose2 %files @@ -66,6 +67,9 @@ %changelog +* Mon May 29 2017 Aurelien Bompard <abomp...@fedoraproject.org> - 1.1.0-1 +- version 1.1.0 + * Wed Apr 29 2015 Aurelien Bompard <abomp...@fedoraproject.org> - 1.0.0-1 - version 1.0.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mailman-hyperkitty-1.1.0/mailman_hyperkitty/__init__.py new/mailman-hyperkitty-1.2.0/mailman_hyperkitty/__init__.py --- old/mailman-hyperkitty-1.1.0/mailman_hyperkitty/__init__.py 2017-05-26 11:48:07.000000000 +0200 +++ new/mailman-hyperkitty-1.2.0/mailman_hyperkitty/__init__.py 2021-10-13 06:42:16.000000000 +0200 @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 1998-2017 by the Free Software Foundation, Inc. +# Copyright (C) 2012-2019 by the Free Software Foundation, Inc. # # This file is part of HyperKitty. # @@ -24,8 +24,6 @@ This will be imported by Mailman Core and must thus be Python3-compatible. """ -from __future__ import absolute_import, unicode_literals - import os import requests import traceback @@ -68,8 +66,8 @@ return self._conf["base_url"] @property - def api_key(self): - return self._conf["api_key"] + def headers(self): + return {"Authorization": "Token {}".format(self._conf["api_key"])} def _load_conf(self): """ @@ -87,9 +85,8 @@ self._conf["api_key"] = archiver_config.get("general", "api_key") def _get_url(self, mlist, params): - params.update({"key": self.api_key}) url = urljoin(self.base_url, "api/mailman/urls") - result = requests.get(url, params=params) + result = requests.get(url, params=params, headers=self.headers) if result.status_code != 200: logger.error("HyperKitty failure on %s: %s (%s)", url, result.text, result.status_code) @@ -196,7 +193,7 @@ return # permanent error, don't raise try: result = requests.post( - url, params={"key": self.api_key}, + url, headers=self.headers, data={"mlist": mlist.fqdn_listname}, files={"message": ("message.txt", message_text)}) except requests.exceptions.RequestException as error: @@ -225,7 +222,7 @@ If the archiving is successful, remove them from the queue, otherwise re-enqueue them. """ - self._switchboard.recover_backup_files + self._switchboard.recover_backup_files() files = self._switchboard.files for filebase in files: logger.debug('HyperKitty archiver processing queued filebase: %s', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mailman-hyperkitty-1.1.0/mailman_hyperkitty/tests/test_archiver.py new/mailman-hyperkitty-1.2.0/mailman_hyperkitty/tests/test_archiver.py --- old/mailman-hyperkitty-1.1.0/mailman_hyperkitty/tests/test_archiver.py 2017-05-26 11:48:07.000000000 +0200 +++ new/mailman-hyperkitty-1.2.0/mailman_hyperkitty/tests/test_archiver.py 2021-10-13 06:42:16.000000000 +0200 @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 1998-2017 by the Free Software Foundation, Inc. +# Copyright (C) 2012-2019 by the Free Software Foundation, Inc. # # This file is part of HyperKitty. # @@ -26,6 +26,8 @@ import os import tempfile import shutil +from email import message_from_bytes +from email.utils import _sanitize from textwrap import dedent from unittest import TestCase @@ -102,10 +104,10 @@ self.requests_patcher = patch("mailman_hyperkitty.requests") self.requests = self.requests_patcher.start() self.fake_response = None - self.requests.get.side_effect = \ - lambda url, *a, **kw: self.fake_response - self.requests.post.side_effect = \ - lambda url, *a, **kw: self.fake_response + self.requests.get.side_effect = ( + lambda url, *a, **kw: self.fake_response) + self.requests.post.side_effect = ( + lambda url, *a, **kw: self.fake_response) def tearDown(self): self.requests_patcher.stop() @@ -118,6 +120,34 @@ msg.set_payload("Dummy message") return msg + def _get_msg2(self): + # Create a MIME message with non-ascii in the prologue. + msg = message_from_bytes(b"""\ +From: du...@example.com +Message-ID: <dummy> +Message-ID-Hash: QKODQBCADMDSP5YPOPKECXQWEQAMXZL3 +MIME-Version: 1.0 +Content-Type: multipart/alternative; boundary="zzz123" + +Ce message est au format MIME. Comme votre logiciel de courrier ne comprend +pas ce format, tout ou partie de ce message pourrait \xc3\xaatre illisible. + +--zzz123 +Content-Type: text/plain; charset="us-ascii" +Content-Transfer-Encoding: 7bit + +Plain Text + +--zzz123 +Content-Type: text/html; charset="us-ascii" +Content-Transfer-Encoding: 7bit + +Not really HTML + +--zzz123-- +""", Message) + return(msg) + def test_list_url(self): self.fake_response = FakeResponse( 200, {"url": "http://example.com/list/l...@lists.example.com/"}) @@ -127,7 +157,8 @@ ) self.requests.get.assert_called_with( "http://localhost/api/mailman/urls", - params={'key': 'DummyKey', 'mlist': 'l...@lists.example.com'} + params={'mlist': 'l...@lists.example.com'}, + headers={'Authorization': 'Token DummyKey'}, ) def test_permalink(self): @@ -138,8 +169,10 @@ self.assertEqual(self.archiver.permalink(self.mlist, msg), url) self.requests.get.assert_called_with( "http://localhost/api/mailman/urls", - params={'key': 'DummyKey', 'msgid': 'dummy', - 'mlist': 'l...@lists.example.com'} + params={'msgid': 'dummy', + 'mlist': 'l...@lists.example.com'}, + headers={'Authorization': 'Token DummyKey'}, + ) def test_archive_message(self): @@ -153,7 +186,7 @@ self.assertEqual(archive_url, url) self.requests.post.assert_called_with( "http://localhost/api/mailman/archive", - params={'key': 'DummyKey'}, + headers={'Authorization': 'Token DummyKey'}, data={'mlist': 'l...@lists.example.com'}, files={'message': ('message.txt', msg.as_string())}, ) @@ -166,6 +199,30 @@ self.archiver._switchboard.queue_directory)), 0) self.assertEqual(len(self.archiver._switchboard.files), 0) + def test_archive_message_with_surrogates(self): + msg = self._get_msg2() + url = ("http://example.com/list/l...@lists.example.com/" + "message/{}/".format(msg["Message-ID-Hash"])) + self.fake_response = FakeResponse(200, {"url": url}) + with patch("mailman_hyperkitty.logger") as logger: + archive_url = self.archiver.archive_message(self.mlist, msg) + self.assertTrue(logger.info.called) + self.assertEqual(archive_url, url) + self.requests.post.assert_called_with( + "http://localhost/api/mailman/archive", + headers={'Authorization': 'Token DummyKey'}, + data={'mlist': 'l...@lists.example.com'}, + files={'message': ('message.txt', _sanitize(msg.as_string()))}, + ) + # Check that the archive directory was created. + self.assertTrue(os.path.exists( + self.archiver._switchboard.queue_directory)) + # Make sure it is empty, since the message has been successfuly + # archived. + self.assertEqual(len(os.listdir( + self.archiver._switchboard.queue_directory)), 0) + self.assertEqual(len(self.archiver._switchboard.files), 0) + def test_list_url_permalink_error(self): # Don't raise exceptions for list_url and permalink self.fake_response = FakeResponse(500, "Fake error") @@ -259,12 +316,12 @@ self.assertEqual(self.requests.post.call_args_list, [ (("http://localhost/api/mailman/archive",), dict( - params={'key': 'DummyKey'}, + headers={'Authorization': 'Token DummyKey'}, data={'mlist': 'l...@lists.example.com'}, files={'message': ('message.txt', msg_1.as_string())}, )), (("http://localhost/api/mailman/archive",), dict( - params={'key': 'DummyKey'}, + headers={'Authorization': 'Token DummyKey'}, data={'mlist': 'l...@lists.example.com'}, files={'message': ('message.txt', msg_2.as_string())}, )), @@ -345,19 +402,14 @@ self.archiver._switchboard.queue_directory)), 1) self.assertEqual(len(self.archiver._switchboard.files), 1) - def test_archive_message_unserializable(self): + def test_archive_message_unserializable_raises_no_errors(self): + self.fake_response = FakeResponse(200, {"url": "dummy"}) msg = self._get_msg() msg["content-type"] = 'text/plain; charset="UTF-8"' msg.set_payload(b"this contains encoded unicode \xc3\xa9 \xc3\xa0") - # If you try to serialize this message to text, it will cause a: - # KeyError: 'content-transfer-encoding' + # If you try to serialize this message to text, Mailman should be able + # to prevent KeyError by ignoring the bad-characters. with patch("mailman_hyperkitty.logger") as logger: self.archiver.archive_message(self.mlist, msg) - # Check error log - self.assertEqual(logger.error.call_count, 1) - self.assertTrue(isinstance( - logger.error.call_args_list[0][0][2], KeyError)) - # Check that the message is not stored in the spool. - self.assertEqual(len(os.listdir( - self.archiver._switchboard.queue_directory)), 0) - self.assertEqual(len(self.archiver._switchboard.files), 0) + # Check no errors in the log. + self.assertEqual(logger.error.call_count, 0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mailman-hyperkitty-1.1.0/mailman_hyperkitty.egg-info/PKG-INFO new/mailman-hyperkitty-1.2.0/mailman_hyperkitty.egg-info/PKG-INFO --- old/mailman-hyperkitty-1.1.0/mailman_hyperkitty.egg-info/PKG-INFO 2017-05-26 11:59:50.000000000 +0200 +++ new/mailman-hyperkitty-1.2.0/mailman_hyperkitty.egg-info/PKG-INFO 2021-10-13 06:42:27.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: mailman-hyperkitty -Version: 1.1.0 +Version: 1.2.0 Summary: Mailman archiver plugin for HyperKitty Home-page: https://gitlab.com/mailman/mailman-hyperkitty/ Author: HyperKitty Developers @@ -21,11 +21,24 @@ provided by the ``HyperKitty`` python package. It is also available online at the following URL: http://hyperkitty.readthedocs.org. + All documentation on installing HyperKitty Plugin can be found in the + documentation provided by the following URL: + http://hyperkitty.readthedocs.io/en/latest/install.html#connecting-to-mailman. + The source code is available on GitLab https://gitlab.com/mailman/mailman-hyperkitty. It is developed by the same people who develop HyperKitty, so you can use the same communication channels to reach them. + Changelog + ========= + + 1.2.0 + ----- + + - Update the authentication to call Hyperkitty using the API key as a part of + Authorization HTTP header instead of url parameter. + Copyright & Licensing ===================== @@ -33,7 +46,7 @@ This module is licensed under the `GPL v3.0 <http://www.gnu.org/licenses/gpl-3.0.html>`_ - Copyright (C) 2014-2017 by the Free Software Foundation, Inc. + Copyright (C) 2014-2021 by the Free Software Foundation, Inc. Keywords: email Platform: UNKNOWN diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mailman-hyperkitty-1.1.0/mailman_hyperkitty.egg-info/SOURCES.txt new/mailman-hyperkitty-1.2.0/mailman_hyperkitty.egg-info/SOURCES.txt --- old/mailman-hyperkitty-1.1.0/mailman_hyperkitty.egg-info/SOURCES.txt 2017-05-26 11:59:51.000000000 +0200 +++ new/mailman-hyperkitty-1.2.0/mailman_hyperkitty.egg-info/SOURCES.txt 2021-10-13 06:42:27.000000000 +0200 @@ -9,7 +9,6 @@ mailman_hyperkitty.egg-info/PKG-INFO mailman_hyperkitty.egg-info/SOURCES.txt mailman_hyperkitty.egg-info/dependency_links.txt -mailman_hyperkitty.egg-info/pbr.json mailman_hyperkitty.egg-info/requires.txt mailman_hyperkitty.egg-info/top_level.txt mailman_hyperkitty/tests/__init__.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mailman-hyperkitty-1.1.0/mailman_hyperkitty.egg-info/pbr.json new/mailman-hyperkitty-1.2.0/mailman_hyperkitty.egg-info/pbr.json --- old/mailman-hyperkitty-1.1.0/mailman_hyperkitty.egg-info/pbr.json 2015-08-19 16:10:36.000000000 +0200 +++ new/mailman-hyperkitty-1.2.0/mailman_hyperkitty.egg-info/pbr.json 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -{"git_version": "d261fb1", "is_release": false} \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mailman-hyperkitty-1.1.0/setup.cfg new/mailman-hyperkitty-1.2.0/setup.cfg --- old/mailman-hyperkitty-1.1.0/setup.cfg 2017-05-26 11:59:51.000000000 +0200 +++ new/mailman-hyperkitty-1.2.0/setup.cfg 2021-10-13 06:42:27.616727800 +0200 @@ -1,5 +1,4 @@ [egg_info] tag_build = tag_date = 0 -tag_svn_revision = 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mailman-hyperkitty-1.1.0/setup.py new/mailman-hyperkitty-1.2.0/setup.py --- old/mailman-hyperkitty-1.1.0/setup.py 2017-05-26 11:48:26.000000000 +0200 +++ new/mailman-hyperkitty-1.2.0/setup.py 2021-10-13 06:41:42.000000000 +0200 @@ -1,4 +1,4 @@ -# Copyright (C) 2014-2017 by the Free Software Foundation, Inc. +# Copyright (C) 2014-2019 by the Free Software Foundation, Inc. # # This file is part of HyperKitty. # @@ -24,7 +24,7 @@ setup( name = 'mailman-hyperkitty', - version = '1.1.0', + version = '1.2.0', description = 'Mailman archiver plugin for HyperKitty', long_description= open("README.rst").read(), author='HyperKitty Developers',