[Python-modules-commits] [pyspf] 02/04: Cherry-pick from upstream git: Catch ValueError due to improper IP address in connect IP or in ip4/ip6 mechanisms

Scott Kitterman kitterman at moszumanska.debian.org
Wed Aug 3 05:27:16 UTC 2016


This is an automated email from the git hooks/post-receive script.

kitterman pushed a commit to branch master
in repository pyspf.

commit 15e1288e14cd53a4dd5c96a10c4455158a030e74
Merge: 80758f1 082368f
Author: Scott Kitterman <scott at kitterman.com>
Date:   Wed Aug 3 01:21:50 2016 -0400

    Cherry-pick from upstream git: Catch ValueError due to improper IP
    address in connect IP or in ip4/ip6 mechanisms

 CHANGELOG                                          |   4 +
 debian/.git-dpm                                    |   4 +-
 debian/changelog                                   |   4 +-
 ...Error-due-to-improper-IP-address-in-conne.patch | 106 +++++++++++++++++++++
 debian/patches/series                              |   1 +
 spf.py                                             |  56 ++++++-----
 6 files changed, 150 insertions(+), 25 deletions(-)

diff --cc debian/.git-dpm
index 44b6e64,0000000..c35bef3
mode 100644,000000..100644
--- a/debian/.git-dpm
+++ b/debian/.git-dpm
@@@ -1,11 -1,0 +1,11 @@@
 +# see git-dpm(1) from git-dpm package
- 31653e054c360e5f8a46f01ff69aefd0d68f31c0
- 31653e054c360e5f8a46f01ff69aefd0d68f31c0
++082368f15ec51b243fbdbc7b22e0373d22723337
++082368f15ec51b243fbdbc7b22e0373d22723337
 +06476d8a40699c62130c6c202a86552a787b167d
 +06476d8a40699c62130c6c202a86552a787b167d
 +pyspf_2.0.12t.orig.tar.gz
 +6e2ec0d13d25a6825761314adab2dab414b865f8
 +67189
 +debianTag="debian/%e%v"
 +patchedTag="patched/%e%v"
 +upstreamTag="upstream/%e%u"
