debian/0000775000000000000000000000000012670605767007210 5ustar debian/README.source0000664000000000000000000000353512401417254011355 0ustar This package uses quilt to manage all modifications to the upstream source. Changes are stored in the source package as diffs in debian/patches and applied during the build. To configure quilt to use debian/patches instead of patches, you want either to export QUILT_PATCHES=debian/patches in your environment or use this snippet in your ~/.quiltrc: for where in ./ ../ ../../ ../../../ ../../../../ ../../../../../; do if [ -e ${where}debian/rules -a -d ${where}debian/patches ]; then export QUILT_PATCHES=debian/patches break fi done To get the fully patched source after unpacking the source package, cd to the root level of the source package and run: quilt push -a The last patch listed in debian/patches/series will become the current patch. To add a new set of changes, first run quilt push -a, and then run: quilt new where is a descriptive name for the patch, used as the filename in debian/patches. Then, for every file that will be modified by this patch, run: quilt add before editing those files. You must tell quilt with quilt add what files will be part of the patch before making changes or quilt will not work properly. After editing the files, run: quilt refresh to save the results as a patch. Alternately, if you already have an external patch and you just want to add it to the build system, run quilt push -a and then: quilt import -P /path/to/patch quilt push -a (add -p 0 to quilt import if needed). as above is the filename to use in debian/patches. The last quilt push -a will apply the patch to make sure it works properly. To remove an existing patch from the list of patches that will be applied, run: quilt delete You may need to run quilt pop -a to unapply patches first before running this command. debian/README.Debian.spf-tools-python0000664000000000000000000000075112401417254014500 0ustar README.Debian The Python SPF library is provided in the python-spf package. The spf-tools-python package installs a Python version of the spfquery script and a DNS Resource Record Type 99 (Type SPF) conversion helper script. Use of the Python SPF library as a command line script (pyspf) is documented in the pyspf(1) man page. Use of the Python spfquery is documented in the spfquery.pyspf(1) man page. Use of the Type 99 helper script is documented in the pyspf-type99(1) man page. debian/spfquery.pyspf.10000664000000000000000000001331112401417254012267 0ustar \" .\" Standard preamble: .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .\" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "spfquery.pyspf 1" .TH spfquery.pyspf 1 "2007-01-16" .SH "NAME" spfquery.pyspf \- pure-Python spfquery script .SH "VERSION" .IX Header "VERSION" 2\.0\.9 .SH "DESCRIPTION" .IX Header "DESCRIPTION" The spfquery script is a Python reimplementination of Wayne Schlitt's spfquery command line tool. .SH "USAGE" .IX Header "USAGE" The spfquery script is called with a number of possible options. Options can either use standard '-' prefix or be PERL style long options, '--'. Supported options are: "\-\-file" or "\-file" {filename}: Read the query (or queries) from the designated file. If {filename} is '0', then query inputs are read from STDIN. "\-\-ip" or "\-ip" {address}: Client IP address to use for SPF check. "\-\-sender" or "\-sender" {Mail From address}: Envelope sender from which mail was received. "\-\-helo" or "\-helo" {client hostname}: HELO/EHLO name used by SMTP client. "\-\-local" or "\-local" {local policy SPF string}: Additional SPF mechanisms to be checked on the basis of local policy. Note that local policy matches are not strictly SPF results. Local policy processing is not defined in RFC 4408. Result may vary among SPF implementations. "\-\-rcpt-to" or "rcpt\-to" {rcpt-to address - if available}: Receipt to address is not used for actual SPF processing, but if available it can be useful for logging, spf-received header construction, and providing useful rejection messages when messages are rejected due to SPF. "\-\-default\-explanation" or "\-default-explanation" {explanation string}: Default Fail explanation string to be used. "\-\-sanitize" or "\-sanitize" and "\-\-debug" or "\-debug": These options are no\-op in the Python implementation, but are valid inputs to provide compatibliity with input files developed to work with the original PERL and C spfquery implementations. .SH "EXAMPLE" .IX Header "EXAMPLE" spfquery \-\-sender scott@example.com \-\-ip 192.0.2.0 [other options ...] .SH "SEE ALSO" .IX Header "SEE ALSO" RFC 7208, .SH "AUTHORS" .IX Header "AUTHORS" This version of \fBspfquery\fR was written by Stuart Gathman . .PP This man-page was created by Scott Kitterman . debian/compat0000664000000000000000000000000212401417254010366 0ustar 9 debian/changelog0000664000000000000000000003663312670605767011075 0ustar pyspf (2.0.12t-1~ubuntu14.04.1) trusty-backports; urgency=medium * No-change backport to trusty (LP: #1556209) -- Scott Kitterman Fri, 11 Mar 2016 13:18:31 -0500 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 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 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 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 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 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 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 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 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 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 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 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 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 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 Thu, 27 Oct 2011 14:41:56 -0400 pyspf (2.0.5-5) unstable; urgency=low * No change rebuild for python transiiton -- Scott Kitterman 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 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 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 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 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 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 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 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 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 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 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 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 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 Sun, 12 Feb 2006 19:27:42 -0200 pyspf (1.6-1) unstable; urgency=low * Initial Release. (Closes: #315679) -- Gustavo Franco Thu, 23 Jun 2005 11:04:29 -0300 debian/spf-tools-python.docs0000664000000000000000000000004612401417254013307 0ustar debian/README.Debian.spf-tools-python debian/python-spf.docs0000664000000000000000000000014412401417254012150 0ustar README test/doctest.yml test/rfc4408-tests.yml test/rfc7208-tests.yml test/testspf.py test/test.yml debian/patches/0000775000000000000000000000000012563020622010615 5ustar debian/patches/use_python3.diff0000664000000000000000000000057412563020622013735 0ustar Description: Patch spf.py to use /usr/bin/python3 when run as a script Author: Scott Kitterman Origin: vendor Forwarded: not-needed Last-Update: 2015-08-13 --- pyspf-2.0.12t.orig/spf.py +++ pyspf-2.0.12t/spf.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 from __future__ import print_function """SPF (Sender Policy Framework) implementation. debian/patches/series0000664000000000000000000000002112563020503012021 0ustar use_python3.diff debian/pyspf-type99.10000664000000000000000000001116212401417254011555 0ustar \" .\" Standard preamble: .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .\" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "pyspf-type99 1" .TH pyspf-type99 1 "2007-01-16" .SH "NAME" type99 \- Python Type TXT to Type 99/SPF conversion script .SH "VERSION" .IX Header "VERSION" 2\.0\.9 .SH "DESCRIPTION" .IX Header "DESCRIPTION" The type99script will convert DNS TXT strings to a binary equivalent suitable for use in a BIND zone file. Since use of DNS type SPF (99) was removed in RFC 7208, this script should be of historical interest only. .SH "USAGE" .IX Header "USAGE" The type99 script is called from the command line as follows: python type99 "v=spf1 \-all" {Note: Use your desired SPF record instead.} \\# 12 0b763d73706631202d616c6c {This is the correct result for "v=spf1 \-all"} or python type99 - {File name} The input file format is a standard BIND Zone file. The type99 script will add a Type99 record for each TXT record found in the file. .SH "SEE ALSO" .IX Header "SEE ALSO" RFC 4408, .SH "AUTHORS" .IX Header "AUTHORS" This version of \fBtype99\fR was written by Stuart Gathman and updated by Scott Kitterman . .PP This man-page was created by Scott Kitterman . debian/copyright0000664000000000000000000001366612560517105011141 0ustar This package was debianized by Gustavo Franco on Thu, 23 Jun 2005 11:04:29 -0300. The current Debian maintainer is Scott Kitterman . This version was downloaded from http://downloads.sourceforge.net/pymilter/ Copyright Holder: (c) 2003 Terence Way Portions Copyright(c) 2004,2005,2006,2007,2008,2011,2012 Stuart Gathman Portions Copyright(c) 2005,2006,2007,2008,2011,2012,2013,2014 Scott Kitterman Portions Copyright(c) 2013,2014 Stuart Gathman This software is licensed under the Python Software Foundation License. License: This module is free software, and you may redistribute it and/or modify it under the same terms as Python itself, so long as this copyright message and disclaimer are retained in their original form. IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. spfquery.py: # Author: Stuart D. Gathman # Copyright 2004 Business Management Systems, Inc. # This module is free software, and you may redistribute it and/or modify # it under the same terms as Python itself, so long as this copyright message # and disclaimer are retained in their original form. type99.py: Copyright (c) 2005,2006 Stuart Gathman Portions Copyright (c) 2007 Scott Kitterman This module is free software, and you may redistribute it and/or modify it under the same terms as Python itself, so long as this copyright message and disclaimer are retained in their original form. IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. tests/testspf.py: # Author: Stuart D. Gathman # Copyright 2006 Business Management Systems, Inc. # This module is free software, and you may redistribute it and/or modify # it under the same terms as Python itself, so long as this copyright message # and disclaimer are retained in their original form. The RFC 4408 test-suite (rfc4408-tests.yml) is (C) 2006-2007 Stuart D Gathman 2007 Julian Mehnle All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. The RFC 7208 test-suite (rfc7208-tests.yml) is (C) 2006-2008 Stuart D Gathman 2007-2008 Julian Mehnle 2014 Scott Kitterman All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. debian/spf-tools-python.prerm0000664000000000000000000000026112401417254013503 0ustar #!/bin/sh set -e mode=$1 source_package=pyspf case "$mode" in remove ) update-alternatives --remove spfquery /usr/bin/spfquery.$source_package ;; esac #DEBHELPER# debian/rules0000775000000000000000000000306212563017762010262 0ustar #!/usr/bin/make -f export DH_VERBOSE=1 %: dh $@ --with python2,python3 override_dh_auto_install: set -e && for pyvers in $(shell pyversions -vr); do \ python$$pyvers setup.py install --install-layout=deb \ --root $(CURDIR)/debian/python-spf; \ done set -e && for py3vers in $(shell py3versions -sv); do \ python$$py3vers setup.py install --install-layout=deb \ --root $(CURDIR)/debian/python3-spf; \ done # Make dirs for the tools package (then move scripts from python-spf) mkdir -p debian/spf-tools-python/usr/bin/ # Rename the `spfquery` tool for the alternatives system # (omitting the ".py" language extension): mv $(CURDIR)/debian/python3-spf/usr/bin/spfquery.py debian/spf-tools-python/usr/bin/spfquery.pyspf # Give the `type99` tool a more specific name # (omitting the ".py" language extension): mv $(CURDIR)/debian/python3-spf/usr/bin/type99.py debian/spf-tools-python/usr/bin/pyspf-type99 rm -rf $(CURDIR)/debian/python*-spf/usr/bin override_dh_installdocs: cp $(CURDIR)/CHANGELOG $(CURDIR)/changelog dh_installdocs rm $(CURDIR)/changelog override_dh_auto_clean: set -e && for pyvers in $(shell pyversions -vr); do \ python$$pyvers setup.py clean -a; \ done set -e && for py3vers in $(shell py3versions -sv); do \ python$$py3vers setup.py clean -a; \ done find . -name \*.pyc -exec rm {} \; dh_clean override_dh_fixperms: dh_fixperms chmod +x $(CURDIR)/debian/python3-spf/usr/lib/python3/dist-packages/spf.py override_dh_python2: dh_python2 -N spf-tools-python override_dh_python3: dh_python3 --shebang=/usr/bin/python3 debian/python3-spf.docs0000664000000000000000000000014412401417254012233 0ustar README test/doctest.yml test/rfc4408-tests.yml test/rfc7208-tests.yml test/testspf.py test/test.yml debian/control0000664000000000000000000000402112563024323010570 0ustar Source: pyspf Section: python Priority: optional Maintainer: Scott Kitterman Uploaders: Debian Python Modules Team , Gustavo Franco Build-Depends: debhelper (>= 9), dh-python, python-all (>= 2.6.6-6), python3-all X-Python-Version: >= 2.6 X-Python3-Version: >= 3.3 Homepage: https://pypi.python.org/pypi/pyspf/ Vcs-Svn: svn://anonscm.debian.org/python-modules/packages/pyspf/trunk/ Vcs-Browser: http://anonscm.debian.org/viewvc/python-modules/packages/pyspf/trunk/ Standards-Version: 3.9.6 Package: python-spf Architecture: all Depends: ${python:Depends}, ${misc:Depends}, python-dns, python-ipaddr (>= 2.1.10), python-authres Suggests: python-yaml Breaks: postfix-policyd-spf-python (<< 1.1~), tumgreyspf (<< 1.36-4.1~) Description: sender policy framework (SPF) module for Python This module provides SPF (Sender Policy Framework) for Python. It is RFC 7208 compliant. . For more information about SPF see http://www.openspf.org/ Package: python3-spf Architecture: all Depends: ${python3:Depends}, ${misc:Depends}, python3-dns (>= 3.0.2-1+deb7u1), python3-authres Suggests: python3-yaml Breaks: postfix-policyd-spf-python (<< 1.2~) Description: sender policy framework (SPF) module for Python 3 This module provides SPF (Sender Policy Framework) for Python 3. It is RFC 7208 compliant. . For more information about SPF see http://www.openspf.org/ Package: spf-tools-python Architecture: all Depends: ${python3:Depends}, ${misc:Depends}, python3-spf Replaces: python-spf (<< 2.0.5-3) Description: sender policy framework (SPF) tools for Python SPF (Sender Policy Framework) related scripts and tools in Python. This package currently provides three scripts: . * pyspf: command line use of spf.py * spfquery: Python implementation of spfquery (uses alternatives) * pyspf-type99: Tool to convert SPF records of type TXT to type SPF . spfquery and pyspf-type99 are compatible with python3 For more information about SPF look at http://www.openspf.org/ debian/spf-tools-python.links0000664000000000000000000000006312560516307013503 0ustar usr/lib/python3/dist-packages/spf.py usr/bin/pyspf debian/source/0000775000000000000000000000000012563020335010467 5ustar debian/source/format0000664000000000000000000000001412436642174011707 0ustar 3.0 (quilt) debian/watch0000664000000000000000000000013412401417254010217 0ustar version=3 https://pypi.python.org/packages/source/p/pyspf/pyspf-(.*).tar.gz debian uupdate debian/pyspf.10000664000000000000000000001653712401417254010427 0ustar \" .\" Standard preamble: .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .\" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "python-spf 1" .TH python-spf 1 "2012-02-05" .SH "NAME" pyspf \- pure-Python SPF library .SH "VERSION" .IX Header "VERSION" 2\.0\.9 .SH "DESCRIPTION" .IX Header "DESCRIPTION" SPF does email sender validation. For more information about SPF, please see http://www.openspf.org/ One incompatible change was introduced in version 1.7. Prior to version 1.7, connections from a local IP address (127...) would always return a Pass result. The special case was eliminated. Programs calling pySPF should not do SPF checks on locally submitted mail. This SPF client is intended to be installed on the border MTA, checking if incoming SMTP clients are permitted to forward mail. The SPF check should be done during the MAIL FROM:<...> command. .SH "USAGE" .IX Header "USAGE" There are multiple ways to use this package: To check an incoming mail request: % pyspf [\-v] {ip} {sender} {helo} % pyspf 69.55.226.139 tway@optsw.com mx1.wayforward.net To test an SPF record: % pyspf [\-v] "v=spf1..." {ip} {sender} {helo} % pyspf "v=spf1 +mx +ip4:10.0.0.1 \-all" 10.0.0.1 tway@foo.com a To fetch an SPF record: % pyspf {domain} % pyspf wayforward.net To test this script (and to output this usage message): % pyspf For instance, during an SMTP exchange from client 69.55.226.139:: S: 220 mail.example.com ESMTP Postfix C: EHLO mx1.wayforward.net S: 250-mail.example.com S: ... S: 250 8BITMIME C: MAIL FROM: Then the following command line would check if this is a valid sender: % pyspf 69.55.226.139 terry@wayforward.net mx1.wayforward.net ('pass', 250, 'sender SPF authorized') Command line calls return RFC 4408 result codes, i.e. 'pass', 'fail', 'neutral', \'softfail, 'permerror', or 'temperror'. .SH "RFC 4408/7208 TEST SUITE" .IX Header "RFC 4408/7208 TEST SUITE" The package also installs the python-spf test driver and the current (as of the release date) YAML (Yet Another Markup Language) RFC 4408/7208 test definitions. As errors or improvements in the test definitions are approved, they are available from: To run the test suite, change the directory the test suite is installed in: $ cd /usr/share/doc/python-spf Uncompress testspf.py.gz, testspf.py.gz, and rfc4408-tests.yml.gz and then run testspf.py: $ python testspf.py (also works with python3) The test suite supports multiple allowed results with a warning for a non-preferred result. For the current version, the expected results are: WARN: spfonly in rfc4408-tests.yml, 4.4/1: fail preferred to none WARN: invalid-domain-long in rfc4408-tests.yml, ['4.3/1', '5/10/3']: permerror preferred to fail WARN: txttimeout in rfc4408-tests.yml, 4.4/1: fail preferred to temperror WARN: invalid-domain-empty-label in rfc4408-tests.yml, ['4.3/1', '5/10/3']: permerror preferred to fail WARN: exists-dnserr in rfc4408-tests.yml, 5.7/3: fail preferred to temperror WARN: spfoverride in rfc4408-tests.yml, 4.5/5: pass preferred to fail WARN: multitxt1 in rfc4408-tests.yml, 4.5/5: pass preferred to permerror WARN: mx-limit in rfc4408-tests.yml, 10.1/7: neutral preferred to permerror WARN: multispf2 in rfc4408-tests.yml, 4.5/6: permerror preferred to pass WARN: invalid-domain-long-via-macro in rfc4408-tests.yml, ['4.3/1', '5/10/3']: permerror preferred to fail Due to the resolution of a number of ambiguities in the SPF specification in RFC 7208, there should be no warnings for the RFC 7208 portions of the test suite. .SH "SEE ALSO" .IX Header "SEE ALSO" RFC 7208, .SH "AUTHORS" .IX Header "AUTHORS" This version of \fBpyspf\fR was written by Terence Way and updated by Stuart Gathman and Scott Kitterman . .PP This man-page was created by Scott Kitterman . debian/spf-tools-python.manpages0000664000000000000000000000007512401417254014154 0ustar debian/pyspf-type99.1 debian/spfquery.pyspf.1 debian/pyspf.1 debian/spf-tools-python.postinst0000664000000000000000000000035012401417254014240 0ustar #!/bin/sh set -e mode=$1 source_package=pyspf case "$mode" in configure ) prev_version=$2 update-alternatives --install /usr/bin/spfquery spfquery /usr/bin/spfquery.$source_package 75 ;; esac #DEBHELPER#