X-Original-To: alpine-aports@lists.alpinelinux.org Received: from sdaoden.eu (sdaoden.eu [217.144.132.164]) by lists.alpinelinux.org (Postfix) with ESMTP id A81875C4CE3 for ; Wed, 31 Jan 2018 22:11:53 +0000 (GMT) Received: by sdaoden.eu (Postfix, from userid 1000) id 280E616045; Wed, 31 Jan 2018 23:11:53 +0100 (CET) Date: Wed, 31 Jan 2018 23:11:52 +0100 From: Steffen Nurpmeso To: alpine-aports@lists.alpinelinux.org Subject: [alpine-aports] [PATCH] testing/dma: update to HEAD plus fixes Message-ID: <2abe52d2c00e24cebb03c3a88bd7e517796797fe.1517436520.git.steffen@sdaoden.eu> Mail-Followup-To: alpine-aports@lists.alpinelinux.org User-Agent: s-nail v14.9.6-48-gd837577b OpenPGP: id=EE19E1C1F2F7054F8D3954D8308964B51883A0DD; url=https://ftp.sdaoden.eu/steffen.asc BlahBlahBlah: Any stupid boy can crush a beetle. But all the professors in the world can make no bugs. Date: Wed, 31 Jan 2018 22:28:28 +0100 X-Mailinglist: alpine-aports Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable This configuration (though compiled and installed manually not via package) works for me since end of October 2017. Compared to the two year old release v0.11 this includes severel security and other bug fixes. --- ...hangeset-seen-on-svn-src-head-freebsd.org.patch | 34 ++++++ .../dma/0002-Compile-and-run-on-AlpineLinux.patch | 136 +++++++++++++++++= ++++ abuild-pkg/testing/dma/APKBUILD | 62 ++++++++++ abuild-pkg/testing/dma/aliases | 22 ++++ abuild-pkg/testing/dma/dma.cron | 5 + 5 files changed, 259 insertions(+) create mode 100644 abuild-pkg/testing/dma/0001-Apply-changeset-seen-on-svn= -src-head-freebsd.org.patch create mode 100644 abuild-pkg/testing/dma/0002-Compile-and-run-on-AlpineLi= nux.patch create mode 100644 abuild-pkg/testing/dma/APKBUILD create mode 100644 abuild-pkg/testing/dma/aliases create mode 100644 abuild-pkg/testing/dma/dma.cron diff --git a/abuild-pkg/testing/dma/0001-Apply-changeset-seen-on-svn-src-he= ad-freebsd.org.patch b/abuild-pkg/testing/dma/0001-Apply-changeset-seen-on-= svn-src-head-freebsd.org.patch new file mode 100644 index 0000000..7c347db --- /dev/null +++ b/abuild-pkg/testing/dma/0001-Apply-changeset-seen-on-svn-src-head-free= bsd.org.patch @@ -0,0 +1,34 @@ +From 6ccab27a89c55304a78f1825f77de62046cf7c13 Mon Sep 17 00:00:00 2001 +Message-Id: <6ccab27a89c55304a78f1825f77de62046cf7c13.1517433905.git.steff= en@sdaoden.eu> +From: Steffen Nurpmeso +Date: Fri, 27 Oct 2017 23:05:28 +0200 +Subject: [PATCH 1/2] Apply changeset seen on svn-src-head@freebsd.org.. + + From: Ed Maste + Subject: svn commit: r325047 - head/contrib/dma + Date: Fri, 27 Oct 2017 20:21:09 +0000 (UTC) + Message-ID: <201710272021.v9RKL9nw046658@repo.freebsd.org> + To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@fr= eebsd.org + + Author: emaste + Date: Fri Oct 27 20:21:09 2017 + New Revision: 325047 + URL: https://svnweb.freebsd.org/changeset/base/325047 + +diff --git a/dma.c b/dma.c +index e643e0f..126aad7 100644 +--- a/dma.c ++++ b/dma.c +@@ -331,8 +331,8 @@ retry: +=20 + switch (error) { + case 0: +- delqueue(it); + syslog(LOG_INFO, "<%s> delivery successful", it->addr); ++ delqueue(it); + exit(EX_OK); +=20 + case 1: +--=20 +2.16.1 + diff --git a/abuild-pkg/testing/dma/0002-Compile-and-run-on-AlpineLinux.pat= ch b/abuild-pkg/testing/dma/0002-Compile-and-run-on-AlpineLinux.patch new file mode 100644 index 0000000..a539cd1 --- /dev/null +++ b/abuild-pkg/testing/dma/0002-Compile-and-run-on-AlpineLinux.patch @@ -0,0 +1,136 @@ +From f8f802f4fdf7858789c386df45cd45e43f960fe9 Mon Sep 17 00:00:00 2001 +Message-Id: +In-Reply-To: <6ccab27a89c55304a78f1825f77de62046cf7c13.1517433905.git.stef= fen@sdaoden.eu> +References: <6ccab27a89c55304a78f1825f77de62046cf7c13.1517433905.git.steff= en@sdaoden.eu> +From: Steffen Nurpmeso +Date: Tue, 7 Nov 2017 16:02:38 +0100 +Subject: [PATCH 2/2] Compile and run on AlpineLinux + +--- + dfcompat.c | 2 +- + dma-mbox-create.c | 5 ++--- + dma.c | 1 - + dma.h | 7 +++++-- + dns.c | 3 +++ + local.c | 3 +-- + 7 files changed, 13 insertions(+), 10 deletions(-) + +diff --git a/dfcompat.c b/dfcompat.c +index 8df906e..b3cb878 100644 +--- a/dfcompat.c ++++ b/dfcompat.c +@@ -105,7 +105,7 @@ reallocf(void *ptr, size_t size) +=20 + #ifndef HAVE_GETPROGNAME +=20 +-#ifdef __GLIBC__ ++#ifdef __linux__ +=20 + #include +=20 +diff --git a/dma-mbox-create.c b/dma-mbox-create.c +index 8008860..3be17f9 100644 +--- a/dma-mbox-create.c ++++ b/dma-mbox-create.c +@@ -44,7 +44,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -129,9 +128,9 @@ main(int argc, char **argv) + if (!pw) + logfail(EX_NOUSER, "cannot find user `%s'", user); +=20 +- maildirfd =3D open(_PATH_MAILDIR, O_RDONLY); ++ maildirfd =3D open(MAILDIR_PATH, O_RDONLY); + if (maildirfd < 0) +- logfail(EX_NOINPUT, "cannot open maildir %s", _PATH_MAILDIR); ++ logfail(EX_NOINPUT, "cannot open maildir %s", MAILDIR_PATH); +=20 + user_uid =3D pw->pw_uid; +=20 +diff --git a/dma.c b/dma.c +index 126aad7..4af1501 100644 +--- a/dma.c ++++ b/dma.c +@@ -48,7 +48,6 @@ + #include + #include + #include +-#include + #include + #include + #include +diff --git a/dma.h b/dma.h +index 5934176..fb27d44 100644 +--- a/dma.h ++++ b/dma.h +@@ -38,7 +38,7 @@ + #define DMA_H +=20 + #include +-#include ++#include + #include + #include + #include +@@ -81,7 +81,7 @@ + #define SPOOL_FLUSHFILE "flush" +=20 + #ifndef DMA_ROOT_USER +-#define DMA_ROOT_USER "mail" ++#define DMA_ROOT_USER "smtpd" + #endif + #ifndef DMA_GROUP + #define DMA_GROUP "mail" +@@ -91,6 +91,9 @@ + #define MBOX_STRICT 0 + #endif +=20 ++#ifndef MAILDIR_PATH ++# define MAILDIR_PATH "/var/spool/mail" ++#endif +=20 + struct stritem { + SLIST_ENTRY(stritem) next; +diff --git a/dns.c b/dns.c +index bd28c4d..e95cc4a 100644 +--- a/dns.c ++++ b/dns.c +@@ -45,6 +45,9 @@ + #include +=20 + #include "dma.h" ++#ifndef roundup ++#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) ++#endif +=20 + static int + sort_pref(const void *a, const void *b) +diff --git a/local.c b/local.c +index 2bfdbb3..27d5b43 100644 +--- a/local.c ++++ b/local.c +@@ -40,7 +40,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -137,7 +136,7 @@ deliver_local(struct qitem *it) + off_t mboxlen; + time_t now =3D time(NULL); +=20 +- error =3D snprintf(fn, sizeof(fn), "%s/%s", _PATH_MAILDIR, it->addr); ++ error =3D snprintf(fn, sizeof(fn), "%s/%s", MAILDIR_PATH, it->addr); + if (error < 0 || (size_t)error >=3D sizeof(fn)) { + syslog(LOG_NOTICE, "local delivery deferred: %m"); + return (1); +--=20 +2.16.1 + diff --git a/abuild-pkg/testing/dma/APKBUILD b/abuild-pkg/testing/dma/APKBU= ILD new file mode 100644 index 0000000..043bd80 --- /dev/null +++ b/abuild-pkg/testing/dma/APKBUILD @@ -0,0 +1,62 @@ +# Contributor: S=C3=B6ren Tempel +# Contributor: Steffen Nurpmeso +# Maintainer: +pkgname=3Ddma +pkgver=3D20180131 +pkgsha=3D47ac0463433c187ff4528f2b0b9eb75f63866815 +pkgrel=3D0 +pkgdesc=3D"DragonFly (BSD) Mail Agent" +url=3D"https://github.com/corecode/dma" +arch=3D"all" +license=3D"BSD" +depends=3D"" +makedepends=3D"byacc flex libbsd-dev bsd-compat-headers libressl-dev" +options=3D"suid !check" +subpackages=3D"$pkgname-doc" +source=3D"$pkgname-$pkgver.tar.gz::https://github.com/corecode/$pkgname/ar= chive/$pkgsha.tar.gz + aliases + $pkgname.cron + 0001-Apply-changeset-seen-on-svn-src-head-freebsd.org.patch + 0002-Compile-and-run-on-AlpineLinux.patch" +builddir=3D"$srcdir"/$pkgname-$pkgsha + +# LD_LIBRARY_PATH is included via -rpath, so use system defaults only. +# And ensure no other paths sneak in. +unset LIBRARY_PATH LD_RUN_PATH +PATH=3D/sbin:/usr/sbin:/bin:/usr/bin +C_INCLUDE_PATH=3D/usr/include +LD_LIBRARY_PATH=3D/lib:/usr/lib +export PATH C_INCLUDE_PATH LD_LIBRARY_PATH + +build() { + make -C "$builddir" +} + +package() { + cd "$builddir" + + make DESTDIR=3D"$pkgdir" PREFIX=3D/usr install install-etc + + for p in bin/mailq bin/newailases sbin/sendmail; do + mkdir -p "$pkgdir"/usr/${p%/*} + ln -s /usr/sbin/dma "$pkgdir"/usr/$p + done + + # Create spool directory. + install -d -o root -g mail \ + -m 775 "$pkgdir"/var/spool/$pkgname + + # And homework + install -Dm644 "$srcdir"/aliases "$pkgdir"/etc/aliases + install -Dm755 "$srcdir"/$pkgname.cron \ + "$pkgdir"/etc/periodic/15min/$pkgname + +} + +sha512sums=3D" +ab34a454c38f3a7986f2f5704d87d6d3a4332d24cfb1df1512c7dffb40389df737e9451127= 272ed793f59932514bd6b2518343f373ef1d58097e52337dd7ea8d $pkgname-$pkgver.ta= r.gz +eacaf6a9894e265dd1003447bba6daa53cd4e9dc8536f499da81698d795bbe34a345f9e1b9= c696c2a0badc8fa5076b40b7eebfdc918424c4e4514df2fc9119be aliases +5a79895fd42ffee347b979402225eb8025ea9bb41d0dc24b43d4b1e64106f1c612024456ea= 98e20aef4258eb8e852b370410e47d6ee34cea630dda29cc54840e dma.cron +db86b8d1ae948d5693819dccc7399332d5c5f223087d94ce881518279ac71605c371933f60= 2aa4910498da666cb33bddb60afda61e0317c97063830bfd6485fc 0001-Apply-changese= t-seen-on-svn-src-head-freebsd.org.patch +c0fa10945d85bd46f9fb9d447e7b1e9b22aad09736e693e0cd64af4f36112df85e6c8f8e14= 474d273d9da4a940165cc6800cd91a3ddc35ef451d495c0c74fdc6 0002-Compile-and-ru= n-on-AlpineLinux.patch +" diff --git a/abuild-pkg/testing/dma/aliases b/abuild-pkg/testing/dma/aliases new file mode 100644 index 0000000..0369b14 --- /dev/null +++ b/abuild-pkg/testing/dma/aliases @@ -0,0 +1,22 @@ +# Basic system aliases -- these MUST be present +MAILER-DAEMON: postmaster +postmaster: root + +# General redirections for pseudo accounts +bin: root +daemon: root +named: root +nobody: root +uucp: root +www: root + +# Put your local aliases here. + +# Well-known aliases +manager: root +dumper: root +operator: root +abuse: postmaster + +# trap decode to catch security attacks +decode: root diff --git a/abuild-pkg/testing/dma/dma.cron b/abuild-pkg/testing/dma/dma.c= ron new file mode 100644 index 0000000..d37f4f9 --- /dev/null +++ b/abuild-pkg/testing/dma/dma.cron @@ -0,0 +1,5 @@ +#!/bin/sh +# Flush the DMA queue automatically. + +/usr/sbin/dma -q1 +exit 0 --=20 2.16.1 --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt) --- Unsubscribe: alpine-aports+unsubscribe@lists.alpinelinux.org Help: alpine-aports+help@lists.alpinelinux.org ---