Skip to content

Commit

Permalink
Import pypolicyd-spf version 1.3.2 as mail/py-policyd-spf.
Browse files Browse the repository at this point in the history
This is python-policyd-spf, an external policy checker for the postfix mail
server.  It will use pyspf to check SPF records to determine if email should
be rejected by your server.

Based on https://github.com/joyent/pkgsrc/pull/421 by Coy Hile.
  • Loading branch information
jperkin committed Oct 27, 2016
1 parent 34fe5e7 commit 98d59a2
Show file tree
Hide file tree
Showing 9 changed files with 178 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mail/py-policyd-spf/DESCR
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This is python-policyd-spf, an external policy checker for the postfix mail
server. It will use pyspf to check SPF records to determine if email should
be rejected by your server.
44 changes: 44 additions & 0 deletions mail/py-policyd-spf/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# $NetBSD: Makefile,v 1.1 2016/10/27 12:30:23 jperkin Exp $

VERSION= 1.3.2
DISTNAME= pypolicyd-spf-${VERSION}
PKGNAME= ${PYPKGPREFIX}-policyd-spf-${VERSION}
CATEGORIES= mail python
MASTER_SITES= ${MASTER_SITE_PYPI:=p/pypolicyd-spf/}

MAINTAINER= [email protected]
HOMEPAGE= https://pypi.python.org/pypi/pypolicyd-spf
COMMENT= Python based policy daemon for Postfix SPF checking
LICENSE= apache-2.0

DEPENDS+= ${PYPKGPREFIX}-ipaddr>0:../../devel/py-ipaddr
DEPENDS+= ${PYPKGPREFIX}-authres>0:../../mail/py-authres
DEPENDS+= ${PYPKGPREFIX}-spf>0:../../mail/py-spf

PYTHON_VERSIONS_ACCEPTED= 27 # py-ipaddr, py-spf

DOCDIR= share/doc/${PKGBASE}
EGDIR= ${PREFIX}/share/examples/${PKGBASE}
PKG_SYSCONFSUBDIR= python-policyd-spf

SUBST_CLASSES+= paths
SUBST_STAGE.paths= pre-configure
SUBST_FILES.paths= policyd-spf policyd-spf.1 policyd-spf.conf.5
SUBST_FILES.paths+= policyd-spf.peruser.5 setup.py
SUBST_VARS.paths= PKGMANDIR PKG_SYSCONFDIR

INSTALLATION_DIRS= ${DOCDIR} ${EGDIR} ${PKGMANDIR}/man1 ${PKGMANDIR}/man5

CONF_FILES= ${EGDIR}/policyd-spf.conf ${PKG_SYSCONFDIR}/policyd-spf.conf

PLIST_SUBST+= DOCDIR=${DOCDIR:Q} PKGBASE=${PKGBASE:Q}
PRINT_PLIST_AWK+= { gsub(/${DOCDIR:S|/|\\/|g}/, "$${DOCDIR}"); }
PRINT_PLIST_AWK+= { gsub(/${PKGBASE}/, "$${PKGBASE}"); }

post-install:
${INSTALL_DATA} ${WRKSRC}/README ${DESTDIR}${PREFIX}/${DOCDIR}
${INSTALL_DATA} ${WRKSRC}/README.per_user_whitelisting ${DESTDIR}${PREFIX}/${DOCDIR}
${INSTALL_DATA} ${WRKSRC}/policyd-spf.conf.commented ${DESTDIR}${EGDIR}/policyd-spf.conf

