---- smtptools/usmtpd.c
-+++ smtptools/usmtpd.c
+--- a/usmtpd.c
++++ b/usmtpd.c
@@ -60,8 +60,8 @@
/* run */ static const char *reminfo;
/* run */ static const char *relayclient;
if (rblcheck) do_rbl_check(&o);
---- smtptools/relaydb.c
-+++ smtptools/relaydb.c
+--- a/relaydb.c
++++ b/relaydb.c
@@ -1,4 +1,5 @@
#include "config.h"
+#include <string.h>
#include <unistd.h>
#include <netinet/in.h>
#include <arpa/inet.h>
---- smtptools/uostr.h
-+++ smtptools/uostr.h
+--- a/uostr.h
++++ b/uostr.h
@@ -1,6 +1,7 @@
#ifndef UOSTR_H
#define UOSTR_H
--- /dev/null
+--- a/uostr.h
++++ b/uostr.h
+@@ -14,7 +14,7 @@
+ uostr_t *uostr_alloc P__((void)); /* mallocs a uostr_t and inits with 0 */
+ void uostr_free P__((uostr_t *)); /* free(uostr_t), after free(uostr_t->data) */
+ void uostr_freedata P__((uostr_t *)); /* free(uostr_t->data) */
+-void (*uostr_xallocfn) P__((const char *)); /* called by x-functions in case of oom */
++extern void (*uostr_xallocfn) P__((const char *)); /* called by x-functions in case of oom */
+ void uostr_xallocerr P__((const char *fn)) UO_ATTRIB_NORET; /* internal function, leave alone */
+
+ /* be careful - if u->data is NULL then u->len and u->size need not to contain any information */
--- /dev/null
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit autotools
+
+DESCRIPTION="A collection of tools to send or receive mails with SMTP"
+HOMEPAGE="https://www.ohse.de/uwe/software/smtptools.html"
+SRC_URI="ftp://ftp.ohse.de/uwe/releases/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~x86"
+
+RDEPEND="!net-mail/qtools"
+PATCHES=(
+ "${FILESDIR}"/${P}-cleanups.patch
+ "${FILESDIR}"/${P}-fno-common.patch
+)
+
+src_prepare() {
+ eapply "${FILESDIR}"/${P}-autotools.patch
+ mv configure.{in,ac} || die
+ rm acconfig.h || die
+
+ default
+ eautoreconf
+}