rpms/ssmtp/devel ssmtp-2.50.3-maxsysuid.patch, NONE, 1.1 ssmtp-2.61.6.patch, NONE, 1.1 ssmtp.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Manuel Wolfshant (wolfy) fedora-extras-commits at redhat.com
Sun Nov 12 23:12:21 UTC 2006


Author: wolfy

Update of /cvs/extras/rpms/ssmtp/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv29642/devel

Modified Files:
	.cvsignore sources 
Added Files:
	ssmtp-2.50.3-maxsysuid.patch ssmtp-2.61.6.patch ssmtp.spec 
Log Message:
auto-import ssmtp-2.61-8 on branch devel from ssmtp-2.61-8.src.rpm

ssmtp-2.50.3-maxsysuid.patch:

--- NEW FILE ssmtp-2.50.3-maxsysuid.patch ---
--- ssmtp-2.48/ssmtp.horig	Sun Feb 10 22:32:34 2002
+++ ssmtp-2.48/ssmtp.h	Mon Feb 25 13:39:44 2002
@@ -14,7 +14,7 @@
 #define MAXWAIT (10 * 60)	/* Maximum wait between commands, in seconds */
 #define MEDWAIT (5 * 60)
 
-#define MAXSYSUID 999		/* Highest UID which is a system account */
+#define MAXSYSUID 499		/* Highest UID which is a system account */
 
 #ifndef _POSIX_ARG_MAX
 #define MAXARGS 4096
--- ssmtp-2.48/ssmtp.conf.orig	Tue May  8 14:22:08 2001
+++ ssmtp-2.48/ssmtp.conf	Mon Feb 25 13:42:41 2002
@@ -2,7 +2,7 @@
 # /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 < 500
 # Make this empty to disable rewriting.
 root=postmaster

ssmtp-2.61.6.patch:

--- NEW FILE ssmtp-2.61.6.patch ---
--- ssmtp-2.61.orig/configure
+++ ssmtp-2.61/configure
@@ -743,7 +743,7 @@
   CFLAGS="$ac_save_CFLAGS"
 elif test $ac_cv_prog_cc_g = yes; then
   if test "$GCC" = yes; then
-    CFLAGS="-g -O2"
+    CFLAGS="-g -O2 -Wall"
   else
     CFLAGS="-g"
   fi
--- ssmtp-2.61.orig/ssmtp.conf
+++ ssmtp-2.61/ssmtp.conf
@@ -36,3 +36,8 @@
 
 # Use this RSA certificate.
 #TLSCert=/etc/ssl/certs/ssmtp.pem
+
+# Get enhanced (*really* enhanced) debugging information in the logs
+# If you want to have debugging of the config file parsing, move this option
+# to the top of the config file and uncomment
+#Debug=YES
--- ssmtp-2.61.orig/ssmtp.8
+++ ssmtp-2.61/ssmtp.8
@@ -1,4 +1,4 @@
-.TH SSMTP 8 "Last change: 5 February 2000"
+.TH SSMTP 8 "Last change: 4 February 2005"
 .SH NAME
 ssmtp, sendmail \- send a message using smtp
 .SH SYNOPSIS
@@ -103,7 +103,7 @@
 
 .TP
 \fB\-C\fP\fIfile\fP 
-(ignored) Use alternate configuration file.
+Use alternate configuration file.
 
 .TP
 \fB\-d\fP\fIX\fP
@@ -273,7 +273,7 @@
  /etc/ssmtp/revaliases - reverse aliases file
 
 .SH SEE ALSO
-RFC821, RFC822.
+RFC821, RFC822, ssmtp.conf(5).
 
 .SH AUTHORS
 Matt Ryan (mryan at debian.org)
--- ssmtp-2.61.orig/ssmtp.c
+++ ssmtp-2.61/ssmtp.c
@@ -12,7 +12,8 @@
  See COPYRIGHT for the license
 
 */
-#define VERSION "2.60.4"
+#define VERSION "2.61"
+#define _GNU_SOURCE
 
 #include <sys/socket.h>
 #include <netinet/in.h>
