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/ssmtp/files
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/ssmtp/files')
-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
2 files changed, 54 insertions, 0 deletions
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");