diff --cc debian/changelog
index c013ae2,0000000..c285c1c
mode 100644,000000..100644
--- a/debian/changelog
+++ b/debian/changelog
@@@ -1,446 -1,0 +1,448 @@@
 +pyspf (2.0.12t-2) UNRELEASED; urgency=medium
 +
 +  [ Scott Kitterman ]
 +  * Add "--slave" directive to update-alternatives to man page for spfquery
 +    is provided when spfquery.pyspf is the selected spfquery (Closes: #814985)
 +  * Bump standards version to 3.9.8 without further change
++  * Cherry-pick from upstream git: Catch ValueError due to improper IP
++    address in connect IP or in ip4/ip6 mechanisms
 +
 +  [ Ondřej Nový ]
 +  * Fixed VCS URL (https)
 +
 +  [ SVN-Git Migration ]
 +  * Migrate packaging to git with git-dpm
 +
-  -- Scott Kitterman <scott at kitterman.com>  Sat, 30 Jul 2016 01:17:07 -0400
++ -- Scott Kitterman <scott at kitterman.com>  Wed, 03 Aug 2016 01:21:50 -0400
 +
 +pyspf (2.0.12t-1) unstable; urgency=medium
 +
 +  * New upstream release
 +  * Switch spf-tools-python to use python3 instead of python2.7
 +    - Update debian/rules and control
 +    - Patch spf.py to use /usr/bin/python3 when run as a script
 +  * Promote python{3}-authres recommends to depends since it is used in the
 +    doctests
 +  * Add dh-python to build-depends
 +  * Updated debian/watch to point at pypi.debian.net redirector
 +  * Update debian/copyright
 +  * Update Homepage: field in debian/control to point at pypi instead of
 +    cheeseshop
 +  * Bump standards version to 3.9.6 without further change.
 +
 + -- Scott Kitterman <scott at kitterman.com>  Wed, 05 Aug 2015 19:42:25 -0400
 +
 +pyspf (2.0.11-1) unstable; urgency=medium
 +
 +  * New upstream release
 +    - Fix problem with incorrect SPF results due to DNS cache case sensitivity
 +      problems (Closes: #773491)
 +    - Remove debian/patches since the only patch was a cherry pick from
 +      upstream that is in the new release
 +
 + -- Scott Kitterman <scott at kitterman.com>  Thu, 18 Dec 2014 17:55:40 -0500
 +
 +pyspf (2.0.10-2) unstable; urgency=medium
 +
 +  * Backport upstream fix for multiple spaces between SPF record terms
 +    issue (Closes: #771547)
 +  * Switch to source format 3.0(quilt) as the lowest impact way to add a
 +    patch system.
 +
 + -- Scott Kitterman <scott at kitterman.com>  Sun, 30 Nov 2014 11:19:09 -0500
 +
 +pyspf (2.0.10-1) unstable; urgency=medium
 +
 +  * New upstream release
 +  * Add Breaks: tumgreyspf (<< 1.36-4.1~), which should have been there since
 +    2.0.8
 +
 + -- Scott Kitterman <scott at kitterman.com>  Tue, 02 Sep 2014 15:48:20 -0400
 +
 +pyspf (2.0.9-1) unstable; urgency=medium
 +
 +  * New upstream release
 +    - Support for standards track SPF, RFC 7208
 +    - Add test/rfc7208-tests.yml to python{3}-spf.docs
 +    - Updated Debian provided man pages to align with upstream updates
 +    - Updated package descriptions to refer to RFC 7208
 +  * Update debian/watch to point at pypi instead of sourceforge
 +  * Bump standards version to 3.9.5 without further change
 +  * Set X-Python3-Version to 3.3 due to use of ipaddress
 +
 + -- Scott Kitterman <scott at kitterman.com>  Thu, 01 May 2014 00:23:43 -0400
 +
 +pyspf (2.0.8-3) unstable; urgency=low
 +
 +  * Change path usage in debian/rules debian/spf-tools-python.links not to
 +    depend on pyshared
 +  * Drop python3.3 specific depends for python3-spf that are no longer needed
 +    (Closes: #739610)
 +  * Drop unused quilt patch system from debian/rules and debian/control
 +
 + -- Scott Kitterman <scott at kitterman.com>  Thu, 13 Feb 2014 19:17:27 -0500
 +
 +pyspf (2.0.8-2) unstable; urgency=low
 +
 +  * Add Breaks: for pre-1.2 versions of postfix-policyd-spf-python that used
 +    spf.addr2bin that was removed in 2.0.8
 +
 + -- Scott Kitterman <scott at kitterman.com>  Thu, 25 Jul 2013 15:45:07 -0400
 +
 +pyspf (2.0.8-1) unstable; urgency=low
 +
 +  * New upstream release
 +    - Add depends for python-ipaddr and python3.3 | python3-ipaddr (ipaddress
 +      is part of the standard library in python3.3)
 +    - Drop debian/patches/catch_unicode_spf and missed_py3, incorporated
 +      upstream
 +    - Update debian/copyright
 +  * Reduce minimum python3-dns version requirement to 3.0.2-1+deb7u1 now that
 +    the relevant bug is fixed in wheezy
 +  * Point debian/watch at pypi instead of sourceforge since it gets released
 +    there first
 +  * Bump debian/compat and debhlper version to 9 for build-arch/indep support
 +  * Bump standards version to 3.9.4 without further change
 +
 + -- Scott Kitterman <scott at kitterman.com>  Thu, 25 Jul 2013 00:48:40 -0400
 +
 +pyspf (2.0.7-5) unstable; urgency=low
 +
 +  * Revert last addition to debian/patches/missed_py3
 +    - It isn't the right way to solve the problem and didn't work anyway
 +    - Will fix in python3-dns instead
 +  * Set minimum python3-dns version for python3-spf to 3.0.3 as previous
 +    versions are broken
 +
 + -- Scott Kitterman <scott at kitterman.com>  Mon, 27 May 2013 00:22:58 -0400
 +
 +pyspf (2.0.7-4) unstable; urgency=medium
 +
 +  [ Jakub Wilk ]
 +  * Use canonical URIs for Vcs-* fields.
 +
 +  [ Scott Kitterman ]
 +  * Urgency medium because this issue has been reported to affect mail
 +    delivery
 +  * Update debian/patches/missed_py3 to fix one additional instance of
 +    python3 incompatibility
 +
 + -- Scott Kitterman <scott at kitterman.com>  Sat, 25 May 2013 23:52:59 -0400
 +
 +pyspf (2.0.7-3) unstable; urgency=low
 +
 +  * override dh_python3 to not act on spf-tools-python so that its shebangs
 +    don't get rewritten to /usr/bin/python3 (Closes: #683098)
 +
 + -- Scott Kitterman <scott at kitterman.com>  Sat, 28 Jul 2012 14:53:59 -0400
 +
 +pyspf (2.0.7-2) unstable; urgency=low
 +
 +  * Add debian/patches/catch_unicode_spf to correctly raise errors when SPF
 +    records contain unicode
 +  * Add python-authres as Recommends to python-spf and python3-spf since
 +    doctests require it
 +
 + -- Scott Kitterman <scott at kitterman.com>  Thu, 14 Jun 2012 16:13:23 -0400
 +
 +pyspf (2.0.7-1) unstable; urgency=low
 +
 +  * New upstream release
 +    - Update X-Python-Version and X-Python3-Version
 +    - Drop use of 2to3 in debian/rules, no longer needed
 +    - Add debian/patches/missed_py3 to fix missing python 3 compatbility
 +      change
 +  * Build --with quilt, add quilt to build-depends, replace long obsolete
 +    README.source with a new one for quilt
 +  * Override dh_fixperms to exclude spf.py
 +    - It needs to be executable by anyone so the the symlink from
 +      /usr/bin/pyspf in spf-tools-python works
 +  * Update debian/pyspf.1 to match the current way the package works
 +  * Bump standards version to 3.9.3 without further change
 +
 + -- Scott Kitterman <scott at kitterman.com>  Tue, 28 Feb 2012 09:49:39 -0500
 +
 +pyspf (2.0.6-1) unstable; urgency=low
 +
 +  [ Guilherme de Siqueira Pastore ]
 +  * Remove myself from the Uploaders field in debian/control.
 +
 +  [ Scott Kitterman ]
 +  * New upstream release
 +    - Supports python3 with 2to3
 +  * Add new binary package for python3-spf
 +  * Rework debian/rules to use 2to3 and build both spf binaries
 +  * Removed no longer needed debian/python-spf.install
 +  * Update debian/copyright
 +  * Bump standards-version to 3.9.2 without further change
 +
 + -- Scott Kitterman <scott at kitterman.com>  Thu, 27 Oct 2011 14:41:56 -0400
 +
 +pyspf (2.0.5-5) unstable; urgency=low
 +
 +  * No change rebuild for python transiiton
 +
 + -- Scott Kitterman <scott at kitterman.com>  Tue, 19 Apr 2011 01:06:46 -0400
 +
 +pyspf (2.0.5-4) unstable; urgency=low
 +
 +  * Upload to unstable
 +  * Drop old conflicts from spf-tools-python
 +
 + -- Scott Kitterman <scott at kitterman.com>  Tue, 22 Mar 2011 09:37:56 -0400
 +
 +pyspf (2.0.5-3) experimental; urgency=low
 +
 +  * Convert from cdbs to debhelper 7 rules
 +    - Update debian/rules
 +    - Drop build-depends on cdbs
 +    - Update required debhelper version and debian/compat
 +    - Remove autogenerated debian/pycompat
 +  * Convert from dh_pycentral to dh_python2
 +    - Add --with python2 in debian/rules
 +    - Drop build-depends on python-central
 +    - Update required minimum python-all version
 +  * Build depend on python-all instead of python-all-dev
 +  * Update to recent Python Policy recommendations
 +    - Use X-Python-Version instead of XS-Python-Version
 +    - Drop XB-Python-Version from all binaries
 +  * Provide /usr/bin/pyspf so spf.py can be also be used as a command line
 +    tool
 +    - Provide as symlink to /usr/share/pyshared/spf.py in
 +      debian/spf-tools-python.links
 +    - Change spf-tools-python to depend on python-spf and not just recommends
 +    - Move pyspf.1 from python-spf to spf-tools-python
 +    - spf-tools-python replaces python-spf << 2.0.5.-3~
 +  * Improve package descriptions
 +  * Clean up redundant README files
 +    - Drop README.Debian and README.Debian.python-spf
 +    - Update content of README.Debian.spf.tools.python
 +  * Set -e in debian/spf-tools-python.postinst/prerm instead of /bin/sh -e
 +  * Remove unused patches and debian/patches
 +  * Change priority to optional to match overrides
 +  * Remove obsolete XS-DM-Upload-Allowed field
 +  * Fix misspelling in debian/pyspf.1
 +  * Bump standards version to 3.9.1 without further change
 +
 + -- Scott Kitterman <scott at kitterman.com>  Sat, 04 Dec 2010 10:44:42 -0500
 +
 +pyspf (2.0.5-2) unstable; urgency=low
 +
 +  [ Sandro Tosi ]
 +  * debian/control
 +    - switch Vcs-Browser field to viewsvn
 +
 +  [ Scott Kitterman ]
 +  * Upload to unstable
 +  * Add ${misc:Depends} for both binaries
 +
 + -- Scott Kitterman <scott at kitterman.com>  Sun, 15 Feb 2009 18:36:48 -0500
 +
 +pyspf (2.0.5-1) experimental; urgency=low
 +
 +  * New upstream release
 +    - Fall back to TCP if UDP reply is truncated
 +    - Minor updates for RFC 4408 errata and test suite improvements
 +  * Drop all patches
 +    - Incorporated upstream
 +    - Remove simple-patchsys.mk for debian/control
 +    - Remove patches dir
 +  * Update debian/copyright
 +
 + -- Scott Kitterman <scott at kitterman.com>  Tue, 29 Jul 2008 00:55:44 -0400
 +
 +pyspf (2.0.4-4) unstable; urgency=low
 +
 +  * Split tools out to spf-tools-python to minimize risk of conflicts between
 +    SPF related applications using different libraries
 +    - Add package to debian/control
 +    - Add spf-tools-python/install to debian/rules
 +    - Add debian/python-spf.install
 +    - Move man pages for tools to spf-tools-python.manpages
 +    - Rename docs to python-spf.docs
 +    - Add spf-tools-python.docs
 +    - Split README.Debian for both binaries
 +    - Move postinst/prerm for update-alternatives to the new package
 +  * Switch to python-central
 +    - Remove debian/pyversions
 +    - Update debian/rules
 +    - Remove debian/pycompat
 +    - Change build-dep and add XS/XB-Python-Versions to debian/control
 +    - Install test dir in /usr/share/doc/python-spf to avoid possible
 +      namespace collisions in site-packages
 +    - Add DEB_COMPRESS_EXCLUDE += \.py$ \.yml$ to debian/rules so test suite
 +      is not compressed
 +  * Change Recommends: python-yaml to Suggests: - Test suite is not normally
 +    run, so python-yaml need not be installed by default
 +  * Update standards version to 3.8.0.1
 +    - Add debian/README.source
 +  * Properly escape leading quotes in pyspf.1
 +  * Revert inline removal of spf.py shebang and spf-shebang.patch to make
 +    it right 
 +
 + -- Scott Kitterman <scott at kitterman.com>  Tue, 01 Jul 2008 13:34:17 -0400
 +
 +pyspf (2.0.4-3) unstable; urgency=low
 +
 +  [ Sandro Tosi ]
 +  * debian/control
 +    - added Vcs-Browser
 +
 +  [ Scott Kitterman ]
 +  * Add tcp-fallback.patch so that truncated UDP DNS replies are retried
 +    in TCP and either a complete result is fetched or a TempError is raised
 +  * Add trap-command-line-errors.patch so DNS errors don't cause a crash
 +    when pyspf is used from the command line
 +  * Properly escape hyphens in debian/spfquery.pyspf.1 and
 +    debian/pyspf-type99.1
 +
 + -- Scott Kitterman <scott at kitterman.com>  Mon, 24 Mar 2008 17:38:03 -0400
 +
 +pyspf (2.0.4-2) unstable; urgency=low
 +
 +  [ Scott Kitterman ]
 +
 +  * Agreed maintainer change - updated debian/control and debian/copyright
 +  * Really update debian/watch to version 3 (Closes: #453591)
 +  * Remove README.Debian from debian/docs (not needed)
 +  * Move man page installation to python-spf.manpages
 +  * Correct formatting errors in debian/pyspf.1
 +  * Correct formatting errors in debian/spfquery.pyspf.1 and add an example
 +  * Update standards version to 3.7.3 without further change
 +
 +  [ Piotr Ozarowski ]
 +
 +  * Homepage field added
 +  * Rename XS-Vcs-* fields to Vcs-* (dpkg supports them now)
 + 
 +   [ Philipp Kern ]
 + 
 +   * Added `XS-DM-Upload-Allowed: yes' to `debian/control' to allow uploads
 +     from Debian Maintainers.
 +
 + -- Scott Kitterman <scott at kitterman.com>  Sat, 08 Dec 2007 15:44:09 -0500
 +
 +pyspf (2.0.4-1) unstable; urgency=low
 +
 +  * New upstream release
 +    - Upstream changelog date is in error - released 30 Jul 2007
 +  * Update debian/watch to version 3
 +  * Update version numbers in /debian supplied man pages.
 +
 + -- Scott Kitterman <scott at kitterman.com>  Wed, 01 Aug 2007 11:54:13 -0400
 +
 +pyspf (2.0.3-2) unstable; urgency=low
 +
 +  * debian/control
 +    - Add python-yaml as recommends for test suite support now that it's 
 +      packaged
 +  * debian/rules
 +    - Install test directory for test suite
 +    - Delete obsolete (and commented out) rule for renaming spf.py
 +  * debian/pyspf.1
 +    - Add instructions for using the pyspf test suite
 +
 + -- Scott Kitterman <scott at kitterman.com>  Tue, 15 May 2007 13:01:19 -0400
 +
 +pyspf (2.0.3-1) unstable; urgency=low
 +
 +  [ Scott Kitterman ]
 +
 +  * Update package from source for new development to support RFC 4408
 +    (Closes: #403860)
 +  * debian/copyright:
 +     - Updated for new upstream maintainers.
 +     - Corrected download location
 +     - Added additional detail
 +  * debian/docs
 +     - Added README.Debian
 +  * Added debian/README.Debian
 +  * Added man pages
 +     - debian/pyspf.1
 +     - debian/spfquery.pyspf.1
 +     - debian/pyspf-type99.1
 +  * debian/python-spf.postinst:
 +     - Created for spfquery update alternatives
 +  * debian/python-spf.prerm:
 +     - Created for spfquery update alternatives
 +  * debian/rules:
 +     - Added dh_installman rules to install man pages
 +     - Rename spfquery and type99 scripts
 +  * debian/watch:
 +     - Corrected for new upstream location
 +  * Added debian/pyversions
 +  * debian/control:
 +     - Updated web site for both SPF and pyspf.
 +     - Updated conflicts to account for new python policy and spfquery script
 +     - Removed provides and replaces - not required (Closes: #399938)
 +     - Updated Python build dependencies and changed to Build-Depends
 +
 +  [ Piotr Ozarowski ]
 +
 +  * debian/control:
 +     - Added XS-Vcs-Svn field 
 +
 + -- Scott Kitterman <scott at kitterman.com>  Wed,  4 Apr 2007 15:16:36 -0400
 +
 +pyspf (1.6-4) unstable; urgency=low
 +
 +  * debian/control:
 +    - Remove pabs from Uploaders field as requested.
 +    - Move architecture indep dependencies from Build-Depends 
 +      to Build-Depends-Indep.
 +  * debian/rules:
 +    - Add simple-patchsys support without patches.
 +    - Remove unneded clean target.
 +    
 +  * New Python Policy Changes: (Closes: #373504)
 +    + debian/control:
 +      - Bump up cdbs dependency to >= 0.4.41.
 +      - Bump up debhelper compatibility to 5.
 +      - Add python-support >= 0.2.3 dependency.
 +      - Add XS-Python-Version field.
 +      - Depends on ${python:Depends} and not on python2.3.
 +      - Add XB-Python-Version field.
 +    + debian/rules:
 +      - Add DEB_PYTHON_SYSTEM=pysupport
 +      - Remove echo call since cdbs take care about this.
 +      - Call python-distutils class after debhelper now.
 +    + debian/postinst && debian/prerm:
 +      - Remove "hand made" python-support stuff, cdbs does this.
 +      
 + -- Gustavo Franco <stratus at debian.org>  Thu, 15 Jun 2006 11:46:19 -0300
 +
 +pyspf (1.6-3) unstable; urgency=low
 +
 +  * debian/rules: 
 +    - move from debhelper to cdbs (Closes: #357023)
 +  * debian/control:
 +    - Standards-Version bumped up to 3.7.2
 +    - Remove python2.3-spf and python2.4-spf binaries, 
 +      but adds Replaces, Provides and Conflicts fields for
 +      a transition using python-spf package.
 +  
 + -- Gustavo Franco <stratus at debian.org>  Sun, 30 Apr 2006 23:26:20 -0300
 +
 +pyspf (1.6-2) unstable; urgency=low
 +
 +  [ Guilherme de S. Pastore ]  
 +  * debian/control.in:
 +    - Add @PYTHON_MODULES_TEAM@ to Uploaders:
 +    - Updated Standards-Version to 3.6.2 with no changes
 +  * debian/rules:
 +    - Added code to automatically generate the list of uploaders based
 +      on information available on the team's SVN repository
 +
 +  [ Gustavo Franco ]
 +  * debian/control:
 +    - Stops shipping python2.2-spf binary
 +  * debian/rules:
 +    - python2.4-spf build added (Closes: #351134)
 +  
 + -- Gustavo Franco <stratus at debian.org>  Sun, 12 Feb 2006 19:27:42 -0200
 +
 +pyspf (1.6-1) unstable; urgency=low
 +
 +  * Initial Release. (Closes: #315679)
 +
 + -- Gustavo Franco <stratus at debian.org>  Thu, 23 Jun 2005 11:04:29 -0300
diff --cc debian/patches/0002-Catch-ValueError-due-to-improper-IP-address-in-conne.patch
index 0000000,0000000..09efc90
new file mode 100644
--- /dev/null
+++ b/debian/patches/0002-Catch-ValueError-due-to-improper-IP-address-in-conne.patch
@@@ -1,0 -1,0 +1,106 @@@
++From 082368f15ec51b243fbdbc7b22e0373d22723337 Mon Sep 17 00:00:00 2001
++From: Scott Kitterman <scott at kitterman.com>
++Date: Wed, 3 Aug 2016 01:20:45 -0400
++Subject: Catch ValueError due to improper IP address in connect IP or in
++ ip4/ip6 mechanisms
++
++---
++ CHANGELOG |  4 ++++
++ spf.py    | 56 ++++++++++++++++++++++++++++++++++----------------------
++ 2 files changed, 38 insertions(+), 22 deletions(-)
++
++diff --git a/CHANGELOG b/CHANGELOG
++index a3be370..8116328 100644
++--- a/CHANGELOG
+++++ b/CHANGELOG
++@@ -1,3 +1,7 @@
+++Version 2.0.13 - UNRELEASED
+++  * Catch ValueError due to improper IP address in connect IP or in ip4/ip6
+++    mechanisms
+++
++ Version 2.0.12 - August 5, 2015
++   * Reset void_lookups at top of check()
++   * Ignore permerror for best_guess()
++diff --git a/spf.py b/spf.py
++index 7ea41d7..703188f 100755
++--- a/spf.py
+++++ b/spf.py
++@@ -421,9 +421,12 @@ class query(object):
++             ip6 = True
++         else:
++             try:
++-                self.ipaddr = ipaddress.ip_address(i)
++-            except AttributeError:
++-                self.ipaddr = ipaddress.IPAddress(i)
+++                try:
+++                    self.ipaddr = ipaddress.ip_address(i)
+++                except AttributeError:
+++                    self.ipaddr = ipaddress.IPAddress(i)
+++            except ValueError as x:
+++                raise PermError(str(x))
++             if self.ipaddr.version == 6:
++                 if self.ipaddr.ipv4_mapped:
++                     self.ipaddr = ipaddress.IPv4Address(self.ipaddr.ipv4_mapped)
++@@ -512,6 +515,12 @@ class query(object):
++     >>> q.check(spf='v=spf1 ip4:192.0.0.0/8 ?all moo')
++     ('permerror', 550, 'SPF Permanent Error: Unknown mechanism found: moo')
++ 
+++    >>> q.check(spf='v=spf1 ip4:192.0.0.n ?all')
+++    ('permerror', 550, 'SPF Permanent Error: Invalid IP4 address: ip4:192.0.0.n')
+++
+++    >>> q.check(spf='v=spf1 ip6:2001:db8:ZZZZ:: ?all')
+++    ('permerror', 550, 'SPF Permanent Error: Invalid IP6 address: ip6:2001:db8:ZZZZ::')
+++
++     >>> q.check(spf='v=spf1 =a ?all moo')
++     ('permerror', 550, 'SPF Permanent Error: Unknown qualifier, RFC 4408 para 4.6.1, found in: =a')
++ 
++@@ -1376,27 +1385,30 @@ class query(object):
++         True
++         """
++         try:
++-            for netwrk in [ipaddress.ip_network(ip) for ip in ipaddrs]:
++-                network = netwrk.supernet(new_prefix=n)
++-                if isinstance(self.iplist, bool):
++-                    if network.__contains__(self.ipaddr):
++-                        return True
++-                else:
++-                    if n < self.cidrmax:
++-                        self.iplist.append(network)
+++            try:
+++                for netwrk in [ipaddress.ip_network(ip) for ip in ipaddrs]:
+++                    network = netwrk.supernet(new_prefix=n)
+++                    if isinstance(self.iplist, bool):
+++                        if network.__contains__(self.ipaddr):
+++                            return True
++                     else:
++-                        self.iplist.append(network.ip)
++-        except AttributeError:
++-            for netwrk in [ipaddress.IPNetwork(ip,strict=False) for ip in ipaddrs]:
++-                network = netwrk.supernet(new_prefix=n)
++-                if isinstance(self.iplist, bool):
++-                    if network.__contains__(self.ipaddr):
++-                        return True
++-                else:
++-                    if n < self.cidrmax:
++-                        self.iplist.append(network)
+++                        if n < self.cidrmax:
+++                            self.iplist.append(network)
+++                        else:
+++                            self.iplist.append(network.ip)
+++            except AttributeError:
+++                for netwrk in [ipaddress.IPNetwork(ip,strict=False) for ip in ipaddrs]:
+++                    network = netwrk.supernet(new_prefix=n)
+++                    if isinstance(self.iplist, bool):
+++                        if network.__contains__(self.ipaddr):
+++                            return True
++                     else:
++-                        self.iplist.append(network.ip)
+++                        if n < self.cidrmax:
+++                            self.iplist.append(network)
+++                        else:
+++                            self.iplist.append(network.ip)
+++        except ValueError as x:
+++            raise PermError(str(x))
++         return False
++ 
++     def parse_header_ar(self, val):
diff --cc debian/patches/series
index 29b0574,0000000..5e2088a
mode 100644,000000..100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@@ -1,1 -1,0 +1,2 @@@
 +use_python3.diff
++0002-Catch-ValueError-due-to-improper-IP-address-in-conne.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/pyspf.git



More information about the Python-modules-commits mailing list