opendkim: initial commit, version 2.11.0-Beta2

This commit is contained in:
Tim Biermann 2024-07-10 20:47:45 +02:00
parent 71d670c059
commit 6dacb8349e
Signed by: tb
GPG Key ID: 42F8B4E30B673606
6 changed files with 179 additions and 0 deletions

39
opendkim/.footprint Normal file
View File

@ -0,0 +1,39 @@
drwxr-xr-x root/root etc/
drwxr-xr-x root/root etc/opendkim/
drwxr-xr-x root/root etc/opendkim/keys/
-rw-r--r-- root/root etc/opendkim/opendkim.conf
drwxr-xr-x root/root etc/rc.d/
-rwxr-xr-x root/root etc/rc.d/opendkim
drwxr-xr-x root/root usr/
drwxr-xr-x root/root usr/include/
drwxr-xr-x root/root usr/include/opendkim/
-rw-r--r-- root/root usr/include/opendkim/dkim.h
drwxr-xr-x root/root usr/lib/
-rw-r--r-- root/root usr/lib/libopendkim.a
-rwxr-xr-x root/root usr/lib/libopendkim.la
lrwxrwxrwx root/root usr/lib/libopendkim.so -> libopendkim.so.11.0.0
lrwxrwxrwx root/root usr/lib/libopendkim.so.11 -> libopendkim.so.11.0.0
-rwxr-xr-x root/root usr/lib/libopendkim.so.11.0.0
drwxr-xr-x root/root usr/lib/pkgconfig/
-rw-r--r-- root/root usr/lib/pkgconfig/opendkim.pc
drwxr-xr-x root/root usr/sbin/
-rwxr-xr-x root/root usr/sbin/opendkim
-rwxr-xr-x root/root usr/sbin/opendkim-genkey
-rwxr-xr-x root/root usr/sbin/opendkim-genzone
-rwxr-xr-x root/root usr/sbin/opendkim-testkey
-rwxr-xr-x root/root usr/sbin/opendkim-testmsg
drwxr-xr-x root/root usr/share/
drwxr-xr-x root/root usr/share/man/
drwxr-xr-x root/root usr/share/man/man1/
drwxr-xr-x root/root usr/share/man/man3/
drwxr-xr-x root/root usr/share/man/man5/
-rw-r--r-- root/root usr/share/man/man5/opendkim.conf.5.gz
drwxr-xr-x root/root usr/share/man/man8/
-rw-r--r-- root/root usr/share/man/man8/opendkim-genkey.8.gz
-rw-r--r-- root/root usr/share/man/man8/opendkim-genzone.8.gz
-rw-r--r-- root/root usr/share/man/man8/opendkim-testkey.8.gz
-rw-r--r-- root/root usr/share/man/man8/opendkim-testmsg.8.gz
-rw-r--r-- root/root usr/share/man/man8/opendkim.8.gz
drwxr-xr-x root/root var/
drwxr-xr-x root/root var/lib/
drwxr-xr-x opendkim/opendkim var/lib/opendkim/

7
opendkim/.signature Normal file
View File

@ -0,0 +1,7 @@
untrusted comment: verify with /etc/ports/contrib.pub
RWSagIOpLGJF37xJ52QKPHJwN8KQu9uMpxPLWqGAjLzZR9cTN8HD3RWMRHKCi+RlOZgvtlEb5y42dHi56DRalmeW8NmZuMYuBwE=
SHA256 (Pkgfile) = ee7d5a8a38f96361e594dffcbe656c2b4483fd3c5dc3823c78ce64e51fd466b6
SHA256 (.footprint) = 7a622f11daf1413e628d13ac3bc1d651867261574e98423262148dbe9a58ef22
SHA256 (opendkim-2.11.0-Beta2.tar.gz) = cdbaf12b0d8f38c19d24b34db998ec156635b8d2f7c9f0245c061348250df6c8
SHA256 (opendkim.rc) = d6b39f9568651180e40f9317c067339c7f7c1bbbf35a6aacdb9288a865338981
SHA256 (7c70ee7c86da1cecc621182355cc950d3b193314.patch) = d677e975977a94c09aaf1c92a98797189d969cdce98ac3867d7a3737ad4eaab0

View File