.include "../../lang/python/distutils.mk"
.include "../../mk/bsd.pkg.mk"
15 changes: 15 additions & 0 deletions mail/py-policyd-spf/PLIST
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@comment $NetBSD: PLIST,v 1.1 2016/10/27 12:30:23 jperkin Exp $
bin/policyd-spf
${PYSITELIB}/policydspfsupp.py
${PYSITELIB}/policydspfsupp.pyc
${PYSITELIB}/policydspfsupp.pyo
${PYSITELIB}/policydspfuser.py
${PYSITELIB}/policydspfuser.pyc
${PYSITELIB}/policydspfuser.pyo
${PYSITELIB}/${EGG_FILE}
man/man1/policyd-spf.1
man/man5/policyd-spf.conf.5
man/man5/policyd-spf.peruser.5
${DOCDIR}/README
${DOCDIR}/README.per_user_whitelisting
share/examples/${PKGBASE}/policyd-spf.conf
11 changes: 11 additions & 0 deletions mail/py-policyd-spf/distinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
$NetBSD: distinfo,v 1.1 2016/10/27 12:30:23 jperkin Exp $

SHA1 (pypolicyd-spf-1.3.2.tar.gz) = 607d3a7df6d6c5d19edd7c337ba2e0c143ff3499
RMD160 (pypolicyd-spf-1.3.2.tar.gz) = ce85a3201990f9b57eb21e8f02b666a5987e6bbd
SHA512 (pypolicyd-spf-1.3.2.tar.gz) = e80b13a0cf9f8406592db5edcb9770051352b3f637d4d9d5bd96295710bf3728a8350c0697e5b430698b0d9d226c83c9decb67923ed5cdb3502ee15509715af4
Size (pypolicyd-spf-1.3.2.tar.gz) = 32973 bytes
SHA1 (patch-policyd-spf) = 43a3ac8491d6120e26c994d696c4143adf0749bc
SHA1 (patch-policyd-spf.1) = 21363210a9e45978074bc1f59c545c85e5181d7e
SHA1 (patch-policyd-spf.conf.5) = fa549a2dd726f6a5894c2c4e494136d9860624fb
SHA1 (patch-policyd-spf.peruser.5) = e3e831a41254b58b04649f9a6ecfe5df22568135
SHA1 (patch-setup.py) = f0e60162372248595f508ea921c8ccc4d151459c
15 changes: 15 additions & 0 deletions mail/py-policyd-spf/patches/patch-policyd-spf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
$NetBSD: patch-policyd-spf,v 1.1 2016/10/27 12:30:23 jperkin Exp $

Use pkgsrc layout.

