summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Scherbaum <dertobi123@gentoo.org>2008-09-05 20:29:40 +0000
committerTobias Scherbaum <dertobi123@gentoo.org>2008-09-05 20:29:40 +0000
commit55494b41ba1b607bc8fba4f25f08faafc7d1f4eb (patch)
tree93ecbc2ff8bde1e40d576837132494f01a3f3dcd /mail-mta
parentDrop app-admin/eselect-compiler dependency to make Mr_Bones_ happy. (diff)
downloadgentoo-2-55494b41ba1b607bc8fba4f25f08faafc7d1f4eb.tar.gz
gentoo-2-55494b41ba1b607bc8fba4f25f08faafc7d1f4eb.tar.bz2
gentoo-2-55494b41ba1b607bc8fba4f25f08faafc7d1f4eb.zip
Allow to specify the last used system user id via +maxsysuid, #231866, patch by Trevor Bowen
(Portage version: 2.2_rc8/cvs/Linux 2.6.25-gentoo-r7 x86_64)
Diffstat (limited to 'mail-mta')
-rw-r--r--mail-mta/ssmtp/ChangeLog10
-rw-r--r--mail-mta/ssmtp/files/ssmtp-2.62-maxsysuid-conf.patch17
-rw-r--r--mail-mta/ssmtp/files/ssmtp-2.62-maxsysuid.patch37
-rw-r--r--mail-mta/ssmtp/metadata.xml1
-rw-r--r--mail-mta/ssmtp/ssmtp-2.62-r2.ebuild100
5 files changed, 164 insertions, 1 deletions
diff --git a/mail-mta/ssmtp/ChangeLog b/mail-mta/ssmtp/ChangeLog
index 63b97a3ed46f..4bbbba8e7293 100644
--- a/mail-mta/ssmtp/ChangeLog
+++ b/mail-mta/ssmtp/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for mail-mta/ssmtp
# Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/mail-mta/ssmtp/ChangeLog,v 1.55 2008/08/23 02:02:28 cardoe Exp $
+# $Header: /var/cvsroot/gentoo-x86/mail-mta/ssmtp/ChangeLog,v 1.56 2008/09/05 20:29:40 dertobi123 Exp $
+
+*ssmtp-2.62-r2 (05 Sep 2008)
+
+ 05 Sep 2008; Tobias Scherbaum <dertobi123@gentoo.org>
+ +files/ssmtp-2.62-maxsysuid.patch, +files/ssmtp-2.62-maxsysuid-conf.patch,
+ metadata.xml, +ssmtp-2.62-r2.ebuild:
+ Allow to specify the last used system user id via +maxsysuid, #231866, patch
+ by Trevor Bowen
23 Aug 2008; Doug Goldstein <cardoe@gentoo.org> metadata.xml:
add GLEP 56 USE flag desc from use.local.desc
diff --git a/mail-mta/ssmtp/files/ssmtp-2.62-maxsysuid-conf.patch b/mail-mta/ssmtp/files/ssmtp-2.62-maxsysuid-conf.patch
new file mode 100644
index 000000000000..8e51c5e3c3e4
--- /dev/null
+++ b/mail-mta/ssmtp/files/ssmtp-2.62-maxsysuid-conf.patch
@@ -0,0 +1,17 @@
+--- ssmtp.orig.conf 2004-07-23 00:58:48.000000000 -0500
++++ ssmtp.conf 2008-07-14 14:11:34.000000000 -0500
+@@ -2,10 +2,13 @@
+ # /etc/ssmtp.conf -- a config file for sSMTP sendmail.
+ #
+
+-# The person who gets all mail for userids < 1000
++# The person who gets all mail for userids < MinUserId
+ # Make this empty to disable rewriting.
+ root=postmaster
+
++# All mail delivered to userid >= MinUserId goes to user, not root.
++#MinUserId=1000
++
+ # The place where the mail goes. The actual machine name is required
+ # no MX records are consulted. Commonly mailhosts are named mail.domain.com
+ # The example will fit if you are in domain.com and your mailhub is so named.
diff --git a/mail-mta/ssmtp/files/ssmtp-2.62-maxsysuid.patch b/mail-mta/ssmtp/files/ssmtp-2.62-maxsysuid.patch
new file mode 100644
index 000000000000..fef53c4116b5
--- /dev/null
+++ b/mail-mta/ssmtp/files/ssmtp-2.62-maxsysuid.patch
@@ -0,0 +1,37 @@
+--- ssmtp.orig.c 2004-07-23 00:58:48.000000000 -0500
++++ ssmtp.c 2008-07-14 16:03:08.000000000 -0500
+@@ -76,6 +76,7 @@ int log_level = 1;
+ #else
+ int log_level = 0;
+ #endif
++int minuserid = MAXSYSUID+1;
+ int port = 25;
+ #ifdef INET6
+ int p_family = PF_UNSPEC; /* Protocol family used in SMTP connection */
+@@ -641,7 +642,7 @@ char *rcpt_remap(char *str)
+ {
+ struct passwd *pw;
+ if((root==NULL) || strlen(root)==0 || strchr(str, '@') ||
+- ((pw = getpwnam(str)) == NULL) || (pw->pw_uid > MAXSYSUID)) {
++ ((pw = getpwnam(str)) == NULL) || (pw->pw_uid >= minuserid)) {
+ return(append_domain(str)); /* It's not a local systems-level user */
+ }
+ else {
+@@ -814,6 +815,17 @@ bool_t read_config()
+ log_event(LOG_INFO, "Set Root=\"%s\"\n", root);
+ }
+ }
++ else if(strcasecmp(p, "MinUserId") == 0) {
++ if((r = strdup(q)) == (char *)NULL) {
++ die("parse_config() -- strdup() failed");
++ }
++
++ minuserid = atoi(r);
++
++ if(log_level > 0) {
++ log_event(LOG_INFO, "Set MinUserId=\"%d\"\n", minuserid);
++ }
++ }
+ else if(strcasecmp(p, "MailHub") == 0) {
+ if((mailhost = strdup(q)) == (char *)NULL) {
+ die("parse_config() -- strdup() failed");
diff --git a/mail-mta/ssmtp/metadata.xml b/mail-mta/ssmtp/metadata.xml
index 5b418a381d1e..1cd964960caa 100644
--- a/mail-mta/ssmtp/metadata.xml
+++ b/mail-mta/ssmtp/metadata.xml
@@ -4,5 +4,6 @@
<herd>net-mail</herd>
<use>
<flag name='md5sum'>Enables MD5 summing for ssmtp</flag>
+ <flag name='maxsysuid'>Allow to define a MinUserId</flag>
</use>
</pkgmetadata>
diff --git a/mail-mta/ssmtp/ssmtp-2.62-r2.ebuild b/mail-mta/ssmtp/ssmtp-2.62-r2.ebuild
new file mode 100644
index 000000000000..2a6edbc2c17c
--- /dev/null
+++ b/mail-mta/ssmtp/ssmtp-2.62-r2.ebuild
@@ -0,0 +1,100 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/mail-mta/ssmtp/ssmtp-2.62-r2.ebuild,v 1.1 2008/09/05 20:29:40 dertobi123 Exp $
+
+inherit eutils toolchain-funcs autotools
+
+DESCRIPTION="Extremely simple MTA to get mail off the system to a Mailhub"
+HOMEPAGE="ftp://ftp.debian.org/debian/pool/main/s/ssmtp/"
+SRC_URI="mirror://debian/pool/main/s/ssmtp/${P/-/_}.orig.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
+IUSE="ssl ipv6 md5sum"
+
+DEPEND="ssl? ( dev-libs/openssl )"
+RDEPEND="${DEPEND}
+ !net-mail/mailwrapper
+ !virtual/mta"
+PROVIDE="virtual/mta"
+
+S="${WORKDIR}/${PN}"
+
+pkg_setup() {
+ enewgroup ssmtp
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ # Allow to specify the last used system user id, bug #231866
+ if use maxsysuid; then
+ epatch "${FILESDIR}"/${P}-maxsysuid.patch
+ epatch "${FILESDIR}"/${P}-maxsysuid-conf.patch
+ fi
+
+ epatch "${FILESDIR}/${P}-strndup.patch"
+ eautoreconf
+
+ # Respect LDFLAGS (bug #152197)
+ sed -i -e 's:$(CC) -o:$(CC) @LDFLAGS@ -o:' Makefile.in
+}
+
+src_compile() {
+ tc-export CC LD
+
+ econf \
+ --sysconfdir=/etc/ssmtp \
+ $(use_enable ssl) \
+ $(use_enable ipv6 inet6) \
+ $(use_enable md5sum md5auth) \
+ || die
+ make clean || die
+ make etcdir=/etc || die
+}
+
+src_install() {
+ dodir /usr/bin /usr/sbin /usr/lib
+ dosbin ssmtp || die
+ fperms 755 /usr/sbin/ssmtp
+
+ doman ssmtp.8
+ dodoc INSTALL README TLS CHANGELOG_OLD
+ newdoc ssmtp.lsm DESC
+
+ insinto /etc/ssmtp
+ doins ssmtp.conf revaliases
+
+ local conffile="${D}etc/ssmtp/ssmtp.conf"
+
+ mv "${conffile}" "${conffile}.orig"
+
+ # Sorry about the weird indentation, I couldn't figure out a cleverer way
+ # to do this without having horribly >80 char lines.
+ sed -e "s:^hostname=:\n# Gentoo bug #47562\\
+# Commenting the following line will force ssmtp to figure\\
+# out the hostname itself.\n\\
+# hostname=:" \
+ "${conffile}.orig" > "${conffile}" \
+ || die "sed failed"
+
+ rm "${conffile}.orig" || die "Failed to remove temporary created copy of ssmtp.conf"
+
+ # Set restrictive perms on ssmtp.conf as per #187841
+ # Protect the ssmtp configfile from being readable by regular users as it
+ # may contain login/password data to auth against a the mailhub used, add
+ # users to the ssmtp group to enable them to use ssmtp.
+ fowners root:ssmtp /etc/ssmtp/ssmtp.conf
+ fperms 640 /etc/ssmtp/ssmtp.conf
+
+ fowners root:ssmtp /usr/sbin/ssmtp
+ fperms 750 /usr/sbin/ssmtp
+
+ dosym /usr/sbin/ssmtp /usr/lib/sendmail
+ dosym /usr/sbin/ssmtp /usr/bin/sendmail
+ dosym /usr/sbin/ssmtp /usr/sbin/sendmail
+ dosym /usr/sbin/ssmtp /usr/bin/mailq
+ dosym /usr/sbin/ssmtp /usr/bin/newaliases
+}