summaryrefslogtreecommitdiff
path: root/mail-mta/opensmtpd
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /mail-mta/opensmtpd
reinit the tree, so we can have metadata
Diffstat (limited to 'mail-mta/opensmtpd')
-rw-r--r--mail-mta/opensmtpd/Manifest14
-rw-r--r--mail-mta/opensmtpd/files/opensmtpd-6.0.2_p1-autoconf.patch46
-rw-r--r--mail-mta/opensmtpd/files/opensmtpd-6.0.2_p1-libressl.patch101
-rw-r--r--mail-mta/opensmtpd/files/opensmtpd-6.0.2_p1-musl.patch51
-rw-r--r--mail-mta/opensmtpd/files/smtpd.initd11
-rw-r--r--mail-mta/opensmtpd/files/smtpd.pam4
-rw-r--r--mail-mta/opensmtpd/files/smtpd.service10
-rw-r--r--mail-mta/opensmtpd/files/smtpd.socket8
-rw-r--r--mail-mta/opensmtpd/metadata.xml14
-rw-r--r--mail-mta/opensmtpd/opensmtpd-6.0.2_p1-r1.ebuild94
-rw-r--r--mail-mta/opensmtpd/opensmtpd-6.0.2_p1-r2.ebuild98
-rw-r--r--mail-mta/opensmtpd/opensmtpd-6.0.2_p1.ebuild93
12 files changed, 544 insertions, 0 deletions
diff --git a/mail-mta/opensmtpd/Manifest b/mail-mta/opensmtpd/Manifest
new file mode 100644
index 000000000000..6cf7dd9c5ce3
--- /dev/null
+++ b/mail-mta/opensmtpd/Manifest
@@ -0,0 +1,14 @@
+AUX opensmtpd-6.0.2_p1-autoconf.patch 1465 SHA256 32b7554e4a225d61e835e480126a5f19709df87bc28e387c201dd88dfae19874 SHA512 7d8d30c089d72a2581fb65044a1b81140067ee67311cc23e08dd4cf4a9bfe437689c41bac08ab46ae6ca78637ddac29804cdc42c8b94f549d666138d04ae38fd WHIRLPOOL 820b430ceab7c7bac0502c0039946a47e51adad664837b4e16b6cf8e01a338af63355d2841f73fe266fd38c6119fc2dc88ad63a7cf4f5f48a437e67d79188739
+AUX opensmtpd-6.0.2_p1-libressl.patch 3283 SHA256 c7400d7a9d590d8e3814db74a05c3ef3cada1be444ce44a50971202247bac026 SHA512 67b5bb221f10e014749592d24f7681bea6872785fa4a70e4e4b978f94859b527c4999aabb489586f7c19fac182acca450bdfa01af3ebc52c009f723830212058 WHIRLPOOL 88b436fe97b83f2a5cc43647303135a9c2e51babf6874617162c0f4b28a73aa5a648c8f269308d3fdc72fc110ac6444fa0d0768f97aeb1d1533e2007951fd2dd
+AUX opensmtpd-6.0.2_p1-musl.patch 1373 SHA256 fd7d7c89c97f8dc6104eb5ecf0dfe2f2a0e08fd57d60203390a9f9f9ab780099 SHA512 217e7212345f4202bf7e136b2d5b347a9967ea10d15ef50a216bfcd8e4a522076e4ee2044d18a606baf670c0fe6a339951b6381cdb9047730e06987ab7796790 WHIRLPOOL 0b9204ddf862133c58206390d311ef99025d2c337d6c6f5a90d705d49e6efbbe1740e7b44bb9b5cc2ab5dce4bd3aeb88366ccee14f54bd782783d2b03ed6bfba
+AUX smtpd.initd 231 SHA256 b1fb458314e08e16320aba09aa6a41c2c838050bfeefb63a8d428c015352e969 SHA512 e4c8386bd7e8d8171172aa181305a55ca67cba6d4c82d77d8846e1bd3301dd9d118bb39dad6c144677f050194de813e4d83e06ea6dd591d4f07da8c4a1edde37 WHIRLPOOL 30d6d206940c521b07d46550c59fcc90396332cfcfd46dfc2554c782acefb64f17f2c465c4244a6b583be6f4210b0d4c236a995bf15b333e9908e21ee83f5b82
+AUX smtpd.pam 147 SHA256 d8edae7ceb5f5574426127aaa16fa00985f070065407b9de03e1963e9f7aaa58 SHA512 d0574cc732138fefffe3ca78da2d689f0849de70dfd65204c99a98a58b2165eb46b23a1c32b356ea2eaf8abd56a4929c7419b29cec1d6b284e344680bab24086 WHIRLPOOL cb84894bb7c0f8348ad895568dd65864b15190f8f915f4501c0dd8c595fc32cd3430e5616e93286880f61d35b2c3120c731d1d091e69d77e92aeaed8817c169d
+AUX smtpd.service 138 SHA256 928e59e45324677ca44420dd27ce334ba607d78fce1ddd9617b1eeafd9e105af SHA512 b70b173ac275b871d78bac0e55b2e0c8d8a6538c7f2c4dc86fe67fb37a1ee942e0442353b338b286759618299f51b144396251db13f82c9afa035dcaae11a258 WHIRLPOOL ae4d4a67bf038e8af1b4f44f81add190599f775356fc0de1bbfb61a63a41be28b68d8922463d47b61b0a3b4cab2883b867f93137b23ea9fa7e5efbce78d432ad
+AUX smtpd.socket 114 SHA256 0d4e598dcee849b9baf9a35f42c91e49545ffd611cfa425958d159ca3b482785 SHA512 fbbccb4aab80a4a4612609e590965940642321119a65359cf2490530f81d55706a0105309d321a624d40348f12776724d2cf6b8bf29ea24391e60ef8b8bc8ba2 WHIRLPOOL c42d22ef8b6793bdef82e9ac39977e6269676c420c3d2b014426b469bf25f81070023ad62f2d1efaa9e6fa91035e7023cabfca585e10e3ef953671620aa87231
+DIST opensmtpd-6.0.2p1.tar.gz 695513 SHA256 2af9b6d08784c7e546bf124bb61e311a6aa0c9835507710a76f5c242383190ac SHA512 1e4275795dd2c43174ffa268398a0d9864ce4cb7d370330f7b8c55a9b40e757616bbd280919a409ebde403769e3dea62047857dc2ff98d7ecce660b459c7ff1c WHIRLPOOL 105f12d9875e2d4822e71d9c8082b3c7b0e530a05ad762a2175c37afa917268b050dc48ed6bcaf3d708252dd65d432dbe7372669329fe2b5204783499cd2875b
+EBUILD opensmtpd-6.0.2_p1-r1.ebuild 2368 SHA256 332d9b759734eacbc2fbcc90d07448319b70951eb162e7d97cb4252c4586c622 SHA512 101e9ed755711fd5e62621b7db93671d3e0e58ab517eff198fc796dd10f6a07ccdb9e0dbb7633585cb826807718f73f32eb30cf054627c7c39c0a28644c883b0 WHIRLPOOL 0a042935432c596f7024b78fce5ff638ec565342000305676307f0fd59a5c7775a98c43f0781719a6f2e1a2c3bd8e336e8c4927eb38c044586e1815e9baf008d
+EBUILD opensmtpd-6.0.2_p1-r2.ebuild 2539 SHA256 dfce65fe1220a1566ad311737a4be1fb044627d7692def9286d4412ce2f30604 SHA512 f33d00267b27fb722a67f2c18183599eb7e104e72f61dcb40c37ffdf851390316aabbe5cb585ffcb25f769535a4836d1ad7c7a6cc3afda30b6e5b2e446e5dfaf WHIRLPOOL 7797ab58e2dc23a694677d204e1cd10ef4cd30c5fc539620281f5ee307210daab4f34440849d1dcdf82f8cabb931ca35539a2f87057d1cd5badf6dba4a65e30e
+EBUILD opensmtpd-6.0.2_p1.ebuild 2303 SHA256 226ad9b1cd79335724c82fa2b35269bc32ef2ffd8d455f3dc1f1ddc9ddcc173c SHA512 d65f52fc5013bce0a3245f3904261c5e6699c24888140875e177a2c6155172eb78c24abee7ce52fbaca7e238429b115d7871fb40efe292838445d8e213bd0938 WHIRLPOOL 3deaee03932b6fcbc656e922cfca07318135fac32854607e375547084e188a58c150a87ca6daef709af237879849f13510878b4e4ed53eb04c0eb98532635537
+MISC ChangeLog 8369 SHA256 43529e17a993918dfeb0e2b22d8994590c4a20ffec4ee6346d1b24963fdc9be5 SHA512 fa5bf84dbb2ffead55bb283143fb0ffbd3f4f1a7471fb3e474721386c9e2c93caf6be730c8fced254752eb18b7ac3393a6e0cb0075c148fce9e968b941c1ecc7 WHIRLPOOL 5170a1b79ae29de3832d9d45f973d1753c5929d4f7f3e4a5755783119f4efa15a85ee37af8c0013f4e68bd835565a2d6b033b0e9f62e5e6018b3e8296c25a439
+MISC ChangeLog-2015 15548 SHA256 19b97544dc0f0e0852efd7650b90db9a0bc749378c070d742ff54d638a3c7225 SHA512 eb97bae2f989b5a38b24422c4bdcdfa1367e2fe49ba04c7f9a1201380708c17a81aed19be24d173569217c61d8c53af49b294e836c15be8fd1d8183366a1e602 WHIRLPOOL b4355111c00306e8f0a447dcc57a2eaa1cba049301f4be03fd184aef022a0ca509b5ede01abc71023f8207681b59aae1f7b6bc1f5e1efb7afff110a141f7accc
+MISC metadata.xml 595 SHA256 a59caf9a5baa8c23b0a120f0c89c7c4eaae44f8bc9c2f5e25b569c3ce6f28872 SHA512 aa7344806cd011cec6c7afa277345eb2988f11970ea3038d969efa50d5b1f485f199f15a1b632197700791c2242ed8f712ff3cc382b1491e44c14ee94075a1d5 WHIRLPOOL e5705abd19f84b00c63c9011165321b99f62cfe3f09d8b0fb9fa96bf470811374cf8f086d686e8377bf4eba841eceec9f81b02cb88e82ae0b873a313b6ba13f7
diff --git a/mail-mta/opensmtpd/files/opensmtpd-6.0.2_p1-autoconf.patch b/mail-mta/opensmtpd/files/opensmtpd-6.0.2_p1-autoconf.patch
new file mode 100644
index 000000000000..d490a9029191
--- /dev/null
+++ b/mail-mta/opensmtpd/files/opensmtpd-6.0.2_p1-autoconf.patch
@@ -0,0 +1,46 @@
+From 9370e962bfa1032ab16c48c79977536eae665d75 Mon Sep 17 00:00:00 2001
+From: Freddy DISSAUX <dsx@pouet.bsdsx.fr>
+Date: Sat, 17 Sep 2016 08:50:14 +0200
+Subject: [PATCH] Fix expression, as explain in
+
+https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Generic-Declarations.html#Generic-Declarations
+
+"Unlike the other `AC_CHECK_*S' macros, when a symbol is not
+declared, HAVE_DECL_symbol is defined to `0' instead of
+leaving HAVE_DECL_symbol undeclared."
+---
+ openbsd-compat/defines.h | 2 +-
+ openbsd-compat/openbsd-compat.h | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/openbsd-compat/defines.h b/openbsd-compat/defines.h
+index 0a94d76..bda39e9 100644
+--- a/openbsd-compat/defines.h
++++ b/openbsd-compat/defines.h
+@@ -85,7 +85,7 @@
+ # define STDERR_FILENO 2
+ #endif
+
+-#if defined(HAVE_DECL_O_NONBLOCK) && HAVE_DECL_O_NONBLOCK == 0
++#if !HAVE_DECL_O_NONBLOCK
+ # define O_NONBLOCK 00004 /* Non Blocking Open */
+ #endif
+
+diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h
+index fd931d0..1ef2925 100644
+--- a/openbsd-compat/openbsd-compat.h
++++ b/openbsd-compat/openbsd-compat.h
+@@ -212,11 +212,11 @@ void errc(int, int, const char *, ...);
+ #define pledge(promises, paths) 0
+ #endif
+
+-#ifndef HAVE_DECL_AF_LOCAL
++#if !HAVE_DECL_AF_LOCAL
+ #define AF_LOCAL AF_UNIX
+ #endif
+
+-#ifndef HAVE_DECL_WAIT_MYPGRP
++#if !HAVE_DECL_WAIT_MYPGRP
+ #define WAIT_MYPGRP 0
+ #endif
+
diff --git a/mail-mta/opensmtpd/files/opensmtpd-6.0.2_p1-libressl.patch b/mail-mta/opensmtpd/files/opensmtpd-6.0.2_p1-libressl.patch
new file mode 100644
index 000000000000..e1656b94040c
--- /dev/null
+++ b/mail-mta/opensmtpd/files/opensmtpd-6.0.2_p1-libressl.patch
@@ -0,0 +1,101 @@
+From f948b923873a93472dea9b786cf60a3472b0ddc8 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Wed, 11 Jan 2017 17:35:29 -0600
+Subject: [PATCH] fix compatibility with libressl
+
+These functions are exported by libcrypto from libressl, due to its
+similar OpenBSD compatibility layer, but they are not present in any
+header files. Thus, while we can use the existing compiled function,
+and do not need to provide our own, we do need to provide the prototype
+for it.
+
+This avoids implicit function declarations and the resulting crashes due
+to pointer truncation.
+
+The patch is based on an equivalent patch for OpenSSH from
+https://bugzilla.mindrot.org/show_bug.cgi?id=2465
+Also see
+https://github.com/libressl-portable/portable/issues/109
+
+Fixes #691
+---
+ openbsd-compat/defines.h | 9 ---------
+ openbsd-compat/openbsd-compat.h | 25 +++++++++++++++----------
+ 2 files changed, 15 insertions(+), 19 deletions(-)
+
+diff --git a/openbsd-compat/defines.h b/openbsd-compat/defines.h
+index 2cbfbca..3ffcc81 100644
+--- a/openbsd-compat/defines.h
++++ b/openbsd-compat/defines.h
+@@ -422,15 +422,6 @@ typedef uint16_t in_port_t;
+ #define INET6_ADDRSTRLEN 46
+ #endif
+
+-/*
+- * Platforms that have arc4random_uniform() and not arc4random_stir()
+- * shouldn't need the latter.
+- */
+-#if defined(HAVE_ARC4RANDOM) && defined(HAVE_ARC4RANDOM_UNIFORM) && \
+- !defined(HAVE_ARC4RANDOM_STIR)
+-# define arc4random_stir()
+-#endif
+-
+ #ifndef HAVE_VA_COPY
+ # ifdef HAVE___VA_COPY
+ # define va_copy(dest, src) __va_copy(dest, src)
+diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h
+index a51385b..51f33bb 100644
+--- a/openbsd-compat/openbsd-compat.h
++++ b/openbsd-compat/openbsd-compat.h
+@@ -119,20 +119,25 @@ int BSDoptind; /* index into parent argv vector */
+ int getpeereid(int , uid_t *, gid_t *);
+ #endif
+
+-#ifdef HAVE_ARC4RANDOM
+-# ifndef HAVE_ARC4RANDOM_STIR
+-# define arc4random_stir()
+-# endif
+-#else
++#if !defined(HAVE_ARC4RANDOM) || defined(LIBRESSL_VERSION_NUMBER)
+ unsigned int arc4random(void);
++#endif
++
++#if defined(HAVE_ARC4RANDOM_STIR)
+ void arc4random_stir(void);
+-#endif /* !HAVE_ARC4RANDOM */
++#elif defined(HAVE_ARC4RANDOM) || defined(LIBRESSL_VERSION_NUMBER)
++/* Recent system/libressl implementation; no need for explicit stir */
++# define arc4random_stir()
++#else
++/* openbsd-compat/arc4random.c provides arc4random_stir() */
++void arc4random_stir(void);
++#endif
+
+-#ifndef HAVE_ARC4RANDOM_BUF
++#if !defined(HAVE_ARC4RANDOM_BUF) || defined(LIBRESSL_VERSION_NUMBER)
+ void arc4random_buf(void *, size_t);
+ #endif
+
+-#ifndef HAVE_ARC4RANDOM_UNIFORM
++#if !defined(HAVE_ARC4RANDOM_UNIFORM) || defined(LIBRESSL_VERSION_NUMBER)
+ uint32_t arc4random_uniform(uint32_t);
+ #endif
+
+@@ -174,7 +179,7 @@ int vasprintf(char **, const char *, va_list);
+ int vsnprintf(char *, size_t, const char *, va_list);
+ #endif
+
+-#ifndef HAVE_EXPLICIT_BZERO
++#if !defined(HAVE_EXPLICIT_BZERO) || defined(LIBRESSL_VERSION_NUMBER)
+ void explicit_bzero(void *p, size_t n);
+ #endif
+
+@@ -200,7 +205,7 @@ int pidfile(const char *basename);
+ struct passwd *pw_dup(const struct passwd *);
+ #endif
+
+-#ifndef HAVE_REALLOCARRAY
++#if !defined(HAVE_REALLOCARRAY) || defined(LIBRESSL_VERSION_NUMBER)
+ void *reallocarray(void *, size_t, size_t);
+ #endif
+
diff --git a/mail-mta/opensmtpd/files/opensmtpd-6.0.2_p1-musl.patch b/mail-mta/opensmtpd/files/opensmtpd-6.0.2_p1-musl.patch
new file mode 100644
index 000000000000..065fbcdbe1a6
--- /dev/null
+++ b/mail-mta/opensmtpd/files/opensmtpd-6.0.2_p1-musl.patch
@@ -0,0 +1,51 @@
+From 2ab442623e689532910b34ff0dbbc2167da02330 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Wed, 11 Jan 2017 17:39:07 -0600
+Subject: [PATCH] fix musl compatibility (missing function prototypes)
+
+inet_net_pton is already compiled, but no prototype is provided.
+res_hnok is provided by the compatibility layer in libasr.
+
+These fixes avoid warnings about implicit function declaration.
+
+Fixes #758
+---
+ configure.ac | 1 +
+ openbsd-compat/openbsd-compat.h | 8 ++++++++
+ 2 files changed, 9 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 42e092f..e27c514 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -594,6 +594,7 @@ AC_CHECK_FUNCS([ \
+ pledge \
+ pw_dup \
+ reallocarray \
++ res_hnok \
+ setenv \
+ setlinebuf \
+ setproctitle \
+diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h
+index a51385b..5d2e2c2 100644
+--- a/openbsd-compat/openbsd-compat.h
++++ b/openbsd-compat/openbsd-compat.h
+@@ -208,10 +208,18 @@ void *reallocarray(void *, size_t, size_t);
+ void errc(int, int, const char *, ...);
+ #endif
+
++#ifndef HAVE_INET_NET_PTON
++int inet_net_pton(int, const char *, void *, size_t);
++#endif
++
+ #ifndef HAVE_PLEDGE
+ #define pledge(promises, paths) 0
+ #endif
+
++#ifndef HAVE_RES_HNOK
++int res_hnok(const char *);
++#endif
++
+ #if !HAVE_DECL_AF_LOCAL
+ #define AF_LOCAL AF_UNIX
+ #endif
diff --git a/mail-mta/opensmtpd/files/smtpd.initd b/mail-mta/opensmtpd/files/smtpd.initd
new file mode 100644
index 000000000000..cf205a8ea737
--- /dev/null
+++ b/mail-mta/opensmtpd/files/smtpd.initd
@@ -0,0 +1,11 @@
+#!/sbin/openrc-run
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+command="smtpd"
+pidfile="/run/smtpd.pid"
+description="SMTP daemon from OpenBSD"
+
+depend() {
+ need net
+}
diff --git a/mail-mta/opensmtpd/files/smtpd.pam b/mail-mta/opensmtpd/files/smtpd.pam
new file mode 100644
index 000000000000..a85aeae1e8b3
--- /dev/null
+++ b/mail-mta/opensmtpd/files/smtpd.pam
@@ -0,0 +1,4 @@
+auth required pam_nologin.so
+auth include system-auth
+account include system-auth
+session include system-auth
diff --git a/mail-mta/opensmtpd/files/smtpd.service b/mail-mta/opensmtpd/files/smtpd.service
new file mode 100644
index 000000000000..fd2a65010604
--- /dev/null
+++ b/mail-mta/opensmtpd/files/smtpd.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=OpenSMTPD
+After=network.target
+
+[Service]
+Type=forking
+ExecStart=/usr/sbin/smtpd
+
+[Install]
+WantedBy=multi-user.target
diff --git a/mail-mta/opensmtpd/files/smtpd.socket b/mail-mta/opensmtpd/files/smtpd.socket
new file mode 100644
index 000000000000..fb42f8557323
--- /dev/null
+++ b/mail-mta/opensmtpd/files/smtpd.socket
@@ -0,0 +1,8 @@
+[Unit]
+Description=OpenSMTPD Socket
+
+[Socket]
+ListenStream=/var/run/smtpd.sock
+
+[Install]
+WantedBy=sockets.target
diff --git a/mail-mta/opensmtpd/metadata.xml b/mail-mta/opensmtpd/metadata.xml
new file mode 100644
index 000000000000..4a9db506441f
--- /dev/null
+++ b/mail-mta/opensmtpd/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<longdescription lang="en">
+OpenSMTPD is an implementation of the server-side SMTP protocol as defined by RFC 5321, with some additional standard extensions. It allows ordinary machines to exchange e-mails with other systems speaking the SMTP protocol.
+</longdescription>
+<maintainer type="person">
+<email>zx2c4@gentoo.org</email>
+<name>Jason A. Donenfeld</name>
+</maintainer>
+<use>
+<flag name="mta">Enable this to install as system-wide MTA</flag>
+</use>
+</pkgmetadata>
diff --git a/mail-mta/opensmtpd/opensmtpd-6.0.2_p1-r1.ebuild b/mail-mta/opensmtpd/opensmtpd-6.0.2_p1-r1.ebuild
new file mode 100644
index 000000000000..a94d5313614c
--- /dev/null
+++ b/mail-mta/opensmtpd/opensmtpd-6.0.2_p1-r1.ebuild
@@ -0,0 +1,94 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit multilib user flag-o-matic eutils pam toolchain-funcs autotools systemd versionator
+
+DESCRIPTION="Lightweight but featured SMTP daemon from OpenBSD"
+HOMEPAGE="http://www.opensmtpd.org/"
+MY_P="${P}"
+if [ $(get_last_version_component_index) -eq 4 ]; then
+ MY_P="${PN}-$(get_version_component_range 4-)"
+fi
+SRC_URI="https://www.opensmtpd.org/archives/${MY_P/_}.tar.gz"
+
+LICENSE="ISC BSD BSD-1 BSD-2 BSD-4"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE="libressl pam +mta"
+
+DEPEND="!libressl? ( dev-libs/openssl:0 )
+ libressl? ( dev-libs/libressl )
+ sys-libs/zlib
+ pam? ( virtual/pam )
+ sys-libs/db:=
+ dev-libs/libevent
+ app-misc/ca-certificates
+ net-mail/mailbase
+ net-libs/libasr
+ !mail-mta/courier
+ !mail-mta/esmtp
+ !mail-mta/exim
+ !mail-mta/mini-qmail
+ !mail-mta/msmtp[mta]
+ !mail-mta/netqmail
+ !mail-mta/nullmailer
+ !mail-mta/postfix
+ !mail-mta/qmail-ldap
+ !mail-mta/sendmail
+ !mail-mta/ssmtp[mta]
+"
+RDEPEND="${DEPEND}"
+
+S=${WORKDIR}/${MY_P/_}
+
+src_prepare() {
+ # Use /run instead of /var/run
+ sed -i -e '/pidfile_path/s:_PATH_VARRUN:"/run/":' openbsd-compat/pidfile.c || die
+ epatch_user
+ eautoreconf
+}
+
+src_configure() {
+ tc-export AR
+ AR="$(which "$AR")" econf \
+ --with-table-db \
+ --with-user-smtpd=smtpd \
+ --with-user-queue=smtpq \
+ --with-group-queue=smtpq \
+ --with-path-socket=/run \
+ --with-path-CAfile=/etc/ssl/certs/ca-certificates.crt \
+ --sysconfdir=/etc/opensmtpd \
+ $(use_with pam auth-pam)
+}
+
+src_install() {
+ default
+ newinitd "${FILESDIR}"/smtpd.initd smtpd
+ systemd_dounit "${FILESDIR}"/smtpd.{service,socket}
+ use pam && newpamd "${FILESDIR}"/smtpd.pam smtpd
+ dosym /usr/sbin/smtpctl /usr/sbin/makemap
+ dosym /usr/sbin/smtpctl /usr/sbin/newaliases
+ if use mta ; then
+ dodir /usr/sbin
+ dosym /usr/sbin/smtpctl /usr/sbin/sendmail
+ dosym /usr/sbin/smtpctl /usr/bin/sendmail
+ dosym /usr/sbin/smtpctl /usr/$(get_libdir)/sendmail
+ fi
+}
+
+pkg_preinst() {
+ enewgroup smtpd 25
+ enewuser smtpd 25 -1 /var/empty smtpd
+ enewgroup smtpq 252
+ enewuser smtpq 252 -1 /var/empty smtpq
+}
+
+pkg_postinst() {
+ einfo
+ einfo "Plugins for SQLite, MySQL, PostgreSQL, LDAP, socketmaps,"
+ einfo "Redis, and many other useful addons and filters are"
+ einfo "available in the mail-filter/opensmtpd-extras package."
+ einfo
+}
diff --git a/mail-mta/opensmtpd/opensmtpd-6.0.2_p1-r2.ebuild b/mail-mta/opensmtpd/opensmtpd-6.0.2_p1-r2.ebuild
new file mode 100644
index 000000000000..8cd791b1153f
--- /dev/null
+++ b/mail-mta/opensmtpd/opensmtpd-6.0.2_p1-r2.ebuild
@@ -0,0 +1,98 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit multilib user flag-o-matic eutils pam toolchain-funcs autotools systemd versionator
+
+DESCRIPTION="Lightweight but featured SMTP daemon from OpenBSD"
+HOMEPAGE="http://www.opensmtpd.org/"
+MY_P="${P}"
+if [ $(get_last_version_component_index) -eq 4 ]; then
+ MY_P="${PN}-$(get_version_component_range 4-)"
+fi
+SRC_URI="https://www.opensmtpd.org/archives/${MY_P/_}.tar.gz"
+
+LICENSE="ISC BSD BSD-1 BSD-2 BSD-4"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+IUSE="libressl pam +mta"
+
+DEPEND="!libressl? ( dev-libs/openssl:0 )
+ libressl? ( dev-libs/libressl )
+ elibc_musl? ( sys-libs/fts-standalone )
+ sys-libs/zlib
+ pam? ( virtual/pam )
+ sys-libs/db:=
+ dev-libs/libevent
+ app-misc/ca-certificates
+ net-mail/mailbase
+ net-libs/libasr
+ !mail-mta/courier
+ !mail-mta/esmtp
+ !mail-mta/exim
+ !mail-mta/mini-qmail
+ !mail-mta/msmtp[mta]
+ !mail-mta/netqmail
+ !mail-mta/nullmailer
+ !mail-mta/postfix
+ !mail-mta/qmail-ldap
+ !mail-mta/sendmail
+ !mail-mta/ssmtp[mta]
+"
+RDEPEND="${DEPEND}"
+
+S=${WORKDIR}/${MY_P/_}
+
+src_prepare() {
+ # Use /run instead of /var/run
+ sed -i -e '/pidfile_path/s:_PATH_VARRUN:"/run/":' openbsd-compat/pidfile.c || die
+ epatch "${FILESDIR}"/${P}-autoconf.patch
+ epatch "${FILESDIR}"/${P}-libressl.patch
+ epatch "${FILESDIR}"/${P}-musl.patch
+ epatch_user
+ eautoreconf
+}
+
+src_configure() {
+ tc-export AR
+ AR="$(which "$AR")" econf \
+ --with-table-db \
+ --with-user-smtpd=smtpd \
+ --with-user-queue=smtpq \
+ --with-group-queue=smtpq \
+ --with-path-socket=/run \
+ --with-path-CAfile=/etc/ssl/certs/ca-certificates.crt \
+ --sysconfdir=/etc/opensmtpd \
+ $(use_with pam auth-pam)
+}
+
+src_install() {
+ default
+ newinitd "${FILESDIR}"/smtpd.initd smtpd
+ systemd_dounit "${FILESDIR}"/smtpd.{service,socket}
+ use pam && newpamd "${FILESDIR}"/smtpd.pam smtpd
+ dosym /usr/sbin/smtpctl /usr/sbin/makemap
+ dosym /usr/sbin/smtpctl /usr/sbin/newaliases
+ if use mta ; then
+ dodir /usr/sbin
+ dosym /usr/sbin/smtpctl /usr/sbin/sendmail
+ dosym /usr/sbin/smtpctl /usr/bin/sendmail
+ dosym /usr/sbin/smtpctl /usr/$(get_libdir)/sendmail
+ fi
+}
+
+pkg_preinst() {
+ enewgroup smtpd 25
+ enewuser smtpd 25 -1 /var/empty smtpd
+ enewgroup smtpq 252
+ enewuser smtpq 252 -1 /var/empty smtpq
+}
+
+pkg_postinst() {
+ einfo
+ einfo "Plugins for SQLite, MySQL, PostgreSQL, LDAP, socketmaps,"
+ einfo "Redis, and many other useful addons and filters are"
+ einfo "available in the mail-filter/opensmtpd-extras package."
+ einfo
+}
diff --git a/mail-mta/opensmtpd/opensmtpd-6.0.2_p1.ebuild b/mail-mta/opensmtpd/opensmtpd-6.0.2_p1.ebuild
new file mode 100644
index 000000000000..562115d95258
--- /dev/null
+++ b/mail-mta/opensmtpd/opensmtpd-6.0.2_p1.ebuild
@@ -0,0 +1,93 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit multilib user flag-o-matic eutils pam toolchain-funcs autotools systemd versionator
+
+DESCRIPTION="Lightweight but featured SMTP daemon from OpenBSD"
+HOMEPAGE="http://www.opensmtpd.org/"
+MY_P="${P}"
+if [ $(get_last_version_component_index) -eq 4 ]; then
+ MY_P="${PN}-$(get_version_component_range 4-)"
+fi
+SRC_URI="https://www.opensmtpd.org/archives/${MY_P/_}.tar.gz"
+
+LICENSE="ISC BSD BSD-1 BSD-2 BSD-4"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="pam +mta"
+
+DEPEND="dev-libs/openssl:0
+ sys-libs/zlib
+ pam? ( virtual/pam )
+ sys-libs/db:=
+ dev-libs/libevent
+ app-misc/ca-certificates
+ net-mail/mailbase
+ net-libs/libasr
+ !mail-mta/courier
+ !mail-mta/esmtp
+ !mail-mta/exim
+ !mail-mta/mini-qmail
+ !mail-mta/msmtp[mta]
+ !mail-mta/netqmail
+ !mail-mta/nullmailer
+ !mail-mta/postfix
+ !mail-mta/qmail-ldap
+ !mail-mta/sendmail
+ !mail-mta/ssmtp[mta]
+"
+RDEPEND="${DEPEND}"
+
+S=${WORKDIR}/${MY_P/_}
+
+src_prepare() {
+ # Use /run instead of /var/run
+ sed -i -e '/pidfile_path/s:_PATH_VARRUN:"/run/":' openbsd-compat/pidfile.c || die
+ epatch_user
+ eautoreconf
+}
+
+src_configure() {
+ tc-export AR
+ AR="$(which "$AR")" econf \
+ --with-table-db \
+ --with-user-smtpd=smtpd \
+ --with-user-queue=smtpq \
+ --with-group-queue=smtpq \
+ --with-path-socket=/run \
+ --with-path-CAfile=/etc/ssl/certs/ca-certificates.crt \
+ --sysconfdir=/etc/opensmtpd \
+ $(use_with pam auth-pam)
+}
+
+src_install() {
+ default
+ newinitd "${FILESDIR}"/smtpd.initd smtpd
+ systemd_dounit "${FILESDIR}"/smtpd.{service,socket}
+ use pam && newpamd "${FILESDIR}"/smtpd.pam smtpd
+ dosym /usr/sbin/smtpctl /usr/sbin/makemap
+ dosym /usr/sbin/smtpctl /usr/sbin/newaliases
+ if use mta ; then
+ dodir /usr/sbin
+ dosym /usr/sbin/smtpctl /usr/sbin/sendmail
+ dosym /usr/sbin/smtpctl /usr/bin/sendmail
+ dosym /usr/sbin/smtpctl /usr/$(get_libdir)/sendmail
+ fi
+}
+
+pkg_preinst() {
+ enewgroup smtpd 25
+ enewuser smtpd 25 -1 /var/empty smtpd
+ enewgroup smtpq 252
+ enewuser smtpq 252 -1 /var/empty smtpq
+}
+
+pkg_postinst() {
+ einfo
+ einfo "Plugins for SQLite, MySQL, PostgreSQL, LDAP, socketmaps,"
+ einfo "Redis, and many other useful addons and filters are"
+ einfo "available in the mail-filter/opensmtpd-extras package."
+ einfo
+}