From nobody Mon Sep 05 20:19:00 2022 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MM0GX2xc3z4bbmg; Mon, 5 Sep 2022 20:19:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MM0GX2MDkz3W8Z; Mon, 5 Sep 2022 20:19:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662409140; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WNpjYI9f77+fH/xZ0ucdSHFhVp4HXFyNPN/8Es1Gi3w=; b=yrKNWZ2g6Zc/ONsvGq0LbMuhsYEZX/EmD521gvUnezIFthxfpxwis5pAuMpquDFwjeViHl OprJIUZQ69RkMD3OlfmBbqCqMdnQuDcz31nRGuu8sstFiTtfgOEQdwCc4IlOE/X7bXDOYy Nj0eJl909tA1Cy7WugwAQDq1zwtkTR/nSIuuxaavRtzVWzPN5G7IBBKwQTkgcT0KndVolq Jz0AJmmpxDuT+YBJK6n4h7BuODVkZhCYa7/QHzVDiU90W8v0cLTgf07UKL5W18Hn2AhSf9 9ST8VlOuLNoIUCmcpQeGZ3seRV/ZwgxDzZ3bFm0hr9Hp4hp2s7VdRW/rCMJYNA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4MM0GX1HbHzwvS; Mon, 5 Sep 2022 20:19:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 285KJ0BE008836; Mon, 5 Sep 2022 20:19:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 285KJ09Q008835; Mon, 5 Sep 2022 20:19:00 GMT (envelope-from git) Date: Mon, 5 Sep 2022 20:19:00 GMT Message-Id: <202209052019.285KJ09Q008835@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Yasuhiro Kimura Subject: git: 00b787288fc8 - main - mail/py-spf-engine: Miscellaneous bug fixes and improvements List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: yasu X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 00b787288fc81a2e5dba2a62a2627da760772b50 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662409140; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WNpjYI9f77+fH/xZ0ucdSHFhVp4HXFyNPN/8Es1Gi3w=; b=w8v5NTdxZeoWnck1wwJr1o/I9WSmFy11EX2xQHOgIWqixYd1wpuQjU9tOUaSpropz9heRl HIOEQd/S1/gZigYZP5Jk67WmR9VOTDWjWraRS5eJnGCsD+xKdTcd1LBi+FqVC8SD9NZZSA hQW4ZScIl4JZkWKI64tmiw87H0XAO3jLwJn2yo/EqklLdUK5JyLX6iucP9e8bfAyFm46jx DGniwD97gnpzAESPxg4Bj5OhubeusbzEs9D4RfNHtuupEO/34cizJ0M1SFw2oEiTWsaJw5 rGAvGQpuRWyqXaVgftm8CRif4/N/zGCSFxhB7mEpoJ8RqJKFMWtQJXvPUYjrSg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1662409140; a=rsa-sha256; cv=none; b=L6fH+LfQcBkBoV9zVP79WQUBmQrxHYusmYdFTwfFdU9rQhMSVdWOsxBbQqYzmQr1zOmmfN O4hI2Lk0kHJo+G0oj4OI7yhJ+oc/tJ5PCQch9pek8MRIwKsyjq2/zm1WgGxRRyg4VT2esS V6yVdOcSTvYR9m0C7VUkgKD1jlaIlQQpB/07Awtw/E/oInARuElgJAqtzL/go00ZlfmoGM ugHvDd80J6N8v8GuGvNWHC2m3o6ByQQuuwnnauYvxnqzvLJnjtbeDT9wUpkK4CXfQaBjim GUJzDJlleTOEyhZouGp4JUKRUgx1CVGJA9Sq5jlrUEDpmcW6x+o08oxHh47b4g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by yasu: URL: https://cgit.FreeBSD.org/ports/commit/?id=00b787288fc81a2e5dba2a62a2627da760772b50 commit 00b787288fc81a2e5dba2a62a2627da760772b50 Author: Yasuhiro Kimura AuthorDate: 2022-09-05 16:31:19 +0000 Commit: Yasuhiro Kimura CommitDate: 2022-09-05 20:18:13 +0000 mail/py-spf-engine: Miscellaneous bug fixes and improvements * Fix runtime error of pyspf-milter that happens when either 'UMask' or 'IntHosts' is set in configuration file. * Stop installing backup files. * Make miscellaneous paths consistent between library files, man pages, pkg-message and rc.d script. * Remove CONFLICTS as mail/postfix-policyd-spf-python is removed from ports tree MFH: 2022Q3 --- mail/py-spf-engine/Makefile | 19 +++------ mail/py-spf-engine/files/patch-policyd-spf.1 | 48 ++++++++++++++++++++++ mail/py-spf-engine/files/patch-policyd-spf.conf.5 | 36 ++++++++++++++++ .../files/patch-policyd-spf.peruser.5 | 20 +++++++++ .../files/patch-spf__engine_milter__spf.py | 11 +++++ .../files/patch-spf__engine_policyd__spf.py | 11 +++++ .../files/patch-spf__engine_policydspfsupp.py | 25 +++++++++++ mail/py-spf-engine/files/pyspf-milter.in | 4 +- 8 files changed, 159 insertions(+), 15 deletions(-) diff --git a/mail/py-spf-engine/Makefile b/mail/py-spf-engine/Makefile index 819357de8ccc..902407a18fe6 100644 --- a/mail/py-spf-engine/Makefile +++ b/mail/py-spf-engine/Makefile @@ -1,5 +1,6 @@ PORTNAME= spf-engine DISTVERSION= 2.9.3 +PORTREVISION= 1 CATEGORIES= mail python MASTER_SITES= CHEESESHOP PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} @@ -22,19 +23,14 @@ USE_RC_SUBR= pyspf-milter SHEBANG_FILES= spf_engine/milter_spf.py spf_engine/policyd_spf.py -CONFLICTS= py*-postfix-policyd-spf-python - NO_ARCH= yes SUB_FILES= pkg-message -SUB_LIST= PYSPF_MILTER_RUNDIR=${PYSPF_MILTER_RUNDIR} \ - PYTHON_CMD=${PYTHON_CMD} +SUB_LIST= PYTHON_CMD=${PYTHON_CMD} USERS= pyspf-milter GROUPS= pyspf-milter -PYSPF_MILTER_RUNDIR= /var/run/pyspf-milter - -PLIST_FILES= '@dir(${USERS},${GROUPS},755) ${PYSPF_MILTER_RUNDIR}' \ +PLIST_FILES= '@dir(${USERS},${GROUPS},755) /var/run/pyspf-milter' \ '@sample etc/python-policyd-spf/policyd-spf.conf.sample' PORTDOCS= CHANGES README README.per_user_whitelisting \ @@ -43,14 +39,11 @@ PORTDOCS= CHANGES README README.per_user_whitelisting \ OPTIONS_DEFINE= DOCS post-patch: - @${REINPLACE_CMD} -e "s|/usr/local/etc/|${PREFIX}/etc/|" \ - ${WRKSRC}/spf_engine/milter_spf.py - @${REINPLACE_CMD} -e "s|/etc/|${PREFIX}/etc/|" \ - ${WRKSRC}/spf_engine/policyd_spf.py - @${REINPLACE_CMD} -e "s|/run|/var/run|" ${WRKSRC}/spf_engine/policydspfsupp.py - @${REINPLACE_CMD} -e "s|/etc/|${PREFIX}/etc/|" -e "s|/usr/bin/|${PREFIX}/bin/|" \ + @${REINPLACE_CMD} -e "s|%%PREFIX%%|${PREFIX}|" \ + ${WRKSRC}/spf_engine/milter_spf.py ${WRKSRC}/spf_engine/policyd_spf.py \ ${WRKSRC}/policyd-spf.1 ${WRKSRC}/policyd-spf.conf.5 \ ${WRKSRC}/policyd-spf.peruser.5 + @${FIND} ${WRKSRC} \( -name '*.bak' -or -name '*.orig' \) -delete post-install: @${MKDIR} ${STAGEDIR}/var/run/pyspf-milter \ diff --git a/mail/py-spf-engine/files/patch-policyd-spf.1 b/mail/py-spf-engine/files/patch-policyd-spf.1 new file mode 100644 index 000000000000..1ab3cd78a9a3 --- /dev/null +++ b/mail/py-spf-engine/files/patch-policyd-spf.1 @@ -0,0 +1,48 @@ +--- policyd-spf.1.orig 2020-04-18 06:04:36 UTC ++++ policyd-spf.1 +@@ -144,12 +144,12 @@ $ policyd-spf (Start using installed config file) + + $ policyd-spf \-h (Display usage message) + +-$ policyd-spf /etc/policyd-spf/policyd-spf.conf (Config file name to use) ++$ policyd-spf %%PREFIX%%/etc/python-policyd-spf/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/. ++%%PREFIX%%/etc/python-policyd-spf/. + + Additionally, whitelisting certain IP addresses or IP addresses used by listed + domains from SPF checks is supported. Skipping SPF checks for local submission +@@ -186,7 +186,7 @@ script is smoothed over time + The default policy_time_limit is 1000 seconds. This may be too short for some + SMTP transactions to complete. As recommended in SMTPD_POLICY_README, this + should be extended to 3600 seconds. To do so, set "policy_time_limit = 3600" +-in /etc/postfix/main.cf. ++in %%PREFIX%%/etc/postfix/main.cf. + + Messages that get a Fail SPF result will be rejected. Messages that get a + Permerror are, by default, treated as if they had no SPF record. Messages +@@ -244,10 +244,10 @@ followed by a empty line: + + .SH "POSTFIX INTEGRATION" + +- 1. Add the following to /etc/postfix/master.cf: ++ 1. Add the following to %%PREFIX%%/etc/postfix/master.cf: + + policyd-spf unix - n n - 0 spawn +- user=nobody argv=/usr/bin/policyd-spf ++ user=nobody argv=%%PREFIX%%/bin/policyd-spf + + NOTE: Check the path to both the installed Python 3 interpreter and + policyd-spf. These vary from system to system. To use non-default +@@ -257,7 +257,7 @@ followed by a empty line: + that instead. Python and Python 3 versions prior to 3.3 are not + supported. + +- 2. Configure the Postfix policy service in /etc/postfix/main.cf: ++ 2. Configure the Postfix policy service in %%PREFIX%%/etc/postfix/main.cf: + + smtpd_recipient_restrictions = + ... diff --git a/mail/py-spf-engine/files/patch-policyd-spf.conf.5 b/mail/py-spf-engine/files/patch-policyd-spf.conf.5 new file mode 100644 index 000000000000..6808c160c5ca --- /dev/null +++ b/mail/py-spf-engine/files/patch-policyd-spf.conf.5 @@ -0,0 +1,36 @@ +--- policyd-spf.conf.5.orig 2020-04-18 06:04:36 UTC ++++ policyd-spf.conf.5 +@@ -137,7 +137,7 @@ policyd-spf python configuration parameters + + .SH "USAGE" + Usage: +- policyd-spf [/etc/policyd-spf/policyd-spf.conf] ++ policyd-spf [%%PREFIX%%/etc/python-policyd-spf/policyd-spf.conf] + + .SH "OTHER DOCUMENTATION" + This documentation assumes you have read Postfix's README_FILES/ +@@ -162,7 +162,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 %%PREFIX%%/etc/python-policyd-spf/. + + Additionally, whitelisting certain IP addresses from SPF checks is supported. + This man page and the sample configuration file show the format to use. +@@ -684,12 +684,12 @@ visible to milters such as DMARC milter. + To use this feature requires additional postfix configuration to execute the + second, mock, instance of the policy server: + +- Add a second service to /etc/postfix/master.cf: ++ Add a second service to %%PREFIX%%/etc/postfix/master.cf: + + policyd-spf-mock unix - n n - 0 spawn +- user=nobody argv=/usr/bin/policyd-spf '/etc/pypolicyd-spf/mock ++ user=nobody argv=%%PREFIX%%/bin/policyd-spf '%%PREFIX%%/etc/pypolicyd-spf/mock + +-Configure the Postfix additional policy service in /etc/postfix/main.cf to ++Configure the Postfix additional policy service in %%PREFIX%%/etc/postfix/main.cf to + run before the regular service: + + smtpd_recipient_restrictions = diff --git a/mail/py-spf-engine/files/patch-policyd-spf.peruser.5 b/mail/py-spf-engine/files/patch-policyd-spf.peruser.5 new file mode 100644 index 000000000000..753aee30c928 --- /dev/null +++ b/mail/py-spf-engine/files/patch-policyd-spf.peruser.5 @@ -0,0 +1,20 @@ +--- policyd-spf.peruser.5.orig 2022-09-05 16:01:49 UTC ++++ policyd-spf.peruser.5 +@@ -137,7 +137,7 @@ policyd-spf python per-user configuration + + .SH "USAGE" + Usage: +- policyd-spf [/etc/policyd-spf/policyd-spf.conf] ++ policyd-spf [%%PREFIX%%/etc/python-policyd-spf/policyd-spf.conf] + + .SH "OTHER DOCUMENTATION" + This documentation assumes you have read Postfix's README_FILES/ +@@ -196,7 +196,7 @@ The text file option is useful for testing and when on + users require per-user configurations. It is specified in the main + configuration file: + +-"Per_User = text,/etc/pypolicyd-spf/userconf" ++"Per_User = text,%%PREFIX%%/etc/python-pypolicyd-spf/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 diff --git a/mail/py-spf-engine/files/patch-spf__engine_milter__spf.py b/mail/py-spf-engine/files/patch-spf__engine_milter__spf.py new file mode 100644 index 000000000000..6c384d78aa85 --- /dev/null +++ b/mail/py-spf-engine/files/patch-spf__engine_milter__spf.py @@ -0,0 +1,11 @@ +--- spf_engine/milter_spf.py.orig 2022-09-05 15:47:42 UTC ++++ spf_engine/milter_spf.py +@@ -207,7 +207,7 @@ class spfMilter(Milter.Base): + def main(): + # Ugh, but there's no easy way around this. + global milterconfig +- configFile = '/usr/local/etc/python-policyd-spf/policyd-spf.conf' ++ configFile = '%%PREFIX%%/etc/python-policyd-spf/policyd-spf.conf' + if len(sys.argv) > 1: + if sys.argv[1] in ('-?', '--help', '-h'): + print('usage: pyspf-milter []') diff --git a/mail/py-spf-engine/files/patch-spf__engine_policyd__spf.py b/mail/py-spf-engine/files/patch-spf__engine_policyd__spf.py new file mode 100644 index 000000000000..537f08fd7cca --- /dev/null +++ b/mail/py-spf-engine/files/patch-spf__engine_policyd__spf.py @@ -0,0 +1,11 @@ +--- spf_engine/policyd_spf.py.orig 2022-09-05 15:47:42 UTC ++++ spf_engine/policyd_spf.py +@@ -46,7 +46,7 @@ def main(): + + # load config file {{{1 + # Default location: +- configFile = '/etc/python-policyd-spf/policyd-spf.conf' ++ configFile = '%%PREFIX%%/etc/python-policyd-spf/policyd-spf.conf' + if len(sys.argv) > 1: + if sys.argv[1] in ( '-?', '--help', '-h' ): + print('usage: policyd-spf []') diff --git a/mail/py-spf-engine/files/patch-spf__engine_policydspfsupp.py b/mail/py-spf-engine/files/patch-spf__engine_policydspfsupp.py new file mode 100644 index 000000000000..39968058e44d --- /dev/null +++ b/mail/py-spf-engine/files/patch-spf__engine_policydspfsupp.py @@ -0,0 +1,25 @@ +--- spf_engine/policydspfsupp.py.orig 2020-04-18 06:04:36 UTC ++++ spf_engine/policydspfsupp.py +@@ -47,8 +47,8 @@ defaultConfigData = { + 'No_Mail' : False, + 'Mock' : False, + # For milter front end +- 'Socket': 'local:/run/pyspf-milter/pyspf-milter.sock', +- 'PidFile': '/run/pyspf-milter/pyspf-milter.pid', ++ 'Socket': 'local:/var/run/pyspf-milter/pyspf-milter.sock', ++ 'PidFile': '/var/run/pyspf-milter/pyspf-milter.pid', + 'UserID': 'pyspf-milter', + 'UMask': 7, + 'InternalHosts': '127.0.0.1', +@@ -153,9 +153,9 @@ def _readConfigFile(path, configData = None, configGlo + 'Socket': str, + 'PidFile': str, + 'UserID': str, +- 'UMask': 'int', ++ 'UMask': int, + 'InternalHosts': str, +- 'IntHosts': 'bool', ++ 'IntHosts': bool, + 'MacroListVerify': str, + } + diff --git a/mail/py-spf-engine/files/pyspf-milter.in b/mail/py-spf-engine/files/pyspf-milter.in index 2019e2bf129f..a21e5a5c4da8 100644 --- a/mail/py-spf-engine/files/pyspf-milter.in +++ b/mail/py-spf-engine/files/pyspf-milter.in @@ -26,8 +26,8 @@ command=/usr/sbin/daemon command_interpreter=%%PYTHON_CMD%% procname=%%PREFIX%%/bin/pyspf-milter command_args="-c -f ${procname} ${pyspf_milter_conffile}" -pidfile=%%PYSPF_MILTER_RUNDIR%%/pyspf-milter.pid -required_dirs=%%PYSPF_MILTER_RUNDIR%% +pidfile=/var/run/pyspf-milter/pyspf-milter.pid +required_dirs=/var/run/pyspf-milter required_files=${pyspf_milter_conffile} start_precmd=pyspf_milter_cleanup stop_postcmd=pyspf_milter_cleanup