Hello community, here is the log from the commit of package python-imbox for openSUSE:Factory checked in at 2020-06-11 10:08:23 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-imbox (Old) and /work/SRC/openSUSE:Factory/.python-imbox.new.3606 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-imbox" Thu Jun 11 10:08:23 2020 rev:6 rq:813223 version:0.9.8 Changes: -------- --- /work/SRC/openSUSE:Factory/python-imbox/python-imbox.changes 2020-05-11 13:42:25.357255565 +0200 +++ /work/SRC/openSUSE:Factory/.python-imbox.new.3606/python-imbox.changes 2020-06-11 10:09:00.859993701 +0200 @@ -1,0 +2,9 @@ +Wed Jun 3 11:09:51 UTC 2020 - Sebastian Wagner <[email protected]> + +- update to version 0.9.8: + - IMPROVEMENTS: + - Fix imbox.delete regression ([#138](https://github.com/martinrusev/imbox/issues/138)) + - Fixed handling for attachments with filenames longer than 76 characters ([#186](https://github.com/martinrusev/imbox/pull/186)) - Contributed by @nirdrabkin + - Improved character encoding detection ([#184](https://github.com/martinrusev/imbox/pull/184)) - Contributed by @py-radicz + +------------------------------------------------------------------- Old: ---- imbox-0.9.7.tar.gz New: ---- imbox-0.9.8.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-imbox.spec ++++++ --- /var/tmp/diff_new_pack.yUNGmg/_old 2020-06-11 10:09:01.935997145 +0200 +++ /var/tmp/diff_new_pack.yUNGmg/_new 2020-06-11 10:09:01.939997158 +0200 @@ -19,17 +19,19 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 Name: python-imbox -Version: 0.9.7 +Version: 0.9.8 Release: 0 Summary: Python IMAP for Human beings License: MIT Group: Development/Languages/Python URL: https://github.com/martinrusev/imbox Source: https://files.pythonhosted.org/packages/source/i/imbox/imbox-%{version}.tar.gz +BuildRequires: %{python_module chardet} BuildRequires: %{python_module devel} BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros +Requires: python-chardet %python_subpackages %description ++++++ imbox-0.9.7.tar.gz -> imbox-0.9.8.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imbox-0.9.7/CHANGELOG.md new/imbox-0.9.8/CHANGELOG.md --- old/imbox-0.9.7/CHANGELOG.md 2020-05-03 13:55:23.000000000 +0200 +++ new/imbox-0.9.8/CHANGELOG.md 2020-06-02 20:22:34.000000000 +0200 @@ -1,3 +1,19 @@ +## 0.9.8 (02 June 2020) + +IMPROVEMENTS: + +* Fix imbox.delete regression ([#138](https://github.com/martinrusev/imbox/issues/138)) +* Fixed handling for attachments with filenames longer than 76 characters ([#186](https://github.com/martinrusev/imbox/pull/186)) - Contributed by @nirdrabkin +* Improved character encoding detection ([#184](https://github.com/martinrusev/imbox/pull/184)) - Contributed by @py-radicz + +## 0.9.7 (03 May 2020) + +IMPROVEMENTS: + +* Gmail: IMAP extension searches label and raw are not supported. +* Searches in mail bodies and UID ranges are now supported. +* Attachments have a Content-ID now (#174) + ## 0.9.6 (14 August 2018) IMPROVEMENTS: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imbox-0.9.7/PKG-INFO new/imbox-0.9.8/PKG-INFO --- old/imbox-0.9.7/PKG-INFO 2020-05-03 13:59:43.632998700 +0200 +++ new/imbox-0.9.8/PKG-INFO 2020-06-02 20:26:17.684740000 +0200 @@ -1,6 +1,6 @@ -Metadata-Version: 1.1 +Metadata-Version: 1.2 Name: imbox -Version: 0.9.7 +Version: 0.9.8 Summary: Python IMAP for Human beings Home-page: https://github.com/martinrusev/imbox Author: Martin Rusev @@ -20,7 +20,7 @@ Requirements ------------ - Python (3.3, 3.4, 3.5, 3.6) + Python (3.3, 3.4, 3.5, 3.6, 3.7) Installation @@ -188,3 +188,4 @@ Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 +Requires-Python: >=3.3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imbox-0.9.7/README.rst new/imbox-0.9.8/README.rst --- old/imbox-0.9.7/README.rst 2020-05-03 13:55:23.000000000 +0200 +++ new/imbox-0.9.8/README.rst 2020-06-02 18:09:31.000000000 +0200 @@ -12,7 +12,7 @@ Requirements ------------ -Python (3.3, 3.4, 3.5, 3.6) +Python (3.3, 3.4, 3.5, 3.6, 3.7) Installation diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imbox-0.9.7/imbox/__init__.py new/imbox-0.9.8/imbox/__init__.py --- old/imbox-0.9.7/imbox/__init__.py 2020-05-03 13:56:27.000000000 +0200 +++ new/imbox-0.9.8/imbox/__init__.py 2020-06-02 18:32:08.000000000 +0200 @@ -1,8 +1,3 @@ from imbox.imbox import Imbox -__version_info__ = (0, 9, 7) -__version__ = '.'.join([str(x) for x in __version_info__]) - - __all__ = ['Imbox'] - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imbox-0.9.7/imbox/imbox.py new/imbox-0.9.8/imbox/imbox.py --- old/imbox-0.9.7/imbox/imbox.py 2020-05-03 13:55:23.000000000 +0200 +++ new/imbox-0.9.8/imbox/imbox.py 2020-06-02 18:09:31.000000000 +0200 @@ -65,6 +65,7 @@ def delete(self, uid): logger.info( "Mark UID {} with \\Deleted FLAG and expunge.".format(int(uid))) + self.connection.uid('STORE', uid, '+FLAGS', '(\\Deleted)') self.connection.expunge() def copy(self, uid, destination_folder): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imbox-0.9.7/imbox/parser.py new/imbox-0.9.8/imbox/parser.py --- old/imbox-0.9.7/imbox/parser.py 2020-05-03 13:55:23.000000000 +0200 +++ new/imbox-0.9.8/imbox/parser.py 2020-06-02 18:17:27.000000000 +0200 @@ -2,6 +2,7 @@ import io import re import email +import chardet import base64 import quopri import sys @@ -108,17 +109,24 @@ if filename: attachment['filename'] = filename + filename_parts = [] for param in dispositions[1:]: if param: name, value = decode_param(param) - if 'file' in name: - attachment['filename'] = value[1:- - 1] if value.startswith('"') else value + # Check for split filename + s_name = name.split("*") + if s_name[0] == 'filename': + # If this is a split file name - use the number after the * as an index to insert this part + if len(s_name) > 1: + filename_parts.insert(int(s_name[1]),value[1:-1] if value.startswith('"') else value) + else: + filename_parts.insert(0,value[1:-1] if value.startswith('"') else value) if 'create-date' in name: attachment['create-date'] = value + attachment['filename'] = "".join(filename_parts) return attachment return None @@ -130,7 +138,10 @@ try: return content.decode(charset, 'ignore') except LookupError: - return content.decode(charset.replace("-", ""), 'ignore') + encoding = chardet.detect(content).get('encoding') + if encoding: + return content.decode(encoding, 'ignore') + return content except AttributeError: return content diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imbox-0.9.7/imbox/version.py new/imbox-0.9.8/imbox/version.py --- old/imbox-0.9.7/imbox/version.py 1970-01-01 01:00:00.000000000 +0100 +++ new/imbox-0.9.8/imbox/version.py 2020-06-02 20:23:03.000000000 +0200 @@ -0,0 +1,2 @@ +__version__ = "0.9.8" +VERSION = __version__.split('.') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imbox-0.9.7/imbox.egg-info/PKG-INFO new/imbox-0.9.8/imbox.egg-info/PKG-INFO --- old/imbox-0.9.7/imbox.egg-info/PKG-INFO 2020-05-03 13:59:43.000000000 +0200 +++ new/imbox-0.9.8/imbox.egg-info/PKG-INFO 2020-06-02 20:26:17.000000000 +0200 @@ -1,6 +1,6 @@ -Metadata-Version: 1.1 +Metadata-Version: 1.2 Name: imbox -Version: 0.9.7 +Version: 0.9.8 Summary: Python IMAP for Human beings Home-page: https://github.com/martinrusev/imbox Author: Martin Rusev @@ -20,7 +20,7 @@ Requirements ------------ - Python (3.3, 3.4, 3.5, 3.6) + Python (3.3, 3.4, 3.5, 3.6, 3.7) Installation @@ -188,3 +188,4 @@ Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 +Requires-Python: >=3.3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imbox-0.9.7/imbox.egg-info/SOURCES.txt new/imbox-0.9.8/imbox.egg-info/SOURCES.txt --- old/imbox-0.9.7/imbox.egg-info/SOURCES.txt 2020-05-03 13:59:43.000000000 +0200 +++ new/imbox-0.9.8/imbox.egg-info/SOURCES.txt 2020-06-02 20:26:17.000000000 +0200 @@ -10,10 +10,12 @@ imbox/parser.py imbox/query.py imbox/utils.py +imbox/version.py imbox.egg-info/PKG-INFO imbox.egg-info/SOURCES.txt imbox.egg-info/dependency_links.txt imbox.egg-info/not-zip-safe +imbox.egg-info/requires.txt imbox.egg-info/top_level.txt imbox/vendors/__init__.py imbox/vendors/gmail.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imbox-0.9.7/imbox.egg-info/requires.txt new/imbox-0.9.8/imbox.egg-info/requires.txt --- old/imbox-0.9.7/imbox.egg-info/requires.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/imbox-0.9.8/imbox.egg-info/requires.txt 2020-06-02 20:26:17.000000000 +0200 @@ -0,0 +1 @@ +chardet diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imbox-0.9.7/setup.py new/imbox-0.9.8/setup.py --- old/imbox-0.9.7/setup.py 2020-05-03 13:55:23.000000000 +0200 +++ new/imbox-0.9.8/setup.py 2020-06-02 18:32:55.000000000 +0200 @@ -1,17 +1,22 @@ from setuptools import setup import os -import imbox -version = imbox.__version__ +# Get version without importing, which avoids dependency issues +def get_version(): + import re + with open('imbox/version.py') as version_file: + return re.search(r"""__version__\s+=\s+(['"])(?P<version>.+?)\1""", + version_file.read()).group('version') def read(filename): return open(os.path.join(os.path.dirname(__file__), filename)).read() + setup( name='imbox', - version=version, + version=get_version(), description="Python IMAP for Human beings", long_description=read('README.rst'), keywords='email, IMAP, parsing emails', @@ -21,14 +26,18 @@ license='MIT', packages=['imbox', 'imbox.vendors'], package_dir={'imbox': 'imbox'}, + install_requires=[ + 'chardet', + ], + python_requires='>=3.3', zip_safe=False, - classifiers=( + classifiers=[ 'Programming Language :: Python', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', - ), + ], test_suite='tests', ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imbox-0.9.7/tests/parser_tests.py new/imbox-0.9.8/tests/parser_tests.py --- old/imbox-0.9.7/tests/parser_tests.py 2020-05-03 13:55:23.000000000 +0200 +++ new/imbox-0.9.8/tests/parser_tests.py 2020-06-02 18:09:31.000000000 +0200 @@ -274,6 +274,59 @@ --____NOIBTUQXSYRVOOAFLCHY____-- """ +raw_email_with_long_filename_attachment = b"""Delivered-To: [email protected] +Return-Path: <[email protected]> +Mime-Version: 1.0 +Date: Wed, 22 Mar 2017 15:21:55 -0500 +Message-ID: <[email protected]> +Subject: Re: Reaching Out About Peoples Home Equity +From: [email protected] +To: [email protected] +Content-Type: multipart/alternative; boundary="____NOIBTUQXSYRVOOAFLCHY____" + + +--____NOIBTUQXSYRVOOAFLCHY____ +Content-Type: text/plain; charset=iso-8859-15 +Content-Transfer-Encoding: quoted-printable +Content-Disposition: inline; + modification-date="Wed, 22 Mar 2017 15:21:55 -0500" + +Hello Chloe + +--____NOIBTUQXSYRVOOAFLCHY____ +Content-Type: multipart/related; boundary="____XTSWHCFJMONXSVGPVDLY____" + + +--____XTSWHCFJMONXSVGPVDLY____ +Content-Type: text/html; charset=iso-8859-15 +Content-Transfer-Encoding: quoted-printable +Content-Disposition: inline; + modification-date="Wed, 22 Mar 2017 15:21:55 -0500" + +<HTML xmlns=3D"http://www.w3.org/1999/xhtml"> +<BODY> +<DIV>Hello Chloe</DIV> +</BODY> +</HTML> +--____XTSWHCFJMONXSVGPVDLY____ +Content-Type: application/octet-stream; name="abc.xyz" +Content-Description: abcefghijklmnopqrstuvwxyz01234567890abcefghijklmnopqrstuvwxyz01234567890abcefghijklmnopqrstuvwxyz01234567890.xyz +Content-Disposition: attachment; filename*0="abcefghijklmnopqrstuvwxyz01234567890abcefghijklmnopqrstuvwxyz01234567890abce"; filename*1="fghijklmnopqrstuvwxyz01234567890.xyz"; +Content-Transfer-Encoding: base64 + +R0lGODlhHgHCAPf/AIOPr9GvT7SFcZZjVTEuMLS1tZKUlJN0Znp4eEA7PV1aWvz8+8V6Zl1BNYxX +HvOZ1/zmOd95agUEADs= +--____XTSWHCFJMONXSVGPVDLY____ +Content-ID: <VFXVGHAGXNMI.36b3148cbf284ba18d35bdd8386ac266> +Content-Type: image/xxx +Content-Transfer-Encoding: base64 + +R0lGODlhAQABAPAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw== +--____XTSWHCFJMONXSVGPVDLY____-- + +--____NOIBTUQXSYRVOOAFLCHY____-- +""" + raw_email_encoded_encoding_charset_contains_a_minus = b"""Delivered-To: <[email protected]> Return-Path: <[email protected]> Message-ID: <74836CF6FF9B1965927DE7EE8A087483@NXOFGRQFQW2> @@ -362,6 +415,15 @@ self.assertEqual('abc.xyz', attachment['filename']) self.assertTrue(attachment['content']) + def test_parse_attachment_with_long_filename(self): + parsed_email = parse_email(raw_email_with_long_filename_attachment) + self.assertEqual(1, len(parsed_email.attachments)) + attachment = parsed_email.attachments[0] + self.assertEqual('application/octet-stream', attachment['content-type']) + self.assertEqual(71, attachment['size']) + self.assertEqual('abcefghijklmnopqrstuvwxyz01234567890abcefghijklmnopqrstuvwxyz01234567890abcefghijklmnopqrstuvwxyz01234567890.xyz', attachment['filename']) + self.assertTrue(attachment['content']) + def test_parse_email_accept_if_declared_charset_contains_a_minus_character(self): parsed_email = parse_email(raw_email_encoded_encoding_charset_contains_a_minus) self.assertEqual("Salut, mon cher.", parsed_email.subject)