@ -0,0 +1,39 @@
From 7c70ee7c86da1cecc621182355cc950d3b193314 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?David=20B=C3=BCrgin?= <dbuergin@gluet.ch>
Date: Sat, 14 Oct 2023 09:19:37 +0200
Subject: [PATCH] Delete Authentication-Results headers in reverse
---
opendkim/opendkim.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/opendkim/opendkim.c b/opendkim/opendkim.c
index 803f37b0..cfa5f018 100644
--- a/opendkim/opendkim.c
+++ b/opendkim/opendkim.c
@@ -13653,8 +13653,15 @@ mlfi_eom(SMFICTX *ctx)
return SMFIS_TEMPFAIL;
}
- c = 0;
+ c = 1;
+
for (hdr = dfc->mctx_hqhead; hdr != NULL; hdr = hdr->hdr_next)
+ {
+ if (strcasecmp(hdr->hdr_hdr, AUTHRESULTSHDR) == 0)
+ c++;
+ }
+
+ for (hdr = dfc->mctx_hqtail; hdr != NULL; hdr = hdr->hdr_prev)
{
memset(ares, '\0', sizeof(struct authres));
@@ -13666,7 +13673,7 @@ mlfi_eom(SMFICTX *ctx)
char *slash;
/* remember index */
- c++;
+ c--;
/* parse the header */
arstat = ares_parse((u_char *) hdr->hdr_val,

39
opendkim/Pkgfile Normal file
View File

@ -0,0 +1,39 @@
# Description: an open source implementation of the Domain Keys Identified Mail sender authentication system
# URL: http://www.opendkim.org/
# Maintainer:
# Depends on: libbsd libmilter
# Optional: openldap jansson
name=opendkim
version=2.11.0-Beta2
release=2
source=(https://github.com/trusteddomainproject/OpenDKIM/archive/$version/$name-$version.tar.gz
opendkim.rc
7c70ee7c86da1cecc621182355cc950d3b193314.patch)
build() {
cd OpenDKIM-$version
prt-get isinst openldap && PKGMK_OPENDKIM+=' --with-openldap'
prt-get isinst jansson && PKGMK_OPENDKIM+=' --with-libjansson'
patch -p1 -i $SRC/7c70ee7c86da1cecc621182355cc950d3b193314.patch
autoreconf -fi
CFLAGS="${CFLAGS} -I/usr/opt/libbsd/include" \
LDFLAGS="${LDFLAGS} -L/usr/opt/libbsd/lib" \
LD_LIBRARY_PATH="/usr/oprt/libbsd/lib" \
PKG_CONFIG_PATH="/usr/opt/libbsd/lib/pkgconfig" \
./configure --prefix=/usr \
--with-milter
make
make DESTDIR=$PKG install
install -o root -g root -m 0755 -D $SRC/$name.rc $PKG/etc/rc.d/$name
install -o root -g root -m 0755 -d $PKG/etc/$name/keys
install -o root -g root -m 0644 $name/$name.conf.sample $PKG/etc/$name/$name.conf
install -o opendkim -g opendkim -m 0755 -d $PKG/var/lib/opendkim
rm -r $PKG/usr/share/doc
}

46
opendkim/opendkim.rc Executable file
View File

@ -0,0 +1,46 @@
#!/bin/sh
#
# /etc/rc.d/opendkim: start/stop the opendkim daemon
#
SSD=/sbin/start-stop-daemon
PROG=/usr/sbin/opendkim
PID=/run/opendkim/opendkim.pid
OPTS="-x /etc/opendkim/opendkim.conf"
USER=opendkim
GROUP=$USER
HOME="/run/opendkim"
case $1 in
"start")
[ ! -e /run/opendkim ] && install -o $USER -g $GROUP -m 0755 -d $HOME
$SSD --start --pidfile $PID -u $USER --exec $PROG -- $OPTS
;;
"stop")
$SSD --stop --retry 10 --exec $PROG --pidfile $PID
;;
"restart")
$0 stop
$0 start
;;
"status")
$SSD --status --name opendkim --pidfile $PID
case $? in
0)
echo "$PROG is running with pid $(cat $PID)"
;;
1)
echo "$PROG is not running but pid file $PID exists"
;;
3)
echo "$PROG is not running"
;;
4)
echo "Unable to determine program status"
;;
esac
;;
*)
echo "Usage: $0 [start|stop|restart|status]"
;;
esac

9
opendkim/pre-install Executable file
View File

@ -0,0 +1,9 @@
#!/bin/sh -e
_USER=opendkim
_HOME=/var/lib/opendkim
_GROUP=opendkim
/usr/bin/getent group $_GROUP > /dev/null 2>&1 || /usr/sbin/groupadd $_GROUP
/usr/bin/getent passwd $_USER > /dev/null 2>&1 || /usr/sbin/useradd -c 'opendkim system user' -g $_GROUP -d $_HOME -s /bin/false $_USER
passwd -l $_USER > /dev/null