--- policyd-spf.orig 2015-08-13 02:45:08.000000000 +0000
+++ policyd-spf
@@ -651,7 +651,7 @@ def _spfcheck(data, instance_dict, confi
###################################################
# load config file {{{1
# Default location:
-configFile = '/etc/python-policyd-spf/policyd-spf.conf'
+configFile = '@PKG_SYSCONFDIR@/policyd-spf.conf'
if len(sys.argv) > 1:
if sys.argv[1] in ( '-?', '--help', '-h' ):
print('usage: policyd-spf [<configfilename>]')
21 changes: 21 additions & 0 deletions mail/py-policyd-spf/patches/patch-policyd-spf.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
$NetBSD: patch-policyd-spf.1,v 1.1 2016/10/27 12:30:23 jperkin Exp $

Use pkgsrc layout.

--- policyd-spf.1.orig 2014-06-04 06:01:49.000000000 +0000
+++ policyd-spf.1
@@ -145,12 +145,12 @@ $ policyd-spf (Start using installed con

$ policyd-spf \-h (Display usage message)

-$ policyd-spf /etc/policyd-spf/policyd-spf.conf (Config file name to use)
+$ policyd-spf @PKG_SYSCONFDIR@/policyd-spf.conf (Config file name to use)

Configuration options are described in the sample configuration file provided
with the package (policyd-spf.conf.commented) and in policyd-spf.conf(5). The
provided setup.py installs an uncommented configuration file in
-/etc/policyd-spf/.
+@PKG_SYSCONFDIR@/.

Additionally, whitelisting certain IP addresses or IP addresses used by listed
domains from SPF checks is supported. Skipping SPF checks for local submission
24 changes: 24 additions & 0 deletions mail/py-policyd-spf/patches/patch-policyd-spf.conf.5
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
$NetBSD: patch-policyd-spf.conf.5,v 1.1 2016/10/27 12:30:23 jperkin Exp $

Use pkgsrc layout.

--- policyd-spf.conf.5.orig 2014-06-04 06:01:49.000000000 +0000
+++ policyd-spf.conf.5
@@ -138,7 +138,7 @@ python-policyd-spf \- pure-Python Postfi
.SH "USAGE"
.IX Header "USAGE"
Usage:
- policyd-spf [/etc/policyd-spf/policyd-spf.conf]
+ policyd-spf [@PKG_SYSCONFDIR@/policyd-spf.conf]

.SH "OTHER DOCUMENTATION"
.IX Header "OTHER DOCUMENTATION"
@@ -166,7 +166,7 @@ file.

Configuration options are described here and in the configuration file
provided with the package. The provided setup.py installs this configuration
-file in /etc/policyd-spf/.
+file in @PKG_SYSCONFDIR@/.

Additionally, whitelisting certain IP addresses from SPF checks is supported.
This man page and the sample configuration file show the format to use.
24 changes: 24 additions & 0 deletions mail/py-policyd-spf/patches/patch-policyd-spf.peruser.5
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
$NetBSD: patch-policyd-spf.peruser.5,v 1.1 2016/10/27 12:30:23 jperkin Exp $

Use pkgsrc layout.

--- policyd-spf.peruser.5.orig 2014-06-04 06:01:49.000000000 +0000
+++ policyd-spf.peruser.5
@@ -138,7 +138,7 @@ python-policyd-spf \- pure-Python Postfi
.SH "USAGE"
.IX Header "USAGE"
Usage:
- policyd-spf [/etc/policyd-spf/policyd-spf.conf]
+ policyd-spf [@PKG_SYSCONFDIR@/policyd-spf.conf]

.SH "OTHER DOCUMENTATION"
.IX Header "OTHER DOCUMENTATION"
@@ -199,7 +199,7 @@ The text file option is useful for testi
users require per-user configurations. It is specified in the main
configuration file:

-"Per_User = text,/etc/pypolicyd-spf/userconf"
+"Per_User = text,@PKG_SYSCONFDIR@/userconf"

Lines beginning with "#" are treated as comments and ignored. The location of
the file is determined by the system administrator. No default file is
21 changes: 21 additions & 0 deletions mail/py-policyd-spf/patches/patch-setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
$NetBSD: patch-setup.py,v 1.1 2016/10/27 12:30:23 jperkin Exp $

Use pkgsrc layout.

--- setup.py.orig 2015-08-12 19:53:43.000000000 +0000
+++ setup.py
@@ -13,11 +13,9 @@ setup(name='pypolicyd-spf',
py_modules=['policydspfsupp', 'policydspfuser'],
keywords = ['Postfix','spf','email'],
scripts = ['policyd-spf'],
- data_files=[(os.path.join('share', 'man', 'man1'),
- ['policyd-spf.1']), (os.path.join('share', 'man', 'man5'),
- ['policyd-spf.conf.5']), (os.path.join('/etc', 'python-policyd-spf'),
- ['policyd-spf.conf']), (os.path.join('share', 'man', 'man5'),
- ['policyd-spf.peruser.5'])],
+ data_files=[(os.path.join('@PKGMANDIR@', 'man1'), ['policyd-spf.1']),
+ (os.path.join('@PKGMANDIR@', 'man5'), ['policyd-spf.conf.5']),
+ (os.path.join('@PKGMANDIR@', 'man5'), ['policyd-spf.peruser.5'])],
classifiers = [
'Development Status :: 5 - Production/Stable',
'Environment :: No Input/Output (Daemon)',

0 comments on commit 98d59a2

Please sign in to comment.