@@ -37,7 +38,8 @@
 #include "md5auth/hmac_md5.h"
 #endif
 #include "ssmtp.h"
-
+#include <fcntl.h>
+#include "xgethostname.h"
 
 bool_t have_date = False;
 bool_t have_from = False;
@@ -51,6 +53,7 @@
 bool_t use_tls = False;			/* Use SSL to transfer mail to HUB */
 bool_t use_starttls = False;		/* SSL only after STARTTLS (RFC2487) */
 bool_t use_cert = False;		/* Use a certificate to transfer SSL mail */
+bool_t use_oldauth = False;		/* use old AUTH LOGIN username style */
 
 #define ARPADATE_LENGTH 32		/* Current date in RFC format */
 char arpadate[ARPADATE_LENGTH];
@@ -59,7 +62,7 @@
 char *auth_method = (char)NULL;		/* Mechanism for SMTP authentication */
 char *mail_domain = (char)NULL;
 char *from = (char)NULL;		/* Use this as the From: address */
-char hostname[MAXHOSTNAMELEN] = "localhost";
+char *hostname;
 char *mailhost = "mailhub";
 char *minus_f = (char)NULL;
 char *minus_F = (char)NULL;
@@ -68,6 +71,7 @@
 char *root = NULL;
 char *tls_cert = "/etc/ssl/certs/ssmtp.pem";	/* Default Certificate */
 char *uad = (char)NULL;
+char *config_file = (char)NULL;		/* alternate configuration file */
 
 headers_t headers, *ht;
 
@@ -93,6 +97,7 @@
 static char hextab[]="0123456789abcdef";
 #endif
 
+ssize_t outbytes;
 
 /*
 log_event() -- Write event to syslog (or log file if defined)
@@ -129,7 +134,7 @@
 #endif
 }
 
-void smtp_write(int fd, char *format, ...);
+ssize_t smtp_write(int fd, char *format, ...);
 int smtp_read(int fd, char *response);
 int smtp_read_all(int fd, char *response);
 int smtp_okay(int fd, char *response);
@@ -139,7 +144,8 @@
 */
 void dead_letter(void)
 {
-	char path[(MAXPATHLEN + 1)], buf[(BUF_SZ + 1)];
+	char *path;
+	char buf[(BUF_SZ + 1)];
 	struct passwd *pw;
 	uid_t uid;
 	FILE *fp;
@@ -150,7 +156,7 @@
 	if(isatty(fileno(stdin))) {
 		if(log_level > 0) {
 			log_event(LOG_ERR,
-				"stdin is a TTY - not saving to %s/dead.letter, pw->pw_dir");
+				"stdin is a TTY - not saving to %s/dead.letter", pw->pw_dir);
 		}
 		return;
 	}
@@ -163,16 +169,21 @@
 		return;
 	}
 
-	if(snprintf(path, BUF_SZ, "%s/dead.letter", pw->pw_dir) == -1) {
+#define DEAD_LETTER "/dead.letter"
+	path = malloc (strlen (pw->pw_dir) + sizeof (DEAD_LETTER));
+	if (!path) {
 		/* Can't use die() here since dead_letter() is called from die() */
 		exit(1);
 	}
-
+	memcpy (path, pw->pw_dir, strlen (pw->pw_dir));
+	memcpy (path + strlen (pw->pw_dir), DEAD_LETTER, sizeof (DEAD_LETTER));
+	
 	if((fp = fopen(path, "a")) == (FILE *)NULL) {
 		/* Perhaps the person doesn't have a homedir... */
 		if(log_level > 0) {
 			log_event(LOG_ERR, "Can't open %s failing horribly!", path);
 		}
+		free(path);
 		return;
 	}
 
@@ -189,6 +200,7 @@
 				"Can't close %s/dead.letter, possibly truncated", pw->pw_dir);
 		}
 	}
