diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /net-mail/vpopmail |
reinit the tree, so we can have metadata
Diffstat (limited to 'net-mail/vpopmail')
-rw-r--r-- | net-mail/vpopmail/Manifest | 12 | ||||
-rw-r--r-- | net-mail/vpopmail/files/99vpopmail | 2 | ||||
-rw-r--r-- | net-mail/vpopmail/files/vpopmail-5.4.9-access.violation.patch | 27 | ||||
-rw-r--r-- | net-mail/vpopmail/files/vpopmail-Maildir-dotmaildir-fix.sh | 42 | ||||
-rw-r--r-- | net-mail/vpopmail/files/vpopmail-double-free.patch | 13 | ||||
-rw-r--r-- | net-mail/vpopmail/files/vpopmail-lazy.patch | 10 | ||||
-rw-r--r-- | net-mail/vpopmail/files/vpopmail-vpgsql.patch | 94 | ||||
-rw-r--r-- | net-mail/vpopmail/metadata.xml | 20 | ||||
-rw-r--r-- | net-mail/vpopmail/vpopmail-5.4.33-r1.ebuild | 251 | ||||
-rw-r--r-- | net-mail/vpopmail/vpopmail-5.4.33.ebuild | 240 |
10 files changed, 711 insertions, 0 deletions
diff --git a/net-mail/vpopmail/Manifest b/net-mail/vpopmail/Manifest new file mode 100644 index 000000000000..5e78044c0a02 --- /dev/null +++ b/net-mail/vpopmail/Manifest @@ -0,0 +1,12 @@ +AUX 99vpopmail 64 SHA256 63468f27aa1a588482b843d899d98eaeda2b4152d28b8d120dcdf8d3610532a4 SHA512 8e9323006ddafae6e4ee8da2e0c9753ce11fd3f6e7c8bb6931ccc147ab6c9782c71d704222343be902f8784aa27a4425fd04a1f11cff5421dfc25fd76d3de953 WHIRLPOOL 2fcd1e603dce3cb7c174fedf3189b8a060e64595d3a0836b15082a46cee612c8fad4f5742eb6ae5490ed5adfb16a14a431b55090c9e60140ac6c00ae62f19e4b +AUX vpopmail-5.4.9-access.violation.patch 918 SHA256 cf6840d7dc6131969ef5a69b1d520a5d01d7414e1638a0eeebd12c5689f380ac SHA512 8d877f5057550d25a77a617e81913e9fd94875ab1f1dd6c41e5d49756ff89cd2e089c48d48c81f990d901d5fcfbd0c467b2b0d1a3cdf8c7e78581c1f368e64fd WHIRLPOOL a4111f32fbba3604285c22d01d7f53202571573144d33a1dae866f4738748db0f98b3908f845c32919f579abf019bdb32b8f40418529c339c4fb8448014cda3f +AUX vpopmail-Maildir-dotmaildir-fix.sh 1346 SHA256 497244010307b1df59861df0a56538737b7ab39ec37fe7a743ec871efd168820 SHA512 201ad103157add727560bc1596042ae621d1645abf912aa3b3ec1af71aaf65dff92c967f000b7a126e9f2eb5e351838c78ffee855402d93bdcf89e96ebb0d0e9 WHIRLPOOL aded913f4347f65132403a0c3c160fcc897cfc83f4fa3e3ce4c9f6e1b9db5a126775b9ef4e4bbd96c71f3ae7593d1f0aaac1853293fd9b1f12faa720f850b5a8 +AUX vpopmail-double-free.patch 411 SHA256 30baf7ccd16af5ab375e03b56764c367f589f0cf1e0535fcc98b5c591829b055 SHA512 f12c29172e0bf0da173847c30db552dfb49e437805c74e0d03064dffb7a1bf71b0d897a5f13d019fd25cb103e394f0f869778de42288e6c6cc3e8612037b5190 WHIRLPOOL 8678656496fdea52e9f40ed3da113ac7c71cd24371e87108bd6bf9800ed55ecc392f044ff33ca694852772b6e815c6e167a5a3c0ec9dcc70e1bc31f840597820 +AUX vpopmail-lazy.patch 324 SHA256 aa1f8123433b82cdae554c943c8731359e226c598cea22496fdd63a11ab58fc4 SHA512 42f1e24ee850b9e858a271d734246981c506d74556a62d0124ebe8e842553e32e57603975545d8f49d76e3cca832a73ef61ef191a0a1cf07f9343fe609ecc0c5 WHIRLPOOL 6a00bc14728d58f49257350312950ac32aa8f9689fd1e53105da50464b32ea54f862411def1771a4a597681ab97c88463a4e05c892841c447b428789eb67eeda +AUX vpopmail-vpgsql.patch 2666 SHA256 fdd5bed1b568b6a5ca7eaeccc2e41e873828e215dac465e72e12a3c4696a47b9 SHA512 a8067aabfac181637f1366be0215c885ad380e44bbae1a69f9b0438b0a99cd194c2ce2068acf25142c9bfe6623ca8a77b1a9b82790f7faeb6e921c20cd1c1e20 WHIRLPOOL f771ae0758f783090b902b349ab1405522325ee90bf16a9bbf9b979fd9d43190ded495cca09e7c14339b8f58652dc445b41f7204a7bde036f6514bd0a7ed18f9 +DIST vpopmail-5.4.33.tar.gz 612271 SHA256 383c7436dfb18e773336f608f1771fc08559143c4f3938a5807a0cc5994c44f4 SHA512 abd5060d709c661d95ca442c6f77c4c27cf30a3c6790fc36d76ccf379ed2e08c1f0af697b2bcc57176a2cdb2cb67f6c27236d7b3fa69a135fa87f45a5df208ab WHIRLPOOL 9b49635984e541880528e56da9932a74e1a0988ef0b82f0f15538b6f9744c3bf1e86da45dd5de0c55af714669547c48d1f13830c8480e6760bc548b5047520f3 +EBUILD vpopmail-5.4.33-r1.ebuild 7929 SHA256 217b46efdc5dc4c9a08c674713fdb3aab310b35ae9100f06b2c9c1a9dd2c1cc0 SHA512 0ba88759c94ab55f6f4e0cfdd4118c80bcbec34117a338e5ab423bb0e70cbcc57ffde9ccdbe765e7c834e5aec30130b42fde04c19cd045585bb38d9efe196a0b WHIRLPOOL dc8dd96f10a2e4866b3c7ca0efcd0f61dea00e97c0c6ef46caf0075e3d707523c7b8b6f2be812b8ae328ed13a018d8f18742757be50af36e33bb3099755e4fcf +EBUILD vpopmail-5.4.33.ebuild 7532 SHA256 f5cc82b0ef3e12a808e60229abf5a8ba59380e079c6373d0dee80bf920803f70 SHA512 d9ee0f65e07ebc0de79122cc34502bbfd208fb28db7bbe68c8f9f6a5b768eae555847dc44a27e815835bc297a119756c657a842a81ab4427ef3e22a21d69a4cf WHIRLPOOL 25707aae1992a6ba84356932243ebffbbef1f42d11249f46168b404ef8bfdb0aa908f97bcb8da112d62e4e81b40ac95bc736b210ddaf0e3da66900e5e42e6243 +MISC ChangeLog 3065 SHA256 8a1377992b911a5fbb08b3f9526e5389269900555caa93a3de4ee012e0b413fb SHA512 73e14f456da30811e77fbf0a5aec6f7ce82adfb28d9dcee80ac19eba34095952a0c02a59a7f05366b5b237ec54c74fd35b36070457665688bc73a32813e051bf WHIRLPOOL 486ede1fe93a08edb0d90692a2024f416a30da25856322b650bc83e0ea2f3948251e5486eaefe2f89ce5e355b436bc122305d22ce1946bb8aaaa3a33af9da96d +MISC ChangeLog-2015 18571 SHA256 610ccd788236e73699a6023205310533174bcfea4bf520b69ddda7e68ba91794 SHA512 2bb6e3a867769c3b809fb0b983765ec1b3f74a9eb63abfa88ee9ea103c558f5f7c414ea91ba9d918255ba72aaf85666882af0c5a4d5c8d0134cb1f6795747ad1 WHIRLPOOL 52f60baf16bf2691caf91ba11d4b6a7e11930384a629a07d6aa24c313d0ac69769a0a1aec8fd48ad06aea39654937a0d903b4aa9a12d7360f5bbd5379673f8a0 +MISC metadata.xml 680 SHA256 05070dc38eb3c290359ab6ce593298bb45f61d037e341f9b3bc96bfaebb7a0f0 SHA512 66869b1dd1465c1914461874ca44988a1cf3cc34ca53cdaf2fc2851d6580d756ac1446cedc7168f50bcdfc82821f7ebb109276deabdc099325d0848a97a63ffd WHIRLPOOL 1f2c6cae054ac3e8cc6e63d7601162902de891ba4106c5a3c775fc8e225bae86fc6411f49fb435a51fba88a2286708044b736e3d1c187f4c0d6541662aa878ee diff --git a/net-mail/vpopmail/files/99vpopmail b/net-mail/vpopmail/files/99vpopmail new file mode 100644 index 000000000000..02d0a9c4d35a --- /dev/null +++ b/net-mail/vpopmail/files/99vpopmail @@ -0,0 +1,2 @@ +ROOTPATH="/var/vpopmail/bin" +CONFIG_PROTECT="/var/vpopmail/etc" 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 new file mode 100644 index 000000000000..7a31fa9a3d3e --- /dev/null +++ b/net-mail/vpopmail/files/vpopmail-5.4.9-access.violation.patch @@ -0,0 +1,27 @@ +--- configure.in.org 2004-06-30 22:11:08.000000000 -0700 ++++ configure.in 2004-08-22 16:45:36.279473008 -0700 +@@ -463,16 +463,16 @@ + if test ! -d $vpopmaildir + then + AC_MSG_WARN( creating $vpopmaildir ) +- mkdir -p $vpopmaildir +- chown $vpopmailuid $vpopmaildir +- chgrp $vpopmailgid $vpopmaildir +- chmod 755 $vpopmaildir ++ mkdir -p ${D}/$vpopmaildir ++ chown $vpopmailuid ${D}/$vpopmaildir ++ chgrp $vpopmailgid ${D}/$vpopmaildir ++ chmod 755 ${D}/$vpopmaildir + fi + AC_MSG_WARN( making a vpopmail etc directory ) +- mkdir $vpopmaildir/etc +- chown $vpopmailuid "$vpopmaildir"/etc +- chgrp $vpopmailgid "$vpopmaildir"/etc +- chmod 755 "$vpopmaildir"/etc ++ mkdir ${D}/$vpopmaildir/etc ++ chown $vpopmailuid ${D}/$vpopmaildir/etc ++ chgrp $vpopmailgid ${D}/$vpopmaildir/etc ++ chmod 755 ${D}/$vpopmaildir/etc + fi + + #---------------------------------------------------------------------- diff --git a/net-mail/vpopmail/files/vpopmail-Maildir-dotmaildir-fix.sh b/net-mail/vpopmail/files/vpopmail-Maildir-dotmaildir-fix.sh new file mode 100644 index 000000000000..758cced2d885 --- /dev/null +++ b/net-mail/vpopmail/files/vpopmail-Maildir-dotmaildir-fix.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# Written by Robin H. Johnson, robbat2@gentoo.org + +OLDNAME='Maildir' +NEWNAME='.maildir' +SEARCHPATH=/var/vpopmail/domains/ +MINDEPTH=3 +# If you have a very large vpopmail deployment, you may need to increase MAXDEPTH. +MAXDEPTH=6 + +if [ "${1}" == '--revert' ]; then + SEARCHNAME="${NEWNAME}" + REPLACENAME="${OLDNAME}" +else + SEARCHNAME="${OLDNAME}" + REPLACENAME="${NEWNAME}" +fi + +echo "Doing '${SEARCHNAME}' '${REPLACENAME}' changeover" +echo find ${SEARCHPATH} -name "${SEARCHNAME}" -maxdepth $MAXDEPTH -mindepth $MINDEPTH -type d +for i in `find ${SEARCHPATH} -name "${SEARCHNAME}" -maxdepth $MAXDEPTH -mindepth $MINDEPTH -type d`; do + foundname=${i/${SEARCHNAME}*}${SEARCHNAME} + base="`dirname $i`" + todoname=${base}/${REPLACENAME} + #echo "$foundname -> $todoname" + echo "Fixing `echo $base | sed -e "s|${SEARCHPATH}||g"`" + chmod +t $base + if [ -L ${todoname} ]; then + echo Removing symlink "${todoname}" + rm ${todoname} + fi + if [ -e ${todoname} ]; then + echo "Error! Cannot move ${i} as destination exists!" + continue + fi + mv "${foundname}" "${todoname}" + ln -s "${todoname}" "${foundname}" + chown vpopmail:vpopmail "${foundname}" + chmod -t $base +done; diff --git a/net-mail/vpopmail/files/vpopmail-double-free.patch b/net-mail/vpopmail/files/vpopmail-double-free.patch new file mode 100644 index 000000000000..d7d118578d73 --- /dev/null +++ b/net-mail/vpopmail/files/vpopmail-double-free.patch @@ -0,0 +1,13 @@ +diff --git a/trunk/vpalias.c b/trunk/vpalias.c +index 9853f14..e9bd81f 100644 +--- a/trunk/vpalias.c ++++ b/trunk/vpalias.c +@@ -369,7 +369,7 @@ char *valias_select_names( char *domain ) + } + } + } +- if (num_names < max_names) { ++ if (num_names < max_names && num_names > 0) { + new_names = realloc( names, num_names * sizeof(char *) ); + if (new_names != NULL) + names = new_names; diff --git a/net-mail/vpopmail/files/vpopmail-lazy.patch b/net-mail/vpopmail/files/vpopmail-lazy.patch new file mode 100644 index 000000000000..e47bbaa9d4ba --- /dev/null +++ b/net-mail/vpopmail/files/vpopmail-lazy.patch @@ -0,0 +1,10 @@ +--- Makefile.am.orig 2005-11-18 03:19:43.000000000 +0100 ++++ Makefile.am 2005-11-18 03:20:18.000000000 +0100 +@@ -33,6 +33,7 @@ + + vchkpw_SOURCES = vchkpw.c md5.c hmac_md5.c + vchkpw_LDADD = libvpopmail.a @auth_libs@ ++vchkpw_LDFLAGS = -Wl,-z,now + + vchangepw_SOURCES = vchangepw.c + vchangepw_LDADD = libvpopmail.a @auth_libs@ diff --git a/net-mail/vpopmail/files/vpopmail-vpgsql.patch b/net-mail/vpopmail/files/vpopmail-vpgsql.patch new file mode 100644 index 000000000000..1d387e43f59d --- /dev/null +++ b/net-mail/vpopmail/files/vpopmail-vpgsql.patch @@ -0,0 +1,94 @@ +--- vpgsql.c.2 2011-02-28 18:00:45.000000000 +0100 ++++ vpgsql.c 2011-08-06 05:46:49.959717911 +0200 +@@ -392,10 +392,10 @@ + #endif + + #ifdef ENABLE_SQL_LOGGING +- qnprintf( sqlBufUpdate, SQL_BUF_SIZE, ++ qnprintf( SqlBufUpdate, SQL_BUF_SIZE, + "delete from vlog where domain = '%s'", domain ); + pgres=PQexec(pgc, SqlBufUpdate); +- if( !pgres || PGresultStatus(pgres)!=PGRES_COMMAND_OK) { ++ if( !pgres || PQresultStatus(pgres)!=PGRES_COMMAND_OK) { + return(-1); + } + #endif +@@ -445,11 +445,11 @@ + #endif + + #ifdef ENABLE_SQL_LOGGING +- qnprintf( sqlBufUpdate, SQL_BUF_SIZE, ++ qnprintf( SqlBufUpdate, SQL_BUF_SIZE, + "delete from vlog where domain = '%s' and user='%s'", + domain, user ); + pgres=PQexec(pgc, SqlBufUpdate); +- if( !pgres || PGresultStatus(pgres)!=PGRES_COMMAND_OK) { ++ if( !pgres || PQresultStatus(pgres)!=PGRES_COMMAND_OK) { + err = -1; + } + #endif +@@ -1555,6 +1555,64 @@ + return valias_current->data; + } + } ++ ++char *valias_select_names( char *alias, char *domain ) ++{ ++ PGresult *pgres; ++ int err; ++ unsigned ntuples, ctuple; ++ struct linklist *temp_entry = NULL; ++ ++ /* remove old entries as necessary */ ++ while (valias_current != NULL) ++ valias_current = linklist_del (valias_current); ++ ++ if ( (err =vauth_open(0)) != 0 ) return (NULL); ++ ++ qnprintf( SqlBufRead, SQL_BUF_SIZE, ++ "select distinct alias from valias where domain = '%s' order by alias", domain); ++ if ( ! (pgres=PQexec(pgc, SqlBufRead)) ++ || PQresultStatus(pgres) != PGRES_TUPLES_OK ) { ++ if(pgres) PQclear(pgres); ++ vcreate_valias_table(); ++ if ( ! (pgres=PQexec(pgc, SqlBufRead)) ++ || PQresultStatus(pgres) != PGRES_TUPLES_OK ) { ++ fprintf(stderr,"vpgsql: sql error[o]: %s\n", ++ PQerrorMessage(pgc)); ++ if (pgres) PQclear (pgres); ++ return(NULL); ++ } ++ } ++ ntuples = PQntuples (pgres); ++ for (ctuple = 0; ctuple < ntuples; ctuple++) { ++ temp_entry = linklist_add (temp_entry, PQgetvalue (pgres, ctuple, 1), PQgetvalue (pgres, ctuple, 0)); ++ if (valias_current == NULL) valias_current = temp_entry; ++ } ++ PQclear (pgres); ++ pgres = NULL; ++ ++ if (valias_current == NULL) return NULL; /* no results */ ++ else { ++ strcpy (alias, valias_current->d2); ++ return(valias_current->data); ++ } ++} ++ ++char *valias_select_names_next(char *alias) ++{ ++ if (valias_current == NULL) return NULL; ++ valias_current = linklist_del (valias_current); ++ ++ if (valias_current == NULL) return NULL; /* no results */ ++ else { ++ strcpy(alias, valias_current->d2); ++ return(valias_current->data); ++ } ++} ++ ++void valias_select_names_end() { ++ // not needed with PostgreSQL ++} + #endif + + #ifdef ENABLE_SQL_LOGGING diff --git a/net-mail/vpopmail/metadata.xml b/net-mail/vpopmail/metadata.xml new file mode 100644 index 000000000000..ee267c81e3d9 --- /dev/null +++ b/net-mail/vpopmail/metadata.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>net-mail@gentoo.org</email> + <name>Net-Mail</name> + </maintainer> + <use> + <flag name="clearpasswd">Enables cleartext password storage in the + vpasswd files</flag> + <flag name="ipalias">Enables enable-ip-alias-domains</flag> + <flag name="maildrop">Enables <pkg>mail-filter/maildrop</pkg> support + in vdelivermail</flag> + <flag name="spamassassin">Enables <pkg>mail-filter/spamassassin</pkg> + support</flag> + </use> + <upstream> + <remote-id type="sourceforge">vpopmail</remote-id> + </upstream> +</pkgmetadata> diff --git a/net-mail/vpopmail/vpopmail-5.4.33-r1.ebuild b/net-mail/vpopmail/vpopmail-5.4.33-r1.ebuild new file mode 100644 index 000000000000..ecc09b21af25 --- /dev/null +++ b/net-mail/vpopmail/vpopmail-5.4.33-r1.ebuild @@ -0,0 +1,251 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +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" +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="virtual/qmail + maildrop? ( mail-filter/maildrop ) + mysql? ( virtual/mysql ) + postgres? ( dev-db/postgresql[server] ) + spamassassin? ( mail-filter/spamassassin )" +RDEPEND="${DEPEND}" + +# 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." + VPOP_HOME="${VPOP_DEFAULT_HOME}" + else + einfo "Setting VPOP_HOME to: $VPOP_HOME" + fi +} + +pkg_setup() { + enewgroup vpopmail 89 + enewuser vpopmail 89 -1 ${VPOP_DEFAULT_HOME} vpopmail + upgradewarning +} + +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 + + 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 + mysqlinc=$(mysql_config --include) + authopts="--enable-incdir=${mysqlinc#-I}" + authopts+=" --enable-auth-module=mysql" + authopts+=" --enable-libdir=/usr/$(get_libdir)/mysql" + authopts+=" --enable-sql-logging" + authopts+=" --enable-valias" + authopts+=" --disable-mysql-replication" + authopts+=" --enable-mysql-limits" + elif use postgres; then + pglibdir=$(pg_config --libdir) + authopts+=" --enable-auth-module=pgsql" + authopts+=" --enable-libdir=${pglibdir}" + 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 + + 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 + + # 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 + + sed -e '12d' -i "${D}"/etc/vpopmail.conf + 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 + + 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 + chown root:vpopmail /etc/vpopmail.conf + 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:" + elog + elog 'ALTER TABLE `dir_control` CHANGE `domain` `domain` CHAR(96) NOT NULL;' + elog 'ALTER TABLE `ip_alias_map` CHANGE domain domain CHAR(96) NOT NULL;' + elog 'ALTER TABLE `lastauth` CHANGE domain domain CHAR(96) NOT NULL;' + elog 'ALTER TABLE `valias` CHANGE domain domain CHAR(96) NOT NULL;' + elog 'ALTER TABLE `vlog` CHANGE domain domain CHAR(96) NOT NULL;' + elog 'ALTER TABLE `vpopmail` CHANGE domain domain CHAR(96) NOT NULL;' + elog 'ALTER TABLE `limits` CHANGE domain domain CHAR(96) NOT NULL,' + elog ' ADD `disable_spamassassin` TINYINT(1) DEFAULT '0' NOT NULL AFTER `disable_smtp`,' + elog ' ADD `delete_spam` TINYINT(1) DEFAULT '0' NOT NULL AFTER `disable_spamassassin`;' + 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 +} diff --git a/net-mail/vpopmail/vpopmail-5.4.33.ebuild b/net-mail/vpopmail/vpopmail-5.4.33.ebuild new file mode 100644 index 000000000000..0084ce003a76 --- /dev/null +++ b/net-mail/vpopmail/vpopmail-5.4.33.ebuild @@ -0,0 +1,240 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +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" +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 spamassassin" + +DEPEND="virtual/qmail + maildrop? ( mail-filter/maildrop ) + mysql? ( virtual/mysql ) + spamassassin? ( mail-filter/spamassassin )" +RDEPEND="${DEPEND}" + +# 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." + VPOP_HOME="${VPOP_DEFAULT_HOME}" + else + einfo "Setting VPOP_HOME to: $VPOP_HOME" + fi +} + +pkg_setup() { + enewgroup vpopmail 89 + enewuser vpopmail 89 -1 ${VPOP_DEFAULT_HOME} vpopmail + upgradewarning +} + +src_prepare() { + epatch "${FILESDIR}"/${PN}-5.4.9-access.violation.patch + epatch "${FILESDIR}"/${PN}-lazy.patch + epatch "${FILESDIR}"/${PN}-double-free.patch + + # 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 + authopts="$(mysql_config --include)" + authopts="--enable-incdir=${authopts#-I}" + authopts+=" --enable-auth-module=mysql" + authopts+=" --enable-libdir=/usr/$(get_libdir)/mysql" + authopts+=" --enable-sql-logging" + authopts+=" --enable-valias" + authopts+=" --disable-mysql-replication" + authopts+=" --enable-mysql-limits" + 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 + + # bug #277764 + emake -j1 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 + + 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 + + # 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 + + sed -e '12d' -i "${D}"/etc/vpopmail.conf + 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 + + einfo "Installing env.d entry" + dodir /etc/env.d + doenvd "${FILESDIR}"/99vpopmail + + einfo "Locking down vpopmail permissions" + fowners root:0 -R "${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 + chown root:vpopmail /etc/vpopmail.conf + 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:" + elog + elog 'ALTER TABLE `dir_control` CHANGE `domain` `domain` CHAR(96) NOT NULL;' + elog 'ALTER TABLE `ip_alias_map` CHANGE domain domain CHAR(96) NOT NULL;' + elog 'ALTER TABLE `lastauth` CHANGE domain domain CHAR(96) NOT NULL;' + elog 'ALTER TABLE `valias` CHANGE domain domain CHAR(96) NOT NULL;' + elog 'ALTER TABLE `vlog` CHANGE domain domain CHAR(96) NOT NULL;' + elog 'ALTER TABLE `vpopmail` CHANGE domain domain CHAR(96) NOT NULL;' + elog 'ALTER TABLE `limits` CHANGE domain domain CHAR(96) NOT NULL,' + elog ' ADD `disable_spamassassin` TINYINT(1) DEFAULT '0' NOT NULL AFTER `disable_smtp`,' + elog ' ADD `delete_spam` TINYINT(1) DEFAULT '0' NOT NULL AFTER `disable_spamassassin`;' + 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 +} |