public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: net-mail/vpopmail/files/, net-mail/vpopmail/
@ 2018-06-08  5:11 Robin H. Johnson
  0 siblings, 0 replies; 3+ messages in thread
From: Robin H. Johnson @ 2018-06-08  5:11 UTC (permalink / raw
  To: gentoo-commits

commit:     66059885d224eca79b8ede013342cef091704566
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Fri Jun  8 05:09:20 2018 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Fri Jun  8 05:11:42 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=66059885

net-mail/vpopmail: cleanup some outstanding bugs

- Compile fix: MySQL include dir (#526590)
- Remove ebeep (#646174)
- Repoman warnings for dosym
- EAPI=6 ebuild

Closes: https://bugs.gentoo.org/526590
Closes: https://bugs.gentoo.org/646174
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
Package-Manager: Portage-2.3.33, Repoman-2.3.9

 net-mail/vpopmail/files/vpopmail-double-free.patch |  4 +-
 net-mail/vpopmail/vpopmail-5.4.33-r1.ebuild        | 13 ++--
 net-mail/vpopmail/vpopmail-5.4.33-r2.ebuild        | 75 ++++++++++++++++++----
 net-mail/vpopmail/vpopmail-5.4.33.ebuild           | 11 ++--
 4 files changed, 80 insertions(+), 23 deletions(-)

diff --git a/net-mail/vpopmail/files/vpopmail-double-free.patch b/net-mail/vpopmail/files/vpopmail-double-free.patch
index d7d118578d7..16a40b82c4f 100644
--- a/net-mail/vpopmail/files/vpopmail-double-free.patch
+++ b/net-mail/vpopmail/files/vpopmail-double-free.patch
@@ -1,7 +1,7 @@
 diff --git a/trunk/vpalias.c b/trunk/vpalias.c
 index 9853f14..e9bd81f 100644
---- a/trunk/vpalias.c
-+++ b/trunk/vpalias.c
+--- vpalias.c
++++ vpalias.c
 @@ -369,7 +369,7 @@ char *valias_select_names( char *domain )
          }
        }

diff --git a/net-mail/vpopmail/vpopmail-5.4.33-r1.ebuild b/net-mail/vpopmail/vpopmail-5.4.33-r1.ebuild
index a41fd4be75c..78bc92f714e 100644
--- a/net-mail/vpopmail/vpopmail-5.4.33-r1.ebuild
+++ b/net-mail/vpopmail/vpopmail-5.4.33-r1.ebuild
@@ -6,7 +6,7 @@ EAPI=5
 inherit autotools eutils fixheadtails qmail user
 
 HOMEPAGE="http://www.inter7.com/index.php?page=vpopmail"
-DESCRIPTION="A collection of programs to manage virtual email domains and accounts on your Qmail mail servers"
+DESCRIPTION="Collection of programs to manage virtual email on Qmail servers"
 SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
 
 LICENSE="GPL-2"
@@ -18,7 +18,7 @@ REQUIRED_USE="mysql? ( !postgres )"
 DEPEND="virtual/qmail
 	maildrop? ( mail-filter/maildrop )
 	mysql? ( virtual/mysql )
-	postgres? ( dev-db/postgresql[server] )
+	postgres? ( dev-db/postgresql:=[server] )
 	spamassassin? ( mail-filter/spamassassin )"
 RDEPEND="${DEPEND}"
 
@@ -28,7 +28,6 @@ VPOP_DEFAULT_HOME="/var/vpopmail"
 vpopmail_set_homedir() {
 	VPOP_HOME=$(egethome vpopmail)
 	if [[ -z "${VPOP_HOME}" ]]; then
-		ebeep
 		eerror "vpopmail's home directory is null in passwd data!"
 		eerror "You probably want to check that out."
 		eerror "Continuing with default."
@@ -141,13 +140,17 @@ src_install() {
 	dodoc doc/AUTHORS ChangeLog doc/FAQ doc/INSTALL doc/README*
 	dohtml doc/doc_html/* doc/man_html/*
 	rm -rf "${D}/${VPOP_HOME}"/doc
-	dosym /usr/share/doc/${PF}/ "${VPOP_HOME}"/doc
+	dosym \
+		$(realpath --relative-to "${D}/${VPOP_HOME}"/ "${D}"/usr/share/doc/${PF}/) \
+		"${VPOP_HOME}"/doc
 
 	# create /etc/vpopmail.conf
 	if use mysql; then
 		dodir /etc
 		mv "${D}${VPOP_HOME}"/etc/vpopmail.mysql "${D}"/etc/vpopmail.conf
-		dosym /etc/vpopmail.conf "${VPOP_HOME}"/etc/vpopmail.mysql
+		dosym \
+			$(realpath --relative-to "${D}/${VPOP_HOME}"/etc/ "${D}"/etc/vpopmail.conf) \
+			"${VPOP_HOME}"/etc/vpopmail.mysql
 
 		sed -e '12d' -i "${D}"/etc/vpopmail.conf
 		echo '# Read-only DB' >> "${D}"/etc/vpopmail.conf

diff --git a/net-mail/vpopmail/vpopmail-5.4.33-r2.ebuild b/net-mail/vpopmail/vpopmail-5.4.33-r2.ebuild
index 498c53bc733..244a0119098 100644
--- a/net-mail/vpopmail/vpopmail-5.4.33-r2.ebuild
+++ b/net-mail/vpopmail/vpopmail-5.4.33-r2.ebuild
@@ -1,12 +1,12 @@
 # Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=5
+EAPI=6
 
 inherit autotools eutils fixheadtails qmail user
 
 HOMEPAGE="http://www.inter7.com/index.php?page=vpopmail"
-DESCRIPTION="A collection of programs to manage virtual email domains and accounts on your Qmail mail servers"
+DESCRIPTION="Collection of programs to manage virtual email on Qmail servers"
 SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
 
 LICENSE="GPL-2"
@@ -18,17 +18,68 @@ REQUIRED_USE="mysql? ( !postgres )"
 DEPEND="virtual/qmail
 	maildrop? ( mail-filter/maildrop )
 	mysql? ( || ( dev-db/mysql-connector-c dev-db/mariadb-connector-c[mysqlcompat] ) )
-	postgres? ( dev-db/postgresql[server] )
+	postgres? ( dev-db/postgresql:=[server] )
 	spamassassin? ( mail-filter/spamassassin )"
 RDEPEND="${DEPEND}"
 
+PATCHES=(
+	"-p0"
+	"--"
+	"${FILESDIR}"/${PN}-5.4.9-access.violation.patch
+	"${FILESDIR}"/${PN}-lazy.patch
+	"${FILESDIR}"/${PN}-vpgsql.patch
+	"${FILESDIR}"/${PN}-double-free.patch
+)
+DOCS=(
+	ChangeLog
+	doc/AUTHORS
+	doc/FAQ
+	doc/INSTALL
+	doc/README.activedirectory
+	doc/README.authvchkpw
+	doc/README.filelocking
+	doc/README.ipaliasdomains
+	doc/README.ldap
+	doc/README.maildrop
+	doc/README.mysql
+	doc/README.onchange
+	doc/README.oracle
+	doc/README.pgsql
+	doc/README.qmail-default
+	doc/README.quotas
+	doc/README.roamingusers
+	doc/README.spamassassin
+	doc/README.sybase
+	doc/README.vdelivermail
+	doc/README.vlimits
+	doc/README.vpopmaild
+	doc/README.vqmaillocal
+)
+HTML_DOCS=(
+	doc/doc_html/vpopmail5.abw
+	doc/doc_html/vpopmailapi.png
+	doc/doc_html/vpopmail.html
+	doc/man_html/clearopensmtp.html
+	doc/man_html/index.html
+	doc/man_html/vaddaliasdomain.html
+	doc/man_html/vadddomain.html
+	doc/man_html/vadduser.html
+	doc/man_html/vchkpw.html
+	doc/man_html/vconvert.html
+	doc/man_html/vdeldomain.html
+	doc/man_html/vdelivermail.html
+	doc/man_html/vdeluser.html
+	doc/man_html/vpasswd.html
+	doc/man_html/vpopbull.html
+	doc/man_html/vsetuserquota.html
+)
+
 # This makes sure the variable is set, and that it isn't null.
 VPOP_DEFAULT_HOME="/var/vpopmail"
 
 vpopmail_set_homedir() {
 	VPOP_HOME=$(egethome vpopmail)
 	if [[ -z "${VPOP_HOME}" ]]; then
-		ebeep
 		eerror "vpopmail's home directory is null in passwd data!"
 		eerror "You probably want to check that out."
 		eerror "Continuing with default."
@@ -45,10 +96,7 @@ pkg_setup() {
 }
 
 src_prepare() {
-	epatch "${FILESDIR}"/${PN}-5.4.9-access.violation.patch
-	epatch "${FILESDIR}"/${PN}-lazy.patch
-	epatch "${FILESDIR}"/${PN}-double-free.patch
-	epatch "${FILESDIR}"/${PN}-vpgsql.patch
+	default
 
 	echo 'install-recursive: install-exec-am' \
 		>>"${S}"/Makefile.am
@@ -140,16 +188,19 @@ src_install() {
 	dobin "${FILESDIR}"/vpopmail-Maildir-dotmaildir-fix.sh
 	into /usr
 
-	dodoc doc/AUTHORS ChangeLog doc/FAQ doc/INSTALL doc/README*
-	dohtml doc/doc_html/* doc/man_html/*
+	einstalldocs
 	rm -rf "${D}/${VPOP_HOME}"/doc
-	dosym /usr/share/doc/${PF}/ "${VPOP_HOME}"/doc
+	dosym \
+		$(realpath --relative-to "${D}/${VPOP_HOME}"/ "${D}"/usr/share/doc/${PF}/) \
+		"${VPOP_HOME}"/doc
 
 	# create /etc/vpopmail.conf
 	if use mysql; then
 		dodir /etc
 		mv "${D}${VPOP_HOME}"/etc/vpopmail.mysql "${D}"/etc/vpopmail.conf
-		dosym /etc/vpopmail.conf "${VPOP_HOME}"/etc/vpopmail.mysql
+		dosym \
+			$(realpath --relative-to "${D}/${VPOP_HOME}"/etc/ "${D}"/etc/vpopmail.conf) \
+			"${VPOP_HOME}"/etc/vpopmail.mysql
 
 		sed -e '12d' -i "${D}"/etc/vpopmail.conf
 		echo '# Read-only DB' >> "${D}"/etc/vpopmail.conf

diff --git a/net-mail/vpopmail/vpopmail-5.4.33.ebuild b/net-mail/vpopmail/vpopmail-5.4.33.ebuild
index e98c76b20ef..bfc60278c20 100644
--- a/net-mail/vpopmail/vpopmail-5.4.33.ebuild
+++ b/net-mail/vpopmail/vpopmail-5.4.33.ebuild
@@ -6,7 +6,7 @@ EAPI=4
 inherit autotools eutils fixheadtails qmail user
 
 HOMEPAGE="http://www.inter7.com/index.php?page=vpopmail"
-DESCRIPTION="A collection of programs to manage virtual email domains and accounts on your Qmail mail servers"
+DESCRIPTION="Collection of programs to manage virtual email on Qmail servers"
 SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
 
 LICENSE="GPL-2"
@@ -26,7 +26,6 @@ VPOP_DEFAULT_HOME="/var/vpopmail"
 vpopmail_set_homedir() {
 	VPOP_HOME=$(egethome vpopmail)
 	if [[ -z "${VPOP_HOME}" ]]; then
-		ebeep
 		eerror "vpopmail's home directory is null in passwd data!"
 		eerror "You probably want to check that out."
 		eerror "Continuing with default."
@@ -130,13 +129,17 @@ src_install() {
 	dodoc doc/AUTHORS ChangeLog doc/FAQ doc/INSTALL doc/README*
 	dohtml doc/doc_html/* doc/man_html/*
 	rm -rf "${D}/${VPOP_HOME}"/doc
-	dosym /usr/share/doc/${PF}/ "${VPOP_HOME}"/doc
+	dosym \
+		$(realpath --relative-to "${D}/${VPOP_HOME}"/ "${D}"/usr/share/doc/${PF}/) \
+		"${VPOP_HOME}"/doc
 
 	# create /etc/vpopmail.conf
 	if use mysql; then
 		dodir /etc
 		mv "${D}${VPOP_HOME}"/etc/vpopmail.mysql "${D}"/etc/vpopmail.conf
-		dosym /etc/vpopmail.conf "${VPOP_HOME}"/etc/vpopmail.mysql
+		dosym \
+			$(realpath --relative-to "${D}/${VPOP_HOME}"/etc/ "${D}"/etc/vpopmail.conf) \
+			"${VPOP_HOME}"/etc/vpopmail.mysql
 
 		sed -e '12d' -i "${D}"/etc/vpopmail.conf
 		echo '# Read-only DB' >> "${D}"/etc/vpopmail.conf


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-mail/vpopmail/files/, net-mail/vpopmail/
@ 2019-09-15 15:23 Michał Górny
  0 siblings, 0 replies; 3+ messages in thread
From: Michał Górny @ 2019-09-15 15:23 UTC (permalink / raw
  To: gentoo-commits

commit:     cf9877fcfdad14fd1c2dff9736b951a55637de08
Author:     Rolf Eike Beer <eike <AT> sf-mail <DOT> de>
AuthorDate: Sun Sep 15 12:46:22 2019 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Sep 15 15:19:26 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cf9877fc

net-mail/vpopmail: make patches apply with -p1

Both ebuilds still are able to apply them afterwards.

Signed-off-by: Rolf Eike Beer <eike <AT> sf-mail.de>
Closes: https://github.com/gentoo/gentoo/pull/12929
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 net-mail/vpopmail/files/vpopmail-5.4.9-access.violation.patch | 4 ++--
 net-mail/vpopmail/files/vpopmail-double-free.patch            | 4 ++--
 net-mail/vpopmail/files/vpopmail-lazy.patch                   | 4 ++--
 net-mail/vpopmail/files/vpopmail-vpgsql.patch                 | 4 ++--
 net-mail/vpopmail/vpopmail-5.4.33-r3.ebuild                   | 2 --
 5 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/net-mail/vpopmail/files/vpopmail-5.4.9-access.violation.patch b/net-mail/vpopmail/files/vpopmail-5.4.9-access.violation.patch
index 7a31fa9a3d3..ed7c62e7639 100644
--- a/net-mail/vpopmail/files/vpopmail-5.4.9-access.violation.patch
+++ b/net-mail/vpopmail/files/vpopmail-5.4.9-access.violation.patch
@@ -1,5 +1,5 @@
---- configure.in.org	2004-06-30 22:11:08.000000000 -0700
-+++ configure.in	2004-08-22 16:45:36.279473008 -0700
+--- a/configure.in.org	2004-06-30 22:11:08.000000000 -0700
++++ b/configure.in	2004-08-22 16:45:36.279473008 -0700
 @@ -463,16 +463,16 @@
    if test ! -d $vpopmaildir
    then

diff --git a/net-mail/vpopmail/files/vpopmail-double-free.patch b/net-mail/vpopmail/files/vpopmail-double-free.patch
index 16a40b82c4f..3e238f3303d 100644
--- a/net-mail/vpopmail/files/vpopmail-double-free.patch
+++ b/net-mail/vpopmail/files/vpopmail-double-free.patch
@@ -1,7 +1,7 @@
 diff --git a/trunk/vpalias.c b/trunk/vpalias.c
 index 9853f14..e9bd81f 100644
---- vpalias.c
-+++ vpalias.c
+--- a/vpalias.c
++++ b/vpalias.c
 @@ -369,7 +369,7 @@ char *valias_select_names( char *domain )
          }
        }

diff --git a/net-mail/vpopmail/files/vpopmail-lazy.patch b/net-mail/vpopmail/files/vpopmail-lazy.patch
index e47bbaa9d4b..4f4888ea6ba 100644
--- a/net-mail/vpopmail/files/vpopmail-lazy.patch
+++ b/net-mail/vpopmail/files/vpopmail-lazy.patch
@@ -1,5 +1,5 @@
---- Makefile.am.orig	2005-11-18 03:19:43.000000000 +0100
-+++ Makefile.am	2005-11-18 03:20:18.000000000 +0100
+--- a/Makefile.am.orig	2005-11-18 03:19:43.000000000 +0100
++++ b/Makefile.am	2005-11-18 03:20:18.000000000 +0100
 @@ -33,6 +33,7 @@
  
  vchkpw_SOURCES = vchkpw.c md5.c hmac_md5.c

diff --git a/net-mail/vpopmail/files/vpopmail-vpgsql.patch b/net-mail/vpopmail/files/vpopmail-vpgsql.patch
index 1d387e43f59..8869356c7e4 100644
--- a/net-mail/vpopmail/files/vpopmail-vpgsql.patch
+++ b/net-mail/vpopmail/files/vpopmail-vpgsql.patch
@@ -1,5 +1,5 @@
---- vpgsql.c.2	2011-02-28 18:00:45.000000000 +0100
-+++ vpgsql.c	2011-08-06 05:46:49.959717911 +0200
+--- a/vpgsql.c.2	2011-02-28 18:00:45.000000000 +0100
++++ b/vpgsql.c	2011-08-06 05:46:49.959717911 +0200
 @@ -392,10 +392,10 @@
  #endif
  

diff --git a/net-mail/vpopmail/vpopmail-5.4.33-r3.ebuild b/net-mail/vpopmail/vpopmail-5.4.33-r3.ebuild
index 11ed896e628..9aec8fe2f04 100644
--- a/net-mail/vpopmail/vpopmail-5.4.33-r3.ebuild
+++ b/net-mail/vpopmail/vpopmail-5.4.33-r3.ebuild
@@ -23,8 +23,6 @@ DEPEND="virtual/qmail
 RDEPEND="${DEPEND}"
 
 PATCHES=(
-	"-p0"
-	"--"
 	"${FILESDIR}"/${PN}-5.4.9-access.violation.patch
 	"${FILESDIR}"/${PN}-lazy.patch
 	"${FILESDIR}"/${PN}-vpgsql.patch


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-mail/vpopmail/files/, net-mail/vpopmail/
@ 2019-09-26 16:00 Joonas Niilola
  0 siblings, 0 replies; 3+ messages in thread
From: Joonas Niilola @ 2019-09-26 16:00 UTC (permalink / raw
  To: gentoo-commits

commit:     fc4c22fc0de9daba8b528c57a7f515a5da7bc332
Author:     Rolf Eike Beer <eike <AT> sf-mail <DOT> de>
AuthorDate: Sat Sep 21 18:08:04 2019 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Thu Sep 26 15:59:56 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fc4c22fc

net-mail/vpopmail: add some more patches

I have been running all but the strncat patch on my server for years now. The
strncat patch was taken from upstream bugtracker and looks sane to me.

While at it also package the upgrade instructions and let the user look them up
there.

Closes: https://bugs.gentoo.org/472420
Closes: https://bugs.gentoo.org/479432
Signed-off-by: Rolf Eike Beer <eike <AT> sf-mail.de>
Closes: https://github.com/gentoo/gentoo/pull/12990
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 ...vpopmail-5.4.33-clean-up-calling-maildrop.patch |  74 ++++++
 ...n-case-spamassassin-changed-the-file-size.patch |  96 ++++++++
 ...se-vfork-instances-that-do-more-than-exec.patch |  77 ++++++
 ....4.33-remove-unneeded-forward-declaration.patch |  24 ++
 .../vpopmail/files/vpopmail-5.4.33-strncat.patch   | 166 +++++++++++++
 .../vpopmail/files/vpopmail-5.4.33-unistd.patch    |   9 +
 .../vpopmail-5.4.33-vdelivermail-add-static.patch  |  34 +++
 net-mail/vpopmail/vpopmail-5.4.33-r4.ebuild        | 266 +++++++++++++++++++++
 8 files changed, 746 insertions(+)

diff --git a/net-mail/vpopmail/files/vpopmail-5.4.33-clean-up-calling-maildrop.patch b/net-mail/vpopmail/files/vpopmail-5.4.33-clean-up-calling-maildrop.patch
new file mode 100644
index 00000000000..c85c1b3150d
--- /dev/null
+++ b/net-mail/vpopmail/files/vpopmail-5.4.33-clean-up-calling-maildrop.patch
@@ -0,0 +1,74 @@
+From 692e6f75056d93f0e9a024e3638259d5ba0fe398 Mon Sep 17 00:00:00 2001
+From: Rolf Eike Beer <eike@sf-mail.de>
+Date: Thu, 21 Aug 2014 17:55:27 +0200
+Subject: [PATCH 4/5] clean up calling maildrop
+
+-add const for arguments
+-do not prepend "| " to call for preline, run_command() will then just skip
+ over this anyway
+-put the buffer for the maildrop command in the most local scope
+---
+ vdelivermail.c | 14 ++++++--------
+ 1 file changed, 6 insertions(+), 8 deletions(-)
+
+diff --git a/vpopmail-5.4.33/vdelivermail.c b/vpopmail-5.4.33/vdelivermail.c
+index be83a2a..2ad2e12 100644
+--- a/vdelivermail.c
++++ b/vdelivermail.c
+@@ -94,7 +94,7 @@ ssize_t get_message_size();
+ void deliver_mail(char *address, char *quota);
+ int check_forward_deliver(char *dir);
+ int is_looping( char *address );
+-void run_command(char *prog);
++static void run_command(const char *prog);
+ void checkuser(void);
+ void usernotfound(void);
+ int is_loop_match( const char *dt, const char *address);
+@@ -360,9 +360,6 @@ static int fdcopy (int write_fd, int read_fd, const char *extra_headers, size_t
+   long unsigned pid;
+   int  pim[2];
+ #endif
+-#ifdef MAILDROP
+-  char maildrop_command[256];
+-#endif
+ 
+     /* write the Return-Path: and Delivered-To: headers */
+     if (headerlen > 0) {
+@@ -409,7 +406,8 @@ static int fdcopy (int write_fd, int read_fd, const char *extra_headers, size_t
+ #ifdef MAILDROP
+       if ( limits.disable_maildrop==0 && vpw!=NULL &&
+            !(vpw->pw_gid & NO_MAILDROP) ) {
+-	sprintf(maildrop_command, "| preline %s", MAILDROP_PROG);
++	char maildrop_command[256];
++	sprintf(maildrop_command, "preline %s", MAILDROP_PROG);
+ 	run_command(maildrop_command);
+ 	DeleteMail = 1;
+ 	return(0);
+@@ -896,13 +894,13 @@ void (*f)();
+ /* open a pipe to a command 
+  * return the pid or -1 if error
+  */
+-void run_command(char *prog)
++void run_command(const char *prog)
+ {
+ 
+ #define MAX_ENV_BUFF 100
+ 
+  int child;
+- char *(args[4]);
++ const char *(args[4]);
+  int wstat;
+ 
+  while ((*prog == ' ') || (*prog == '|')) ++prog;
+@@ -915,7 +913,7 @@ void run_command(char *prog)
+    case 0:
+      
+      putenv("SHELL=/bin/sh");
+-     args[0] = "/bin/sh"; args[1] = "-c"; args[2] = prog; args[3] = 0;
++     args[0] = "/bin/sh"; args[1] = "-c"; args[2] = prog; args[3] = NULL;
+      sig_catch(SIGPIPE,SIG_DFL);
+      execv(*args,args);
+      printf("Unable to run /bin/sh: %d.", errno);
+-- 
+1.8.4.5
+

diff --git a/net-mail/vpopmail/files/vpopmail-5.4.33-fix-S-tag-in-case-spamassassin-changed-the-file-size.patch b/net-mail/vpopmail/files/vpopmail-5.4.33-fix-S-tag-in-case-spamassassin-changed-the-file-size.patch
new file mode 100644
index 00000000000..db22a6efde4
--- /dev/null
+++ b/net-mail/vpopmail/files/vpopmail-5.4.33-fix-S-tag-in-case-spamassassin-changed-the-file-size.patch
@@ -0,0 +1,96 @@
+From fd0a1034e3842ceb573851e62547b26a2b389263 Mon Sep 17 00:00:00 2001
+From: Rolf Eike Beer <eike@sf-mail.de>
+Date: Thu, 21 Aug 2014 18:48:52 +0200
+Subject: [PATCH 5/5] fix ,S= tag in case spamassassin changed the file size
+
+---
+ vdelivermail.c | 24 +++++++++++++++++++++---
+ 1 file changed, 21 insertions(+), 3 deletions(-)
+
+diff --git a/vpopmail-5.4.33/vdelivermail.c b/vpopmail-5.4.33/vdelivermail.c
+index 2ad2e12..3631c3c 100644
+--- a/vdelivermail.c
++++ b/vdelivermail.c
+@@ -351,6 +351,12 @@ static pid_t qmail_inject_open(char *address)
+     return(pid);
+ }
+ 
++/**
++ * @returns if delivery worked
++ * @retval 0 message was delivered as is
++ * @retval 1 the file has changed the size during delivery
++ * @retval -1 error
++ */
+ static int fdcopy (int write_fd, int read_fd, const char *extra_headers, size_t headerlen, char *address)
+ {
+   char msgbuf[4096];
+@@ -360,6 +366,7 @@ static int fdcopy (int write_fd, int read_fd, const char *extra_headers, size_t
+   long unsigned pid;
+   int  pim[2];
+ #endif
++  int has_changed_size = 0;
+ 
+     /* write the Return-Path: and Delivered-To: headers */
+     if (headerlen > 0) {
+@@ -399,6 +406,7 @@ static int fdcopy (int write_fd, int read_fd, const char *extra_headers, size_t
+           close(pim[1]);
+           dup2(pim[0], 0);
+           close(pim[0]);
++          has_changed_size = 1;
+         }
+     }
+ #endif
+@@ -431,7 +439,7 @@ static int fdcopy (int write_fd, int read_fd, const char *extra_headers, size_t
+         if ( write(write_fd, msgbuf, file_count) == -1 ) return -1;
+     }
+     
+-    return 0;
++    return has_changed_size;
+ }
+ 
+ void read_quota_from_maildir (const char *maildir, char *qbuf, size_t qlen)
+@@ -493,6 +501,7 @@ int deliver_to_maildir (
+   size_t headerlen;
+   int write_fd;
+   char quota[80];
++  int fdr;
+ 
+     headerlen = strlen (extra_headers);
+     msgsize += headerlen;
+@@ -518,7 +527,8 @@ int deliver_to_maildir (
+     }
+ 
+     local = 1;
+-    if (fdcopy(write_fd, read_fd, extra_headers, headerlen, maildir_to_email(maildir)) != 0) {
++    fdr = fdcopy(write_fd, read_fd, extra_headers, headerlen, maildir_to_email(maildir));
++    if (fdr < 0) {
+         /* Did the write fail because we were over quota? */
+         if ( errno == EDQUOT ) {
+             close(write_fd);
+@@ -530,6 +540,14 @@ int deliver_to_maildir (
+             unlink (local_file_tmp);
+             return -2;
+         }
++    } else if (fdr == 1) {
++       /* the file has changed it's size during delivery, e.g. because
++        * SpamAssassin has written it's report to it. */
++        struct stat st;
++
++        if (fstat(write_fd, &st) == 0 && st.st_size != msgsize)
++            snprintf(local_file_new, sizeof(local_file_new), "%snew/%lu.%lu.%.32s,S=%lu",
++                maildir, tm, pid, hostname, (long unsigned) st.st_size);
+     }
+ 
+     /* completed write to tmp directory, now move it into the new directory */
+@@ -777,7 +795,7 @@ void deliver_mail(char *address, char *quota)
+       }
+       
+       local = 0;
+-      if (fdcopy (fdm, 0, DeliveredTo, strlen(DeliveredTo), address) != 0) {
++      if (fdcopy (fdm, 0, DeliveredTo, strlen(DeliveredTo), address) < 0) {
+           printf ("write to qmail-inject failed: %d\n", errno);
+           close(fdm);
+           waitpid(inject_pid,&child,0);
+-- 
+1.8.4.5
+

diff --git a/net-mail/vpopmail/files/vpopmail-5.4.33-fix-those-vfork-instances-that-do-more-than-exec.patch b/net-mail/vpopmail/files/vpopmail-5.4.33-fix-those-vfork-instances-that-do-more-than-exec.patch
new file mode 100644
index 00000000000..4f154fcc8d3
--- /dev/null
+++ b/net-mail/vpopmail/files/vpopmail-5.4.33-fix-those-vfork-instances-that-do-more-than-exec.patch
@@ -0,0 +1,77 @@
+From de58b5d05fdabf2f17d8a6ec3ef804b59a013242 Mon Sep 17 00:00:00 2001
+From: Rolf Eike Beer <eike@sf-mail.de>
+Date: Thu, 21 Aug 2014 17:36:36 +0200
+Subject: [PATCH 2/5] fix those vfork() instances that do more than exec*()
+
+---
+ vdelivermail.c | 4 ++--
+ vpopmail.c     | 8 ++++----
+ vqmaillocal.c  | 2 +-
+ 3 files changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/vpopmail-5.4.33/vdelivermail.c b/vpopmail-5.4.33/vdelivermail.c
+index 241106e..be83a2a 100644
+--- a/vdelivermail.c
++++ b/vdelivermail.c
+@@ -330,7 +330,7 @@ static pid_t qmail_inject_open(char *address)
+ 
+     if ( pipe(pim) == -1) return 0;
+ 
+-    switch(pid=vfork()){
++    switch(pid=fork()){
+       case -1:
+         close(pim[0]);
+         close(pim[1]);
+@@ -381,7 +381,7 @@ static int fdcopy (int write_fd, int read_fd, const char *extra_headers, size_t
+            !(vpw->pw_gid & NO_SPAMASSASSIN) ) {
+ 
+         if (!pipe(pim)) {
+-          pid = vfork();
++          pid = fork();
+           switch (pid) {
+            case -1:
+             close(pim[0]);
+diff --git a/vpopmail-5.4.33/vpopmail.c b/vpopmail-5.4.33/vpopmail.c
+index 5aaeb32..334a8ab 100644
+--- a/vpopmail.c
++++ b/vpopmail.c
+@@ -1473,9 +1473,9 @@ int update_newu()
+ {
+  int pid;
+ 
+-  pid=vfork();
++  pid=fork();
+   if ( pid==0){
+-			  umask(022);
++    umask(022);
+     execl(QMAILNEWU,"qmail-newu", NULL);
+     exit(127);
+   } else {
+@@ -3366,9 +3366,9 @@ long unsigned tcprules_open()
+   /* create a pair of filedescriptors for our pipe */
+   if (pipe(pim) == -1)  { return(-1);}
+ 
+-  switch( pid=vfork()){
++  switch( pid=fork()){
+    case -1:
+-    /* vfork error. close pipes and exit */
++    /* fork error. close pipes and exit */
+     close(pim[0]); close(pim[1]);
+     return(-1);
+    case 0:
+diff --git a/vpopmail-5.4.33/vqmaillocal.c b/vpopmail-5.4.33/vqmaillocal.c
+index 6d3068c..80efa24 100644
+--- a/vqmaillocal.c
++++ b/vqmaillocal.c
+@@ -359,7 +359,7 @@ long unsigned qmail_inject_open(char *address)
+ 
+         if ( pipe(pim) == -1) return(-1);
+ 
+-        switch(pid=vfork()){
++        switch(pid=fork()){
+         case -1:
+                 close(pim[0]);
+                 close(pim[1]);
+-- 
+1.8.4.5
+

diff --git a/net-mail/vpopmail/files/vpopmail-5.4.33-remove-unneeded-forward-declaration.patch b/net-mail/vpopmail/files/vpopmail-5.4.33-remove-unneeded-forward-declaration.patch
new file mode 100644
index 00000000000..23ec43be024
--- /dev/null
+++ b/net-mail/vpopmail/files/vpopmail-5.4.33-remove-unneeded-forward-declaration.patch
@@ -0,0 +1,24 @@
+From 32ce986d86695dd55d4c888c30fe62b910b99f17 Mon Sep 17 00:00:00 2001
+From: Rolf Eike Beer <eike@sf-mail.de>
+Date: Thu, 21 Aug 2014 17:45:28 +0200
+Subject: [PATCH 3/5] remove unneeded forward declaration
+
+---
+ vchkpw.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/vpopmail-5.4.33/vchkpw.c b/vpopmail-5.4.33/vchkpw.c
+index b1c8a5d..d7d4351 100644
+--- a/vchkpw.c
++++ b/vchkpw.c
+@@ -91,7 +91,6 @@ void login_system_user();
+ void read_user_pass();
+ void vlog(int verror, char *TheUser, char *TheDomain, char *ThePass, char *TheName, char *IpAddr, char *LogLine);
+ void vchkpw_exit(int err);
+-void run_command(char *prog);
+ int authcram( char *response, char *challenge, char *password);
+ int authapop( char *password, char *timestamp, char *clearpass);
+ 
+-- 
+1.8.4.5
+

diff --git a/net-mail/vpopmail/files/vpopmail-5.4.33-strncat.patch b/net-mail/vpopmail/files/vpopmail-5.4.33-strncat.patch
new file mode 100644
index 00000000000..f3c9c71b299
--- /dev/null
+++ b/net-mail/vpopmail/files/vpopmail-5.4.33-strncat.patch
@@ -0,0 +1,166 @@
+https://sourceforge.net/p/vpopmail/patches/98/
+
+--- a/vpopmaild.c	(revision 998)
++++ b/vpopmaild.c	(working copy)
+@@ -1326,7 +1326,7 @@
+         }
+       }
+       snprintf(newpath, MAXPATH, "%s",myvpw->pw_dir);
+-      strncat(newpath, &path[i], MAXPATH );
++      strncat(newpath, &path[i], MAXPATH-strlen(newpath)-1);
+     } else {     /*  may be domain name   */
+       for(i=0;path[i]!='/'&&path[i]!=0&&i<256;++i) {
+         thedomain[i] = path[i];
+@@ -1337,7 +1337,7 @@
+         return(9);
+       } 
+       snprintf(newpath, MAXPATH, "%s", thedir);
+-      strncat(newpath, &path[i], MAXPATH );
++      strncat(newpath, &path[i], MAXPATH-strlen(newpath)-1);
+     }
+   }
+ 
+@@ -1459,23 +1459,23 @@
+     }
+     snprintf( WriteBuf, sizeof(WriteBuf), "%s", mydirent->d_name);
+     if ( S_ISREG(statbuf.st_mode ) ) {
+-      strncat(WriteBuf," file", sizeof(WriteBuf));
++      strncat(WriteBuf," file", sizeof(WriteBuf)-strlen(WriteBuf)-1);
+     } else if ( S_ISDIR(statbuf.st_mode ) ) {
+-      strncat(WriteBuf," dir", sizeof(WriteBuf));
++      strncat(WriteBuf," dir", sizeof(WriteBuf)-strlen(WriteBuf)-1);
+     } else if ( S_ISCHR(statbuf.st_mode ) ) {
+-      strncat(WriteBuf," chardev", sizeof(WriteBuf));
++      strncat(WriteBuf," chardev", sizeof(WriteBuf)-strlen(WriteBuf)-1);
+     } else if ( S_ISBLK(statbuf.st_mode ) ) {
+-      strncat(WriteBuf," blkdev", sizeof(WriteBuf));
++      strncat(WriteBuf," blkdev", sizeof(WriteBuf)-strlen(WriteBuf)-1);
+     } else if ( S_ISFIFO(statbuf.st_mode ) ) {
+-      strncat(WriteBuf," fifo", sizeof(WriteBuf));
++      strncat(WriteBuf," fifo", sizeof(WriteBuf)-strlen(WriteBuf)-1);
+     } else if ( S_ISLNK(statbuf.st_mode ) ) {
+-      strncat(WriteBuf," link", sizeof(WriteBuf));
++      strncat(WriteBuf," link", sizeof(WriteBuf)-strlen(WriteBuf)-1);
+     } else if ( S_ISSOCK(statbuf.st_mode ) ) {
+-      strncat(WriteBuf," sock", sizeof(WriteBuf));
++      strncat(WriteBuf," sock", sizeof(WriteBuf)-strlen(WriteBuf)-1);
+     } else {
+-      strncat(WriteBuf," unknown", sizeof(WriteBuf));
++      strncat(WriteBuf," unknown", sizeof(WriteBuf)-strlen(WriteBuf)-1);
+     }
+-    strncat(WriteBuf,RET_CRLF, sizeof(WriteBuf));
++    strncat(WriteBuf,RET_CRLF, sizeof(WriteBuf)-strlen(WriteBuf)-1);
+     wait_write();
+   }
+   if ( closedir(mydir) < 0 ) {
+@@ -1604,7 +1604,7 @@
+   while(fgets(tmpbuf,sizeof(tmpbuf),fs)!=NULL){
+     if ( strcmp(tmpbuf, "." RET_CRLF) == 0 || strcmp(tmpbuf, ".\n") == 0 ) {
+       snprintf(WriteBuf, sizeof(WriteBuf), "%s", ".");
+-      strncat(WriteBuf, tmpbuf, sizeof(WriteBuf));
++      strncat(WriteBuf, tmpbuf, sizeof(WriteBuf)-strlen(WriteBuf)-1);
+     } else {
+       memcpy(WriteBuf,tmpbuf,sizeof(tmpbuf));
+     }
+--- a/vmysql.c	(revision 998)
++++ b/vmysql.c	(working copy)
+@@ -731,7 +731,7 @@
+             );
+ 
+         if ( sortit == 1 ) {
+-            strncat( SqlBufRead, " order by pw_name", SQL_BUF_SIZE);
++            strncat( SqlBufRead, " order by pw_name", SQL_BUF_SIZE-strlen(SqlBufRead)-1);
+         }
+ 
+         if (res_read!=NULL) mysql_free_result(res_read_getall);
+--- a/vldap.c	(revision 998)
++++ b/vldap.c	(working copy)
+@@ -1022,7 +1022,7 @@
+ 
+     /* if we are lucky the domain is in the assign file */
+     if ( vget_assign(domain,dir_control_file,MAX_DIR_NAME,NULL,NULL)!=NULL ) {
+-        strncat(dir_control_file, "/.dir-control", MAX_DIR_NAME);
++        strncat(dir_control_file, "/.dir-control", MAX_DIR_NAME-strlen(dir_control_file)-1);
+ 
+     /* it isn't in the assign file so we have to get it from /etc/passwd */
+     } else {
+@@ -1041,7 +1041,7 @@
+         }
+ 
+         /* stick on the rest of the path */
+-        strncat(dir_control_file, "/" DOMAINS_DIR "/.dir-control", MAX_DIR_NAME);
++        strncat(dir_control_file, "/" DOMAINS_DIR "/.dir-control", MAX_DIR_NAME-strlen(dir_control_file)-1);
+     }
+     return(dir_control_file);
+ }
+@@ -1177,7 +1177,7 @@
+  char dir_control_file[MAX_DIR_NAME];
+ 
+     vget_assign(domain, dir_control_file, 156, NULL,NULL);
+-    strncat(dir_control_file,"/.dir-control", MAX_DIR_NAME);
++    strncat(dir_control_file,"/.dir-control", MAX_DIR_NAME-strlen(dir_control_file)-1);
+     return(unlink(dir_control_file));
+ }
+ 
+--- a/vpopmail.c	(revision 998)
++++ b/vpopmail.c	(working copy)
+@@ -1900,8 +1900,8 @@
+ 
+     //  Copy the rest of the terms into the domain name
+     for(j=1;j<i;j++) {
+-      strncat( domain, ".", MAX_BUFF );
+-      strncat( domain, parts[j], MAX_BUFF );
++      strncat( domain, ".", MAX_BUFF-strlen(domain)-1);
++      strncat( domain, parts[j], MAX_BUFF-strlen(domain)-1);
+     }
+   
+   }
+--- a/vcdb.c	(revision 998)
++++ b/vcdb.c	(working copy)
+@@ -271,7 +271,7 @@
+     }
+ 
+     strncpy(line,user,sizeof(line)); 
+-    strncat(line,":",sizeof(line));
++    strncat(line,":",sizeof(line)-strlen(line)-1);
+     ptr = line;
+     while (*ptr != ':') { ptr++; }
+     ptr++;
+@@ -1055,7 +1055,7 @@
+  char dir_control_file[MAX_DIR_NAME];
+ 
+     vget_assign(domain, dir_control_file, 156, NULL,NULL);
+-    strncat(dir_control_file,"/.dir-control", MAX_DIR_NAME);
++    strncat(dir_control_file,"/.dir-control", MAX_DIR_NAME-strlen(dir_control_file)-1);
+     return(unlink(dir_control_file));
+ }
+ 
+@@ -1120,7 +1120,7 @@
+ 
+     /* if we are lucky the domain is in the assign file */
+     if ( vget_assign(domain,dir_control_file,MAX_DIR_NAME,NULL,NULL)!=NULL ) { 
+-	strncat(dir_control_file, "/.dir-control", MAX_DIR_NAME);
++	strncat(dir_control_file, "/.dir-control", MAX_DIR_NAME-strlen(dir_control_file)-1);
+ 
+     /* it isn't in the assign file so we have to get it from /etc/passwd */
+     } else {
+@@ -1139,7 +1139,7 @@
+         }
+ 
+         /* stick on the rest of the path */
+-        strncat(dir_control_file, "/" DOMAINS_DIR "/.dir-control", MAX_DIR_NAME); 
++        strncat(dir_control_file, "/" DOMAINS_DIR "/.dir-control", MAX_DIR_NAME-strlen(dir_control_file)-1);
+     }
+     return(dir_control_file);
+ }
+--- a/vpgsql.c	(revision 998)
++++ b/vpgsql.c	(working copy)
+@@ -522,7 +522,7 @@
+ #endif
+ 	     );
+     if ( sortit == 1 ) {
+-      strncat( SqlBufRead, " order by pw_name", SQL_BUF_SIZE);
++      strncat( SqlBufRead, " order by pw_name", SQL_BUF_SIZE-strlen(SqlBufRead)-1);
+     }
+     if ( pgres ) { /* reset state if we had previous result */
+       PQclear(pgres);    // clear previous result	

diff --git a/net-mail/vpopmail/files/vpopmail-5.4.33-unistd.patch b/net-mail/vpopmail/files/vpopmail-5.4.33-unistd.patch
new file mode 100644
index 00000000000..803276f89ad
--- /dev/null
+++ b/net-mail/vpopmail/files/vpopmail-5.4.33-unistd.patch
@@ -0,0 +1,9 @@
+--- vpopmail-5.4.33-orig/cdb/cdb_seek.c	2019-09-25 23:01:01.332000000 +0200
++++ vpopmail-5.4.33/cdb/cdb_seek.c	2019-09-25 23:03:04.112000000 +0200
+@@ -1,5 +1,6 @@
+ #include <sys/types.h>
+ #include <errno.h>
++#include <unistd.h>
+ #include "cdb.h"
+ 
+ #ifndef SEEK_SET

diff --git a/net-mail/vpopmail/files/vpopmail-5.4.33-vdelivermail-add-static.patch b/net-mail/vpopmail/files/vpopmail-5.4.33-vdelivermail-add-static.patch
new file mode 100644
index 00000000000..88306872b48
--- /dev/null
+++ b/net-mail/vpopmail/files/vpopmail-5.4.33-vdelivermail-add-static.patch
@@ -0,0 +1,34 @@
+From 31bef5aeeaf1e24eb40e84e41312dd6ae865ee03 Mon Sep 17 00:00:00 2001
+From: Rolf Eike Beer <eike@sf-mail.de>
+Date: Thu, 21 Aug 2014 17:34:27 +0200
+Subject: [PATCH 1/5] vdelivermail: add static
+
+---
+ vdelivermail.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/vpopmail-5.4.33/vdelivermail.c b/vpopmail-5.4.33/vdelivermail.c
+index d94129f..241106e 100644
+--- a/vdelivermail.c
++++ b/vdelivermail.c
+@@ -322,7 +322,7 @@ int process_valias(void)
+ #endif
+ 
+ /* Forks off qmail-inject.  Returns PID of child, or 0 for failure. */
+-pid_t qmail_inject_open(char *address)
++static pid_t qmail_inject_open(char *address)
+ {
+  int pim[2];
+  pid_t pid;
+@@ -351,7 +351,7 @@ pid_t qmail_inject_open(char *address)
+     return(pid);
+ }
+ 
+-int fdcopy (int write_fd, int read_fd, const char *extra_headers, size_t headerlen, char *address)
++static int fdcopy (int write_fd, int read_fd, const char *extra_headers, size_t headerlen, char *address)
+ {
+   char msgbuf[4096];
+   ssize_t file_count;
+-- 
+1.8.4.5
+

diff --git a/net-mail/vpopmail/vpopmail-5.4.33-r4.ebuild b/net-mail/vpopmail/vpopmail-5.4.33-r4.ebuild
new file mode 100644
index 00000000000..4b291b71351
--- /dev/null
+++ b/net-mail/vpopmail/vpopmail-5.4.33-r4.ebuild
@@ -0,0 +1,266 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools eutils fixheadtails qmail user
+
+HOMEPAGE="http://www.inter7.com/index.php?page=vpopmail"
+DESCRIPTION="Collection of programs to manage virtual email on Qmail servers"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE="clearpasswd ipalias maildrop mysql postgres spamassassin"
+REQUIRED_USE="mysql? ( !postgres )"
+
+DEPEND="
+	acct-group/vpopmail
+	virtual/qmail
+	maildrop? ( mail-filter/maildrop )
+	mysql? ( dev-db/mysql-connector-c:0= )
+	postgres? ( dev-db/postgresql:=[server] )
+	spamassassin? ( mail-filter/spamassassin )"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-5.4.9-access.violation.patch
+	"${FILESDIR}"/${PN}-lazy.patch
+	"${FILESDIR}"/${PN}-vpgsql.patch
+	"${FILESDIR}"/${PN}-double-free.patch
+	"${FILESDIR}"/${PN}-5.4.33-vdelivermail-add-static.patch
+	"${FILESDIR}"/${PN}-5.4.33-fix-those-vfork-instances-that-do-more-than-exec.patch
+	"${FILESDIR}"/${PN}-5.4.33-remove-unneeded-forward-declaration.patch
+	"${FILESDIR}"/${PN}-5.4.33-clean-up-calling-maildrop.patch
+	"${FILESDIR}"/${PN}-5.4.33-fix-S-tag-in-case-spamassassin-changed-the-file-size.patch
+	"${FILESDIR}"/${PN}-5.4.33-strncat.patch
+	"${FILESDIR}"/${PN}-5.4.33-unistd.patch
+)
+DOCS=(
+	doc/.
+)
+HTML_DOCS=(
+	doc_html/.
+	man_html/.
+)
+
+# This makes sure the variable is set, and that it isn't null.
+VPOP_DEFAULT_HOME="/var/vpopmail"
+
+vpopmail_set_homedir() {
+	VPOP_HOME=$(egethome vpopmail)
+	if [[ -z "${VPOP_HOME}" ]]; then
+		eerror "vpopmail's home directory is null in passwd data!"
+		eerror "You probably want to check that out."
+		eerror "Continuing with default."
+		VPOP_HOME="${VPOP_DEFAULT_HOME}"
+	else
+		einfo "Setting VPOP_HOME to: $VPOP_HOME"
+	fi
+}
+
+pkg_setup() {
+	enewuser vpopmail 89 -1 ${VPOP_DEFAULT_HOME} vpopmail
+	upgradewarning
+}
+
+src_prepare() {
+	default
+
+	echo 'install-recursive: install-exec-am' \
+		>>"${S}"/Makefile.am
+
+	# fix maildir paths
+	sed -i -e 's|Maildir|.maildir|g' \
+		vchkpw.c vconvert.c vdelivermail.c \
+		vpopbull.c vpopmail.c vqmaillocal.c \
+		vuserinfo.c maildirquota.c || die
+
+	# remove vpopmail advertisement
+	sed -i -e '/printf.*vpopmail/s:vpopmail (:(:' \
+		vdelivermail.c vpopbull.c vqmaillocal.c || die
+
+	# automake/autoconf
+	mv -f "${S}"/configure.{in,ac} || die
+	sed -i -e 's,AM_CONFIG_HEADER,AC_CONFIG_HEADERS,g' \
+		configure.ac || die
+
+	# _FORTIFY_SOURCE
+	sed -i \
+		-e 's/\(snprintf(\s*\(LI->[a-zA-Z_]\+\),\s*\)[a-zA-Z_]\+,/\1 sizeof(\2),/' \
+		vlistlib.c || die
+
+	eautoreconf
+	ht_fix_file cdb/Makefile
+}
+
+src_configure() {
+	vpopmail_set_homedir
+
+	local authopts
+	if use mysql; then
+		incdir=$(mysql_config --variable=pkgincludedir || die)
+		libdir=$(mysql_config --variable=pkglibdir || die)
+		authopts+=" --enable-auth-module=mysql"
+		authopts+=" --enable-incdir=${incdir}"
+		authopts+=" --enable-libdir=${libdir}"
+		authopts+=" --enable-sql-logging"
+		authopts+=" --enable-valias"
+		authopts+=" --disable-mysql-replication"
+		authopts+=" --enable-mysql-limits"
+	elif use postgres; then
+		libdir=$(pg_config --libdir || die)
+		incdir=$(pg_config --pkgincludedir || die)
+		authopts+=" --enable-auth-module=pgsql"
+		authopts+=" --enable-incdir=${incdir}"
+		authopts+=" --enable-libdir=${libdir}"
+		authopts+=" --enable-sql-logging"
+		authopts+=" --enable-valias"
+	else
+		authopts+=" --enable-auth-module=cdb"
+	fi
+
+	econf ${authopts} \
+		--sysconfdir=${VPOP_HOME}/etc \
+		--enable-non-root-build \
+		--enable-qmaildir=${QMAIL_HOME} \
+		--enable-qmail-newu=${QMAIL_HOME}/bin/qmail-newu \
+		--enable-qmail-inject=${QMAIL_HOME}/bin/qmail-inject \
+		--enable-qmail-newmrh=${QMAIL_HOME}/bin/qmail-newmrh \
+		--enable-vpopuser=vpopmail \
+		--enable-vpopgroup=vpopmail \
+		--enable-many-domains \
+		--enable-file-locking \
+		--enable-file-sync \
+		--enable-md5-passwords \
+		--enable-logging \
+		--enable-auth-logging \
+		--enable-log-name=vpopmail \
+		--enable-qmail-ext \
+		--disable-tcpserver-file \
+		--disable-roaming-users \
+		$(use_enable ipalias ip-alias-domains) \
+		$(use_enable clearpasswd clear-passwd) \
+		$(use_enable maildrop) \
+		$(use_enable maildrop maildrop-prog /usr/bin/maildrop) \
+		$(use_enable spamassassin)
+}
+
+src_install() {
+	vpopmail_set_homedir
+
+	emake DESTDIR="${D}" install
+	keepdir "${VPOP_HOME}"/domains
+
+	# install helper script for maildir conversion
+	into "${VPOP_HOME}"
+	dobin "${FILESDIR}"/vpopmail-Maildir-dotmaildir-fix.sh
+	into /usr
+
+	mv doc/doc_html/ doc/man_html/ . || die
+	einstalldocs
+	rm -r "${D}/${VPOP_HOME}"/doc || die
+	dosym \
+		$(realpath --relative-to "${D}/${VPOP_HOME}"/ "${D}"/usr/share/doc/${PF}/ || die) \
+		"${VPOP_HOME}"/doc
+
+	# create /etc/vpopmail.conf
+	if use mysql; then
+		insinto /etc
+		newins "${D}${VPOP_HOME}"/etc/vpopmail.mysql vpopmail.conf
+		dosym \
+			$(realpath --relative-to "${D}/${VPOP_HOME}"/etc/ "${D}"/etc/vpopmail.conf || die) \
+			"${VPOP_HOME}"/etc/vpopmail.mysql
+
+		sed -e '12d' -i "${D}"/etc/vpopmail.conf || die
+		echo '# Read-only DB' >> "${D}"/etc/vpopmail.conf
+		echo 'localhost|0|vpopmail|secret|vpopmail' >> "${D}"/etc/vpopmail.conf
+		echo '# Write DB' >> "${D}"/etc/vpopmail.conf
+		echo 'localhost|0|vpopmail|secret|vpopmail' >> "${D}"/etc/vpopmail.conf
+
+		# lock down perms
+		fperms 640 /etc/vpopmail.conf
+		fowners root:vpopmail /etc/vpopmail.conf
+	fi
+
+	insinto "${VPOP_HOME}"/etc
+	doins vusagec.conf
+	dosym "${VPOP_HOME}"/etc/vusagec.conf /etc/vusagec.conf
+	sed -i 's/Disable = False;/Disable = True;/g' "${D}${VPOP_HOME}"/etc/vusagec.conf || die
+
+	einfo "Installing env.d entry"
+	dodir /etc/env.d
+	doenvd "${FILESDIR}"/99vpopmail
+
+	einfo "Locking down vpopmail permissions"
+	fowners -R root:0 "${VPOP_HOME}"/{bin,etc,include}
+	fowners root:vpopmail "${VPOP_HOME}"/bin/vchkpw
+	fperms 4711 "${VPOP_HOME}"/bin/vchkpw
+}
+
+pkg_postinst() {
+	if use mysql ; then
+		elog
+		elog "You have 'mysql' turned on in your USE"
+		elog "Vpopmail needs a VALID MySQL USER. Let's call it 'vpopmail'"
+		elog "You MUST add it and then specify its passwd in the /etc/vpopmail.conf file"
+		elog
+		elog "First log into mysql as your mysql root user and pass. Then:"
+		elog "> create database vpopmail;"
+		elog "> use mysql;"
+		elog "> grant select, insert, update, delete, create, drop on vpopmail.* to"
+		elog "  vpopmail@localhost identified by 'your password';"
+		elog "> flush privileges;"
+		elog
+		elog "If you have problems with vpopmail not accepting mail properly,"
+		elog "please ensure that /etc/vpopmail.conf is chmod 640 and"
+		elog "owned by root:vpopmail"
+		elog
+	fi
+
+	# do this for good measure
+	if [[ -e /etc/vpopmail.conf ]]; then
+		chmod 640 /etc/vpopmail.conf || die
+		chown root:vpopmail /etc/vpopmail.conf || die
+	fi
+
+	upgradewarning
+}
+
+pkg_postrm() {
+	vpopmail_set_homedir
+
+	elog "The vpopmail DATA will NOT be removed automatically."
+	elog "You can delete them manually by removing the ${VPOP_HOME} directory."
+}
+
+upgradewarning() {
+	ewarn
+	ewarn "Massive important warning if you are upgrading to 5.2.1-r8 or older"
+	ewarn "The internal structure of the mail storage has changed for"
+	ewarn "consistancy with the rest of Gentoo! Please review and utilize the "
+	ewarn "script at ${VPOP_HOME}/bin/vpopmail-Maildir-dotmaildir-fix.sh"
+	ewarn "to upgrade your system! (It can do conversions both ways)."
+	ewarn "You should be able to run it right away without any changes."
+	ewarn
+
+	elog
+	elog "Use of vpopmail's tcp.smtp[.cdb] is also deprecated now, consider"
+	elog "using net-mail/relay-ctrl instead."
+	elog
+
+	if use mysql; then
+		elog
+		elog "If you are upgrading from 5.4.17 or older, you have to fix your"
+		elog "MySQL tables, please see the UPGRADE file in the documentation!"
+		elog
+	fi
+
+	ewarn
+	ewarn "Newer versions of vpopmail contain a quota daemon called vusaged."
+	ewarn "This ebuild DOES NOT INSTALL vusaged and has therefore disabled"
+	ewarn "its usage in ${VPOP_HOME}/etc/vusagec.conf. DO NOT ENABLE!"
+	ewarn "Otherwise mail delivery WILL BREAK"
+	ewarn
+}


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-09-26 16:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-26 16:00 [gentoo-commits] repo/gentoo:master commit in: net-mail/vpopmail/files/, net-mail/vpopmail/ Joonas Niilola
  -- strict thread matches above, loose matches on Subject: below --
2019-09-15 15:23 Michał Górny
2018-06-08  5:11 Robin H. Johnson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox