Initial import of qmail-spp-spf, an implementation of SPF as a qmail-spp

module. It requires libspf2.
This commit is contained in:
schmonz 2018-12-06 00:07:33 +00:00
parent 4dd7bca24d
commit fab828c9c4
5 changed files with 80 additions and 0 deletions

2
mail/qmail-spp-spf/DESCR Normal file
View file

@ -0,0 +1,2 @@
This is an implementation of SPF as a qmail-spp module. It
requires libspf2.

View file

@ -0,0 +1,31 @@
# $NetBSD: Makefile,v 1.1 2018/12/06 00:07:33 schmonz Exp $
DISTNAME= qmail-spp-spf-20091020.c
PKGNAME= ${DISTNAME:S/.c$//}
CATEGORIES= mail
MASTER_SITES= ${HOMEPAGE}
EXTRACT_SUFX= # none
MAINTAINER= schmonz@NetBSD.org
HOMEPAGE= https://www.caputo.com/foss/qmail-spp-spf/
COMMENT= Plugin for qmail-spp that performs SPF lookups
LICENSE= gnu-gpl-v2
WRKSRC= ${WRKDIR}
LDFLAGS.SunOS+= -lnsl
INSTALLATION_DIRS= bin share/doc/${PKGBASE}
do-build:
cd ${WRKSRC} && \
${CC} ${CFLAGS} ${LDFLAGS} -lspf2 -o ${PKGBASE} ${DISTNAME}
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/${PKGBASE} \
${DESTDIR}${PREFIX}/bin/${PKGBASE}
${INSTALL_DATA} ${WRKSRC}/${DISTNAME} \
${DESTDIR}${PREFIX}/share/doc/${PKGBASE}/README
.include "../../mail/libspf2/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"

3
mail/qmail-spp-spf/PLIST Normal file
View file

@ -0,0 +1,3 @@
@comment $NetBSD: PLIST,v 1.1 2018/12/06 00:07:33 schmonz Exp $
bin/qmail-spp-spf
share/doc/qmail-spp-spf/README

View file

@ -0,0 +1,7 @@
$NetBSD: distinfo,v 1.1 2018/12/06 00:07:33 schmonz Exp $
SHA1 (qmail-spp-spf-20091020.c) = 3aca350c027345126cc631ffecdbbb697c9c4c45
RMD160 (qmail-spp-spf-20091020.c) = 874bf86fdd4ddb671ad0827e1bf56cdda1deaec9
SHA512 (qmail-spp-spf-20091020.c) = ffccb601ffa6d9088fc2530024412628a69f57f6448b78fa0d37d4aecc4a886360682bcaf49391f94edeb56b1cbf576122183461f25d4a661ce16e1eeeed8bf0
Size (qmail-spp-spf-20091020.c) = 14965 bytes
SHA1 (patch-qmail-spp-spf-20091020.c) = 6148fb9f1f56b6e154890a3de10877572e139add

View file

@ -0,0 +1,37 @@
$NetBSD: patch-qmail-spp-spf-20091020.c,v 1.1 2018/12/06 00:07:33 schmonz Exp $
Adjust include path and IPv6 struct access.
--- qmail-spp-spf-20091020.c.orig 2018-12-05 23:27:39.000000000 +0000
+++ qmail-spp-spf-20091020.c
@@ -150,7 +150,7 @@
#include <time.h>
#include <arpa/inet.h>
#include <unistd.h>
-#include "spf.h"
+#include "spf2/spf.h"
#define LOG "qmail-spp-spf: "
#define LOGR "qmail-spp-spf:%s: "
@@ -263,10 +263,17 @@ int random_ip_passes(SPF_request_t *spf_
}
else
{
- addr6.s6_addr32[0] = random();
- addr6.s6_addr32[1] = random();
- addr6.s6_addr32[2] = random();
- addr6.s6_addr32[3] = random();
+#if defined (__linux__)
+# define v6member s6_addr32
+#elif (defined (sun) || defined (__sun)) && (defined (__SVR4) || defined(__svr4__))
+# define v6member _S6_un._S6_u32
+#else
+# define v6member __u6_addr.__u6_addr32
+#endif
+ addr6.v6member[0] = random();
+ addr6.v6member[1] = random();
+ addr6.v6member[2] = random();
+ addr6.v6member[3] = random();
if (SPF_request_set_ipv6(spf_request, addr6))
{