Commit ada4912f authored by Jonathan Curran's avatar Jonathan Curran Committed by Natanael Copa

testing/opensmtpd: new aport

This aport provides the portable version of OpenSMTPD patched to work
with musl.

Parts of the patch will be submitted upstream soon.

https://opensmtpd.org
parent 0dccbe50
This diff is collapsed.
# Contributor: Jonathan Curran <jonathan@curran.in>
# Maintainer: Jonathan Curran <jonathan@curran.in>
pkgname=opensmtpd
pkgver=5.7.1p1
pkgrel=0
pkgdesc="secure, reliable, lean, and easy-to configure SMTP server"
url="http://www.opensmtpd.org"
arch="all"
license="ISC"
depends=""
depends_dev=""
makedepends="automake autoconf libtool mdocml db-dev libasr libevent-dev openssl-dev"
install="$pkgname.pre-install $pkgname.post-install"
subpackages="$pkgname-doc"
source="https://www.opensmtpd.org/archives/opensmtpd-${pkgver}.tar.gz
00-opensmtpd.patch
smtpd.initd
aliases"
_builddir=${srcdir}/${pkgname}-${pkgver}
prepare() {
local i
cd "$_builddir"
for i in $source; do
case $i in
*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
esac
done
}
build() {
cd "$_builddir"
aclocal -I m4
autoconf
autoheader
automake --foreign --add-missing --copy
./configure --build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
--sysconfdir=/etc/smtpd \
--enable-table-db \
--with-privsep-user=smtpd \
--with-queue-user=smtpq \
--with-maildir=/var/spool/mail \
--with-sock-dir=/run \
--with-libs="-lfts" \
--with-pie \
--with-Werror \
--mandir=/usr/share/man \
--with-mantype=man || return 1
make || return 1
}
package() {
cd "$_builddir"
make DESTDIR=${pkgdir} install || return 1
sed -i 's#/etc/mail#/etc/smtpd#g' "$pkgdir"/etc/smtpd/smtpd.conf
install -Dm755 "$srcdir"/smtpd.initd "$pkgdir"/etc/init.d/smtpd
install -Dm644 "$srcdir"/aliases "$pkgdir"/etc/smtpd/aliases
}
md5sums="bf81fdc691808efa6acd7bdde5df757f opensmtpd-5.7.1p1.tar.gz
e90e077ee170c7806a4657f0fd5778b1 00-opensmtpd.patch
a2f311a82c9a85f5c52975c4dbbdbd53 smtpd.initd
561d2aead043a64a4ce5d66b4f78223e aliases"
sha256sums="67e9dd9682ca8c181e84e66c76245a4a8f6205834f915a2c021cdfeb22049e3a opensmtpd-5.7.1p1.tar.gz
1daa9b94e598db9b34e9a1fc717c834519824bdf7e87f1d6729c815ea5ca6acf 00-opensmtpd.patch
ab4b7f066a38dadd7a2dc6d7c3a06c3a8ac2367340d97e2a8b54f571ea0f8cf8 smtpd.initd
7bef80f8d86aa5463c864681482a4908d22ff8b6f3e47d2a410ef2d59b316b53 aliases"
sha512sums="df09c980b25a6e91a62f6de83b18e376f6c81a5bf0039fa91da90b2fe4d67bf4bc2dc6787b2d9aca0eb859cc149f980dd9c342516af5262231c97b133f804c1a opensmtpd-5.7.1p1.tar.gz
c3a60ec3785903b3118feebde6021e20f1eb26a8d6e8b8c72ae19c6f9d6a9a2ceaee32c45a0ac3ff29d24018d169273f931378c1269eec32d7e36e5d98dd475d 00-opensmtpd.patch
8152fecadeb1d818b7865eae040123f855e81fafbb4b40d12a64336e09dc486c10e6828809182c8172bfd9f54dc7d050a154b61d5e6049df6ffd8a7b6e5e1277 smtpd.initd
929ba0b8befca6cad558602f9793a9c653923924ee524902916b8ef4952d1ea8a391895e7450ed9768eb82a07bd307b49561f5d49ea4711bd87a1a73eb8d7dad aliases"
# Aliases in this file will NOT be expanded in the header from
# Mail, but WILL be visible over networks or from /usr/libexec/mail.local.
#
# >>>>>>>>>> The program "newaliases" must be run after
# >> NOTE >> this file is updated for any changes to
# >>>>>>>>>> show through to smtpd.
#
# Well-known aliases -- this should be filled in!
# root: your-every-day-user
# Basic system aliases -- these MUST be present
MAILER-DAEMON: postmaster
postmaster: root
operator: root
# General redirections for important pseudo accounts
daemon: root
uucp: root
# Redirections for pseudo accounts that should not receive mail
bin: /dev/null
adm: /dev/null
lp: /dev/null
sync: /dev/null
shutdown: /dev/null
halt: /dev/null
mail: /dev/null
news: /dev/null
man: /dev/null
cron: /dev/null
ftp: /dev/null
sshd: /dev/null
at: /dev/null
squid: /dev/null
gdm: /dev/null
xfs: /dev/null
games: /dev/null
named: /dev/null
mysql: /dev/null
postgres: /dev/null
apache: /dev/null
nut: /dev/null
cyrus: /dev/null
vpopmail: /dev/null
ntp: /dev/null
postfix: /dev/null
smmsp: /dev/null
distcc: /dev/null
guest: /dev/null
nobody: /dev/null
# RFC 2142: NETWORK OPERATIONS MAILBOX NAMES
abuse: root
# noc: root
security: root
# RFC 2142: SUPPORT MAILBOX NAMES FOR SPECIFIC INTERNET SERVICES
# hostmaster: root
# usenet: root
# news: usenet
# webmaster: root
# ftp: root
\ No newline at end of file
#!/bin/sh
/usr/sbin/newaliases
exit 0
#!/bin/sh
addgroup -S smtpd 2>/dev/null
addgroup -S smtpq 2>/dev/null
adduser -S -H -D -s /sbin/nologin -h /dev/null -g 'SMTP Daemon' -G smtpd smtpd 2>/dev/null
adduser -S -H -D -s /sbin/nologin -h /dev/null -g 'SMTPD Queue' -G smtpq smtpq 2>/dev/null
mkdir -p /var/spool/mail
exit 0
#!/sbin/openrc-run
name="$SVCNAME"
command="/usr/sbin/$SVCNAME"
command_args="$SMTPD_OPTS"
depend() {
need net localmount
after bootmisc firewall
use logger dns
provide mta
}
start() {
ebegin "Starting smtpd ${CONF_MESSAGE}"
/usr/sbin/smtpd
eend $?
}
stop() {
ebegin "Stopping smtpd ${CONF_MESSAGE}"
/usr/sbin/smtpctl stop &> /dev/null
eend $?
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment