From 619f77a4a73552b7f284cc533efeff015bbfcb60 Mon Sep 17 00:00:00 2001 From: Simon Frankenberger Date: Sat, 5 Sep 2020 14:38:24 +0200 Subject: testing/nullmailer: new aport --- testing/nullmailer/APKBUILD | 55 +++++++++++++++++++++++++++ testing/nullmailer/adminaddr.conf | 2 + testing/nullmailer/defaultdomain.conf | 2 + testing/nullmailer/fix-tests-catch-port.patch | 28 ++++++++++++++ testing/nullmailer/nullmailer.initd | 11 ++++++ testing/nullmailer/nullmailer.pre-install | 6 +++ testing/nullmailer/remotes.conf | 3 ++ 7 files changed, 107 insertions(+) create mode 100644 testing/nullmailer/APKBUILD create mode 100644 testing/nullmailer/adminaddr.conf create mode 100644 testing/nullmailer/defaultdomain.conf create mode 100644 testing/nullmailer/fix-tests-catch-port.patch create mode 100644 testing/nullmailer/nullmailer.initd create mode 100755 testing/nullmailer/nullmailer.pre-install create mode 100644 testing/nullmailer/remotes.conf diff --git a/testing/nullmailer/APKBUILD b/testing/nullmailer/APKBUILD new file mode 100644 index 0000000000..b15b887963 --- /dev/null +++ b/testing/nullmailer/APKBUILD @@ -0,0 +1,55 @@ +# Contributor: Simon Frankenberger +# Maintainer: Simon Frankenberger +pkgname=nullmailer +pkgver=2.2 +pkgrel=0 +pkgdesc="Simple relay-only mail transport agent" +url="https://github.com/bruceg/nullmailer" +arch="all" +license="GPL-2.0-only" +subpackages="$pkgname-doc $pkgname-openrc" +makedepends="automake autoconf bash" +checkdepends="daemontools ucspi-tcp6" +source="$pkgname-$pkgver.tar.gz::https://github.com/bruceg/nullmailer/archive/$pkgver.tar.gz + fix-tests-catch-port.patch + + nullmailer.initd + adminaddr.conf + defaultdomain.conf + remotes.conf + " +pkgusers="nullmailer" +pkggroups="nullmailer" +install="$pkgname.pre-install" + +prepare() { + default_prepare + ash ./autogen.sh +} + +build() { + ./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --localstatedir=/var + make +} + +check() { + make check +} + +package() { + make DESTDIR=$pkgdir install + install -Dm0755 "$srcdir/nullmailer.initd" "$pkgdir/etc/init.d/nullmailer" + install -Dm0644 "$srcdir/adminaddr.conf" "$pkgdir/etc/nullmailer/adminaddr" + install -Dm0644 "$srcdir/defaultdomain.conf" "$pkgdir/etc/nullmailer/defaultdomain" + install -Dm0644 "$srcdir/remotes.conf" "$pkgdir/etc/nullmailer/remotes" +} + +sha512sums="15c070edcf820ad13d8e0b250f73d75e45f592caa039e94fd717226fe09cd0ddc1f165388fab6234f57b340acc5127b54df14f35022858aab971b1f3d4e89e63 nullmailer-2.2.tar.gz +499666333703d6b4dfe9afa76f1d4a48ec7faa4a2ca9dbe8aee6737ce98dcf4509b281ebe2fd2ce0b32d3a91b807a8b2dcffe794b70cb5b3ccb10cb7eca713e4 fix-tests-catch-port.patch +e183bf83055ea0d9fd63598329296d9f654f99bea8761b4f9a5961a76b26ae62e4a8a4b92007e12ecd56e8416a3bac87aaff16d575c7079d6ac571e3b8f80595 nullmailer.initd +93eac7b9fde3c7a2ffe3acdba1dcfccc1e40d94eb9fc7fc6722d3dfaaa3fd4378bf33698ebc0e10e108833251dbfa35fd280d62d865145fe415c431120b11ffe adminaddr.conf +0d3df6c4d710b8e91d40649ca991e7ab424be625cae724f8305d1ed4f2cf8a1b08e07030ee690cea7091a4c0320aae4e2df14e19efbcc54f1875338d883d8809 defaultdomain.conf +9858c4c52057b222c4f4219301adcc8b36e6c7e4ed51af51f887141fba7a639ed52b756eec06776c91f91767006c4592bca0158708acc371a9123d2efd9b6004 remotes.conf" diff --git a/testing/nullmailer/adminaddr.conf b/testing/nullmailer/adminaddr.conf new file mode 100644 index 0000000000..4d56e6f764 --- /dev/null +++ b/testing/nullmailer/adminaddr.conf @@ -0,0 +1,2 @@ +# contains the target email address to send emails +#target-email-address@your-domain.net diff --git a/testing/nullmailer/defaultdomain.conf b/testing/nullmailer/defaultdomain.conf new file mode 100644 index 0000000000..15dc39a01f --- /dev/null +++ b/testing/nullmailer/defaultdomain.conf @@ -0,0 +1,2 @@ +# marks the domain the emails are sent from +#example.com diff --git a/testing/nullmailer/fix-tests-catch-port.patch b/testing/nullmailer/fix-tests-catch-port.patch new file mode 100644 index 0000000000..54bace9362 --- /dev/null +++ b/testing/nullmailer/fix-tests-catch-port.patch @@ -0,0 +1,28 @@ +From: Simon Frankenberger +Date: Wed, 16 Sep 2020 09:46:13 +0200 +Subject: fix port detection from tcpserver in tests + +It seems that the port printed out by tcpserver differs from +the expected form. Use some bash magic to extract the port number +from the logline (last element in last line, separated by space). + +--- old/test/functions.in ++++ new/test/functions.in +@@ -52,6 +52,7 @@ + catch-port() { + local name=$1 + port=$( head -n 1 $tmpdir/service/${name}-log ) ++ port=${port##* } + } + + #not() { if "$@"; then return 1; else return 0; fi } +--- old/test/tests/protocols ++++ new/test/tests/protocols +@@ -51,6 +51,7 @@ + + start server tcpserver -1 0 0 date + port=$( head -n 1 $tmpdir/service/server-log ) ++ port=${port##* } + echo "Testing protocol failure with $p." + error 11 protocol $p -p $port --host=localhost 3<$testmail + stop server diff --git a/testing/nullmailer/nullmailer.initd b/testing/nullmailer/nullmailer.initd new file mode 100644 index 0000000000..63e1757d92 --- /dev/null +++ b/testing/nullmailer/nullmailer.initd @@ -0,0 +1,11 @@ +#!/sbin/openrc-run +supervisor=supervise-daemon + +name=nullmailer +description="Nullmailer relay-only MTA" + +command=/usr/sbin/nullmailer-send + +depend() { + need net +} diff --git a/testing/nullmailer/nullmailer.pre-install b/testing/nullmailer/nullmailer.pre-install new file mode 100755 index 0000000000..ee998ea51f --- /dev/null +++ b/testing/nullmailer/nullmailer.pre-install @@ -0,0 +1,6 @@ +#!/bin/sh + +addgroup -S nullmailer 2>/dev/null +adduser -SD -h /var/spool/nullmailer -G nullmailer nullmailer 2>/dev/null + +exit 0 diff --git a/testing/nullmailer/remotes.conf b/testing/nullmailer/remotes.conf new file mode 100644 index 0000000000..d35c8fb18b --- /dev/null +++ b/testing/nullmailer/remotes.conf @@ -0,0 +1,3 @@ +# contains the email login configuration on the remote system +#127.0.0.1 smtp +#smtp.gmail.com smtp --auth-login --port=587 --starttls --user=your-name@gmail.com --pass=your-password --starttls -- cgit v1.2.1