+	free(path);
 }
 
 /*
@@ -212,27 +224,22 @@
 	exit(1);
 }
 
+#ifndef _GNU_SOURCE
 /*
 basename() -- Return last element of path
 */
 char *basename(char *str)
 {
-	char buf[MAXPATHLEN +1], *p;
+	char *p;
 
-	if((p = strrchr(str, '/'))) {
-		if(strncpy(buf, ++p, MAXPATHLEN) == (char *)NULL) {
-			die("basename() -- strncpy() failed");
-		}
+	p = strrchr(str, '/');
+	if (!p) {
+		p = str;
 	}
-	else {
-		if(strncpy(buf, str, MAXPATHLEN) == (char *)NULL) {
-			die("basename() -- strncpy() failed");
-		}
-	}
-	buf[MAXPATHLEN] = (char)NULL;
 
-	return(strdup(buf));
+	return(strdup(p));
 }
+#endif /* _GNU_SOURCE */
 
 /*
 strip_pre_ws() -- Return pointer to first non-whitespace character
@@ -778,10 +785,69 @@
[...2899 lines suppressed...]
+
+# Program End
+exit 0
--- ssmtp-2.61.orig/debian/copyright
+++ ssmtp-2.61/debian/copyright
@@ -0,0 +1,17 @@
+This package is now maintained by Anibal Monsalve Salazar <anibal at debian.org>
+and co-maintained by Santiago Ruano Rincon <santiago at unicauca.edu.co>.
+
+This package was maintained by Matt Ryan.
+
+This package was maintained by Hugo Haas.
+and was put under the GPL in version 2.1.
+Version 2.1 was maintained by Christophe Lameter.
+
+Versions up to version 2.0 were maintained by  David Collier-Brown
+and available as "Public Domain" (whatever that means).
+
+You should have received a copy of the GNU General Public License with
+your Debian GNU/Linux system, in /usr/share/common-licenses/GPL, or with
+the ssmtp source package as the file COPYING.  If not, write to the Free
+Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA.
--- ssmtp-2.61.orig/debian/preinst
+++ ssmtp-2.61/debian/preinst
@@ -0,0 +1,22 @@
+#!/bin/sh -e
+#
+# $Id: preinst,v 1.4 2001/03/21 20:29:27 matt Exp $
+#
+
+if test -s /etc/ssmtp.conf
+then
+	echo "Configuration files found in /etc, moving them to /etc/ssmtp"
+
+	mkdir /etc/ssmtp 2>/dev/null || true
+	mv -f /etc/ssmtp.conf /etc/ssmtp 2>/dev/null || true
+
+fi
+
+if test -s /etc/revaliases
+then
+	mkdir /etc/ssmtp 2>/dev/null || true
+	mv -f /etc/revaliases /etc/ssmtp 2>/dev/null || true
+fi
+
+# Program End
+exit 0
--- ssmtp-2.61.orig/debian/logcheck.server
+++ ssmtp-2.61/debian/logcheck.server
@@ -0,0 +1 @@
+^\w{3} [ :0-9]{11} [._[:alnum:]-]+ sSMTP\[[0-9]+\]: Sent mail for .* \([0-9]+ Bye\) uid=[0-9]+ username=[\._[:alnum:]-]+ outbytes=[0-9]+$
--- ssmtp-2.61.orig/debian/templates
+++ ssmtp-2.61/debian/templates
@@ -0,0 +1,61 @@
+Template: ssmtp/overwriteconfig
+Type: boolean
+Default: true
+_Description: Automatically overwrite config files?
+ The mail configuration file /etc/ssmtp/ssmtp.conf can be automatically
+ updated on each upgrade with the information supplied to the debconf
+ database. If you do not want this to happen (ie/ you want to maintain
+ control of this file yourself) then set this option to have the program
+ never touch this file.
+
+Template: ssmtp/root
+Type: string
+Default: postmaster
+_Description: Who gets mail for userids < 1000?
+ Mail sent to a local user whose UID is less than 1000 will instead be
+ sent here. This is useful for daemons which mail reports to root and
+ other system UIDs.
+ Make this empty to disable rewriting.
+
+Template: ssmtp/mailhub
+Type: string
+Default: mail
+_Description: Name of your mailhub?
+ This sets the host to which mail is delivered. The actual machine
+ name is required; no MX records are consulted. Commonly, mailhosts
+ are named "mail.domain.com".
+
+Template: ssmtp/port
+Type: string
+Default: 25
+_Description: Remote SMTP port number
+ If your remote SMTP server listens on a port other than 25 (Standard/RFC)
+ then set it here.
+
+Template: ssmtp/rewritedomain
+Type: string
+_Description: What domain to masquerade as?
+ ssmtp will use "username at REWRITEDOMAIN" as the default From: address
+ for outgoing mail which contains only a local username.
+
+Template: ssmtp/mailname
+Type: string
+_Description: What name to store in /etc/mailname
+ This is the portion of the address after the '@' sign to be shown on
+ outgoing news and mail messages.
+
+Template: ssmtp/hostname
+Type: string
+_Description: Fully qualified hostname?
+ This should specify the real hostname of this machine, and will be
+ sent to the mailhub when delivering mail.
+
+Template: ssmtp/fromoverride
+Type: boolean
+Default: false
+_Description: Allow override of From: line in email header?
+ A "positive" response will permit local users to enter any From: line
+ in their messages without it being mangled, and cause ssmtp to rewrite
+ the envelope header with that address. A "negative" response will
+ disallow this, and use only the default address or addresses set in
+ /etc/ssmtp/revaliases.
--- ssmtp-2.61.orig/ssmtp.conf.5
+++ ssmtp-2.61/ssmtp.conf.5
@@ -0,0 +1,81 @@
+.\"/* Copyright 2004 Reuben Thomas
+.\" * All rights reserved
+.\" *
+.\" This man page is distributed under the GNU General Public License
+.\" version 2, or at your option, any later version. There is no warranty.
+.\"
+.Dd October 7, 2004
+.Dt SSMTP.CONF 5
+.Os
+.Sh NAME
+.Nm ssmtp.conf
+.Nd ssmtp configuration file
+.Sh DESCRIPTION
+.Nm ssmtp
+reads configuration data from
+.Pa /etc/ssmtp/ssmtp.conf
+The file contains keyword-argument pairs, one per line.
+Lines starting with
+.Ql #
+and empty lines are interpreted as comments.
+.Pp
+The possible keywords and their meanings are as follows (both are case-insensitive):
+.Bl -tag -width Ds
+.It Cm Root
+The user that gets all mail for userids less than 1000. If blank, address rewriting is disabled.
+.Pp
+.It Cm Mailhub
+The host to send mail to, in the form
+.Ar host No | Ar IP_addr No Oo : Ar port Oc .
+The default port is 25.
+.Pp
+.It Cm RewriteDomain
+The domain from which mail seems to come.
+for user authentication.
+.Pp
+.It Cm Hostname
+The full qualified name of the host.
+If not specified, the host is queried for its hostname.
+.Pp
+.It Cm FromLineOverride
+Specifies whether the From header of an email, if any, may override the default domain.
+The default is
+.Dq no .
+.Pp
+.It Cm UseTLS
+Specifies whether ssmtp uses TLS to talk to the SMTP server.
+The default is
+.Dq no .
+.Pp
+.It Cm UseSTARTTLS
+Specifies whether ssmtp does a EHLO/STARTTLS before starting SSL negotiation.
+See RFC 2487.
+.Pp
+.It Cm TLSCert
+The file name of an RSA certificate to use for TLS, if required.
+.Pp
+.It Cm AuthUser
+The user name to use for SMTP AUTH.
+The default is blank, in which case SMTP AUTH is not used.
+sent without
+.Pp
+.It Cm AuthPass
+The password to use for SMTP AUTH.
+.Pp
+.It Cm AuthMethod
+The authorization method to use.
+If unset, plain text is used.
+May also be set to
+.Dq cram-md5 .
+.Sh FILES
+.Bl -tag -width Ds
+.It Pa /etc/ssmtp/ssmtp.conf
+Contains configuration data for
+.Nm ssmtp .
+.El
+.Sh SEE ALSO
+.Xr ssmtp 8
+.Sh AUTHORS
+Matt Ryan (mryan at debian.org), Hugo Haas (hugo at debian.org), Christoph Lameter (clameter at debian.org)
+and Dave Collier-Brown (davecb at hobbes.ss.org).
+Reuben Thomas (rrt at sc3d.org) wrote the man page.


--- NEW FILE ssmtp.spec ---
Name:		ssmtp
Version:	2.61
Release:	8%{?dist}
Summary:	Extremely simple MTA to get mail off the system to a Mailhub
Group:		Applications/Internet
License:	GPL
URL:		http://packages.debian.org/stable/mail/ssmtp.html
Source0:	ftp://ftp.debian.org/debian/pool/main/s/%{name}/%{name}_%{version}.orig.tar.gz
#Patch0		http://ftp.debian.org/debian/pool/main/s/ssmtp/ssmtp_2.61-9.diff.gz
Patch0:		%{name}-%{version}.6.patch
Patch1:		%{name}-2.50.3-maxsysuid.patch
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Provides:	MTA smtpdaemon %{_sbindir}/sendmail 
Requires(post):	%{_sbindir}/alternatives
Requires(preun):	%{_sbindir}/alternatives
BuildRequires:	openssl-devel


%description
A secure, effective and simple way of getting mail off a system to your mail
hub. It contains no suid-binaries or other dangerous things - no mail spool
to poke around in, and no daemons running in the background. Mail is simply
forwarded to the configured mailhost. Extremely easy configuration.

WARNING: the above is all it does; it does not receive mail, expand aliases
or manage a queue. That belongs on a mail hub with a system administrator.


%prep
%setup -q
%patch -p1
%patch1 -p1


%build
#on RHEL3 krb5 is somewhere else
#test -e /usr/include/krb5.h || CPPFLAGS="-I/usr/kerberos/include"
#CPPFLAGS=$(pkg-config --cflags-only-I openssl)
%if "0%{?dist}" == "0el3" 
	%define cppflags -I/usr/kerberos/include
%endif
%configure --enable-ssl --enable-md5auth --enable-inet6
%if "0%{?dist}" == "0el3" 
	make %{?_smp_mflags} CPPFLAGS=%{cppflags}
%else
	make %{?_smp_mflags}
%endif
%install 
rm -rf %{buildroot}
install -p -D -m 755 %{name} %{buildroot}%{_sbindir}/%{name}
#install -p -D -m 755 generate_config_alt %{buildroot}%{_bindir}/generate_config_alt
mkdir %{buildroot}%{_bindir}/
install -p -D -m 644 revaliases %{buildroot}%{_sysconfdir}/ssmtp/revaliases
install -p -m 644 ssmtp.conf %{buildroot}%{_sysconfdir}/ssmtp/ssmtp.conf
install -p -D -m 644 ssmtp.8 %{buildroot}%{_mandir}/man8/ssmtp.8
install -p -D -m 644 debian/mailq.8 %{buildroot}%{_mandir}/man1/mailq.ssmtp.1
install -p -m 644 debian/newaliases.8 %{buildroot}%{_mandir}/man1/newaliases.ssmtp.1
install -p -D -m 644 ssmtp.conf.5 %{buildroot}%{_mandir}/man5/ssmtp.conf.5
ln -s %{_sbindir}/%{name} %{buildroot}%{_sbindir}/sendmail.ssmtp
ln -s %{_sbindir}/%{name} %{buildroot}%{_bindir}/newaliases.ssmtp
ln -s %{_sbindir}/%{name} %{buildroot}%{_bindir}/mailq.ssmtp


%clean
rm -rf %{buildroot}

%post
%{_sbindir}/alternatives  --install %{_sbindir}/sendmail mta %{_sbindir}/sendmail.ssmtp 30 \
	--slave %{_bindir}/mailq mta-mailq %{_bindir}/mailq.ssmtp \
	--slave %{_bindir}/newaliases mta-newaliases %{_bindir}/newaliases.ssmtp \
	--slave %{_mandir}/man1/mailq.1.gz mta-mailqman %{_mandir}/man1/mailq.ssmtp.1.gz \
	--slave %{_mandir}/man1/newaliases.1.gz mta-newaliasesman %{_mandir}/man1/newaliases.ssmtp.1.gz \
	--slave %{_mandir}/man8/sendmail.8.gz mta-sendmailman %{_mandir}/man8/ssmtp.8.gz 


%preun
#only remove in case of erase (but not at upgrade)
if [ $1 -eq 0 ] ; then
	%{_sbindir}/alternatives --remove mta %{_sbindir}/sendmail.ssmtp
fi
exit 0

#%postun
#if [ $1 -eq 0 ] ; then
#	/usr/sbin/alternatives --auto mta
#fi
#exit 0

%files
%defattr(-,root,root,-)
%doc COPYING INSTALL README TLS CHANGELOG_OLD debian/changelog
%{_mandir}/man5/*
%{_mandir}/man8/*
%{_mandir}/man1/*
%{_sbindir}/%{name}
#%{_bindir}/generate_config_alt
%{_sbindir}/sendmail.ssmtp
%{_bindir}/newaliases.ssmtp
%{_bindir}/mailq.ssmtp
%dir %{_sysconfdir}/ssmtp/
%config(noreplace) %{_sysconfdir}/ssmtp/revaliases
%config(noreplace) %{_sysconfdir}/ssmtp/ssmtp.conf


%changelog
* Mon Oct 10 2006 lonely wolf <wolfy at pcnet.ro> 2.61-8
- enabled IPv6 (just added this option to %%configure, the capability was already there)
- removed yet another man page from %%Provides
- cosmetic fixes - consistent use of macros
- added a missing Require
- I have also included a [commented] URL to the current patch (v9) provided by Debian. Because starting with version 8 the patch modifies the SSL libraries used. I will include this modification once I can perform more tests. 

* Mon Oct 10 2006 lonely wolf <wolfy at pcnet.ro> 2.61-7
- removed man pages and stubs from %%Provides

* Fri Sep 22 2006 lonely wolf <wolfy at pcnet.ro> 2.61-6
- cosmetic fixes

* Tue Apr 11 2006 lonely wolf <wolfy at pcnet.ro> 2.61-5
- cleaner hack for RHEL 3
- added back Provides: smtpdaemon
- correct typo in Provides
 
* Tue Apr 11 2006 lonely wolf <wolfy at pcnet.ro> 2.61-4
- hack for RHEL 3 which has krb5.h in a different place
 
* Mon Apr 10 2006 lonely wolf <wolfy at pcnet.ro> 2.61-3
- removed Requires: openssl
- removed Provides: smtpdaemon
- cleaning of %%files
- correct typos in version numbers in changelog
- disabled "alternatives --auto mta" in postrun macro, pending more tests

* Sat Apr 8 2006 lonely wolf <wolfy at pcnet.ro> 2.61-2
- fix spec file: consistent use of buildroot macro, no double "ssmtp" in files' name, switch back the name of the main patch to the one used by Debian
- removed the generate_config_alt script; it is ugly, buggy and completely replaces the default provided configuration file, including the comments (which are useful)
- add openssl to requires and openssl-devel to buildrequires
- fix pre/post install scriptlets (upgrade would have removed the files from the alternatives system)
- remove two unneeded files from the alternatives call; man sendmail will default to the page provided by ssmtp

* Thu Apr 6 2006 lonely wolf <wolfy at pcnet.ro> 2.61-1
- Initial rpm version, based on Debian sources & patch
- Includes patch from Mandrake to lower the default system UIDs from 1000 to 500
- Includes generate_config_alt, a small script to generate a customized ssmtp.conf (thus overriding the default one); beware that this script will completely replace the default ssmtp.conf.
- Customized to play nice in the alternatives environment


Index: .cvsignore
===================================================================
RCS file: /cvs/extras/rpms/ssmtp/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore	12 Nov 2006 23:10:26 -0000	1.1
+++ .cvsignore	12 Nov 2006 23:11:51 -0000	1.2
@@ -0,0 +1 @@
+ssmtp_2.61.orig.tar.gz


Index: sources
===================================================================
RCS file: /cvs/extras/rpms/ssmtp/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources	12 Nov 2006 23:10:26 -0000	1.1
+++ sources	12 Nov 2006 23:11:51 -0000	1.2
@@ -0,0 +1 @@
+957e6fff08625fe34f4fc33d0925bbc9  ssmtp_2.61.orig.tar.gz




More information about the scm-commits mailing list