git: 2920ddff7498 - main - mail/py-pyspf: Fix runtime on IPv6

From: Po-Chuan Hsieh <sunpoet_at_FreeBSD.org>
Date: Mon, 11 Sep 2023 16:06:04 UTC
The branch main has been updated by sunpoet:

URL: https://cgit.FreeBSD.org/ports/commit/?id=2920ddff74980fdebe12c0ff4d48b067c2e5ebe9

commit 2920ddff74980fdebe12c0ff4d48b067c2e5ebe9
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2023-09-11 16:05:19 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2023-09-11 16:05:36 +0000

    mail/py-pyspf: Fix runtime on IPv6
    
    - Bump PORTREVISION for package change
    
    % spf.py 2610:1c1:1:606c::50:15 FreeBSD.org localhost
    /usr/local/bin/spf.py:131: DeprecationWarning: please use dns.resolver.resolve() instead
      answers = dns.resolver.query(name, qtype, lifetime=timeout)
    result: ('softfail', 250, 'domain owner discourages use of this host') ~all
    
    PR:             268030
    Submitted by:   <takefu@airport.fm>
---
 mail/py-pyspf/Makefile           |  1 +
 mail/py-pyspf/files/patch-spf.py | 11 +++++++++++
 2 files changed, 12 insertions(+)

diff --git a/mail/py-pyspf/Makefile b/mail/py-pyspf/Makefile
index cdf8ca429d45..48fb26625686 100644
--- a/mail/py-pyspf/Makefile
+++ b/mail/py-pyspf/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	pyspf
 PORTVERSION=	2.0.14
+PORTREVISION=	1
 CATEGORIES=	mail python
 MASTER_SITES=	PYPI
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
diff --git a/mail/py-pyspf/files/patch-spf.py b/mail/py-pyspf/files/patch-spf.py
new file mode 100644
index 000000000000..2ce960adfed7
--- /dev/null
+++ b/mail/py-pyspf/files/patch-spf.py
@@ -0,0 +1,11 @@
+--- spf.py.orig	2020-01-01 21:02:26 UTC
++++ spf.py
+@@ -128,7 +128,7 @@ def DNSLookup_dnspython(name, qtype, tcpfallback=True,
+     retVal = []
+     try:
+         # FIXME: how to disable TCP fallback in dnspython if not tcpfallback?
+-        answers = dns.resolver.query(name, qtype, lifetime=timeout)
++        answers = dns.resolver.resolve(name, qtype)
+         for rdata in answers:
+             if qtype == 'A' or qtype == 'AAAA':
+                 retVal.append(((name, qtype), rdata.address))