diff --git a/pymilter-dns_dsn.patch b/pymilter-dns_dsn.patch new file mode 100644 index 0000000..2e18bdc --- /dev/null +++ b/pymilter-dns_dsn.patch @@ -0,0 +1,36 @@ +diff --git a/Milter/dns.py b/Milter/dns.py +index 67bed03..e4a9751 100644 +--- a/Milter/dns.py ++++ b/Milter/dns.py +@@ -26,8 +26,8 @@ def DNSLookup(name, qtype): + # A RR as dotted quad. For consistency, this driver should + # return both as binary string. + return [((a['name'], a['typename']), a['data']) for a in resp.answers] +- except IOError, x: +- raise DNSError, str(x) ++ except IOError as x: ++ raise DNSError(str(x)) + + class Session(object): + """A Session object has a simple cache with no TTL that is valid +diff --git a/Milter/dsn.py b/Milter/dsn.py +index 021d9d2..b27f749 100644 +--- a/Milter/dsn.py ++++ b/Milter/dsn.py +@@ -142,13 +142,13 @@ def send_dsn(mailfrom,receiver,msg=None,timeout=600,session=None,ourfrom=''): + if badrcpts: + return badrcpts + return None # success +- except smtplib.SMTPRecipientsRefused,x: ++ except smtplib.SMTPRecipientsRefused as x: + if len(x.recipients) == 1: + return x.recipients.values()[0] # permanent error + return x.recipients +- except smtplib.SMTPSenderRefused,x: ++ except smtplib.SMTPSenderRefused as x: + return x.args[:2] # does not accept DSN +- except smtplib.SMTPDataError,x: ++ except smtplib.SMTPDataError as x: + return x.args # permanent error + except smtplib.SMTPException: + pass # any other error, try next MX diff --git a/python-pymilter.spec b/python-pymilter.spec index 7b34a7b..2f14f30 100644 --- a/python-pymilter.spec +++ b/python-pymilter.spec @@ -1,20 +1,23 @@ # we don't want to provide private python extension libs +%global sum Python interface to sendmail milter API %global __provides_exclude_from ^(%{python_sitearch})/.*\\.so$ -Summary: Python interface to sendmail milter API +Summary: %{sum} Name: python-pymilter -Version: 1.0 -Release: 5%{?dist} -Source: http://downloads.sourceforge.net/pymilter/pymilter-%{version}.tar.gz +Version: 1.0.2 +Release: 1%{?dist} +Url: http://www.bmsi.com/python/milter.html +Source: https://github.com/sdgathman/pymilter/archive/pymilter-%{version}.tar.gz Source1: tmpfiles-python-pymilter.conf +# unreleased python3 patches +Patch: pymilter-dns_dsn.patch License: GPLv2+ Group: Development/Libraries -Url: http://www.bmsi.com/python/milter.html # python-2.6.4 gets RuntimeError: not holding the import lock Requires: python >= 2.6.5 # Need python2.6 specific pydns, not the version for system python Requires: python-pydns -BuildRequires: python2-devel, sendmail-devel >= 8.13 +BuildRequires: python2-devel, python3-devel, sendmail-devel >= 8.13 %description This is a python extension module to enable python scripts to @@ -22,30 +25,66 @@ attach to sendmail's libmilter functionality. Additional python modules provide for navigating and modifying MIME parts, sending DSNs, and doing CBV. +%package -n python2-pymilter +Summary: %{sum} +%{?python_provide:%python_provide python2-pymilter} + +%description -n python2-pymilter +This is a python extension module to enable python scripts to +attach to sendmail's libmilter functionality. Additional python +modules provide for navigating and modifying MIME parts, sending +DSNs, and doing CBV. + +%package -n python3-pymilter +Summary: %{sum} +%{?python_provide:%python_provide python3-pymilter} + +%description -n python3-pymilter +This is a python extension module to enable python scripts to +attach to sendmail's libmilter functionality. Additional python +modules provide for navigating and modifying MIME parts, sending +DSNs, and doing CBV. + %prep -%setup -q -n pymilter-%{version} +%setup -q -n pymilter-pymilter-%{version} +%patch -p1 -b .dns_dsn %build CFLAGS="%{optflags}" %{__python2} setup.py build +%py2_build +patch -p1 -b -z .py3 - 1.0.2-1 +- build for both python2 and python3 + * Sat Feb 11 2017 Fedora Release Engineering - 1.0-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild