[packages/ssmtp] Up to 2.66

arekm arekm at pld-linux.org
Thu Oct 29 09:08:24 CET 2026


commit ccaba63ea848fd362cf18168e5c57f785d304a68
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Thu Oct 29 03:02:41 2026 +0100

    Up to 2.66

 defaultvalues.patch                  |  11 ---
 ssmtp-addr-parse-bounds.patch        |  62 ++++++++++++++
 ssmtp-authpass.patch                 |  13 ---
 ssmtp-garbage_writes.patch           |  18 -----
 ssmtp-no-self-signed.patch           |  34 ++++++++
 ssmtp-nonsl.patch                    |  10 ---
 ssmtp-ssl.patch                      |  24 ------
 ssmtp-validate-TLS-server-cert.patch | 153 -----------------------------------
 ssmtp.spec                           |  30 +++----
 9 files changed, 106 insertions(+), 249 deletions(-)
---
diff --git a/ssmtp.spec b/ssmtp.spec
index 9219733..0c2c1a7 100644
--- a/ssmtp.spec
+++ b/ssmtp.spec
@@ -1,20 +1,15 @@
 Summary:	Extremely simple MTA to get mail off the system to a mail hub
 Summary(pl.UTF-8):	Skrajnie prosty MTA do przekazywania poczty z systemu do huba
 Name:		ssmtp
-Version:	2.64
-Release:	9
+Version:	2.66
+Release:	1
 License:	GPL
 Group:		Networking/Daemons/SMTP
-Source0:	http://http.us.debian.org/debian/pool/main/s/ssmtp/%{name}_%{version}.orig.tar.bz2
-# Source0-md5:	65b4e0df4934a6cd08c506cabcbe584f
-Patch0:		%{name}-nonsl.patch
-Patch1:		%{name}-ssl.patch
-Patch2:		%{name}-garbage_writes.patch
-Patch3:		%{name}-authpass.patch
-Patch4:		%{name}-validate-TLS-server-cert.patch
-Patch5:		defaultvalues.patch
-BuildRequires:	autoconf
-BuildRequires:	automake
+Source0:	https://github.com/Project-OSS-Revival/ssmtp/archive/v%{version}/%{name}-%{version}.tar.gz
+# Source0-md5:	f9894703fcc559f63cffacfea08f9b75
+Patch0:		%{name}-no-self-signed.patch
+Patch1:		%{name}-addr-parse-bounds.patch
+URL:		https://github.com/Project-OSS-Revival/ssmtp
 BuildRequires:	openssl-devel
 Requires:	%{name}-base = %{version}-%{release}
 Provides:	smtpdaemon
@@ -68,19 +63,14 @@ należy do huba pocztowego z własnym administratorem.
 %setup -q
 %patch -P0 -p1
 %patch -P1 -p1
-%patch -P2 -p1
-%patch -P3 -p1
-%patch -P4 -p1
-%patch -P5 -p1
 
 %build
-rm -f missing
-%{__aclocal}
-%{__autoconf}
-%configure2_13 \
+%configure \
 	--enable-ssl
 
 %{__make} \
+	CPPFLAGS="%{rpmcppflags}" \
+	LDFLAGS="%{rpmldflags}" \
 	SSMTPCONFDIR=%{_sysconfdir}/mail
 
 %install
diff --git a/defaultvalues.patch b/defaultvalues.patch
deleted file mode 100644
index e417cd0..0000000
--- a/defaultvalues.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- ssmtp-2.64/ssmtp.conf.orig	2008-02-29 03:50:15.000000000 +0100
-+++ ssmtp-2.64/ssmtp.conf	2021-11-26 15:50:46.285946096 +0100
-@@ -30,6 +30,8 @@
- 
- # Use SSL/TLS to send secure messages to server.
- #UseTLS=YES
-+#IMPORTANT: The following line is mandatory for TLS authentication
-+TLS_CA_File=/etc/ssl/certs/ca-certificates.crt
- 
- # Use SSL/TLS certificate to authenticate against smtp host.
- #UseTLSCert=YES
diff --git a/ssmtp-addr-parse-bounds.patch b/ssmtp-addr-parse-bounds.patch
new file mode 100644
index 0000000..9689876
--- /dev/null
+++ b/ssmtp-addr-parse-bounds.patch
@@ -0,0 +1,62 @@
+Unbalanced parentheses or an empty address in To:/From: read and write outside
+the heap buffer in addr_parse()/strip_post_ws()/rcpt_save().
+https://github.com/Project-OSS-Revival/ssmtp/issues/10 (Debian #623856)
+
+diff -urNp ssmtp-2.66.orig/ssmtp.c ssmtp-2.66/ssmtp.c
+--- ssmtp-2.66.orig/ssmtp.c	2026-02-21 18:34:02.000000000 +0100
++++ ssmtp-2.66/ssmtp.c	2026-10-29 03:00:23.598328151 +0100
+@@ -281,7 +281,7 @@ char *strip_post_ws(char *str)
+ 	char *p;
+ 
+ 	p = (str + strlen(str));
+-	while(isspace(*--p)) {
++	while(p != str && isspace(*--p)) {
+ 		*p = 0;
+ 	}
+ 
+@@ -320,7 +320,7 @@ char *addr_parse(char *str)
+ 
+ 	q = strip_pre_ws(p);
+ 	if(*q == '(') {
+-		while((*q++ != ')'));
++		while(*q && *q++ != ')');
+ 	}
+ 	p = strip_pre_ws(q);
+ 
+@@ -330,8 +330,11 @@ char *addr_parse(char *str)
+ 
+ 	q = strip_post_ws(p);
+ 	if(*q == ')') {
+-		while((*--q != '('));
+ 		*q = 0;
++		while(q != p && *--q != '(');
++		if(*q == '(') {
++			*q = 0;
++		}
+ 	}
+ 	(void)strip_post_ws(p);
+ 
+@@ -531,6 +534,11 @@ void rcpt_save(char *str)
+ {
+ 	char *p;
+ 
++	/* Ignore missing usernames */
++	if(*str == 0) {
++		return;
++	}
++
+ # if 1
+ 	/* Horrible botch for group stuff */
+ 	p = str;
+@@ -545,11 +553,6 @@ void rcpt_save(char *str)
+ 	(void)fprintf(stderr, "*** rcpt_save(): str = [%s]\n", str);
+ #endif
+ 
+-	/* Ignore missing usernames */
+-	if(*str == 0) {
+-		return;
+-	}
+-
+ 	if((rt->string = strdup(str)) == (char *)NULL) {
+ 		die("rcpt_save() -- strdup() failed");
+ 	}
diff --git a/ssmtp-authpass.patch b/ssmtp-authpass.patch
deleted file mode 100644
index 8937df8..0000000
--- a/ssmtp-authpass.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff -up ssmtp-2.61/ssmtp.c.orig ssmtp-2.61/ssmtp.c
---- ssmtp-2.61/ssmtp.c.orig	2008-11-26 17:27:29.000000000 +0200
-+++ ssmtp-2.61/ssmtp.c	2008-11-26 17:25:36.000000000 +0200
-@@ -1051,7 +1051,8 @@ bool_t read_config()
- 				}
- 			}
- 			else if(strcasecmp(p, "AuthPass") == 0 && !auth_pass) {
--				if((auth_pass = strdup(q)) == (char *)NULL) {
-+				auth_pass = firsttok(&rightside, " \n\t");
-+				if(auth_pass  == (char *)NULL) {
- 					die("parse_config() -- strdup() failed");
- 				}
- 
diff --git a/ssmtp-garbage_writes.patch b/ssmtp-garbage_writes.patch
deleted file mode 100644
index 754e654..0000000
--- a/ssmtp-garbage_writes.patch
+++ /dev/null
@@ -1,18 +0,0 @@
---- ssmtp-2.64/ssmtp.c.orig	2012-06-30 23:56:31.000000000 +0300
-+++ ssmtp-2.64/ssmtp.c	2012-06-30 23:59:02.764119487 +0300
-@@ -1655,12 +1655,12 @@ int ssmtp(char *argv[])
- 			outbytes += smtp_write(sock, "%s", leadingdot ? b : buf);
- 		} else {
- 			if (log_level > 0) {
--				log_event(LOG_INFO, "Sent a very long line in chunks");
-+				log_event(LOG_INFO, "Sending a partial line");
- 			}
- 			if (leadingdot) {
--				outbytes += fd_puts(sock, b, sizeof(b));
-+				outbytes += fd_puts(sock, b, strlen(b));
- 			} else {
--				outbytes += fd_puts(sock, buf, bufsize);
-+				outbytes += fd_puts(sock, buf, strlen(buf));
- 			}
- 		}
- 		(void)alarm((unsigned) MEDWAIT);
diff --git a/ssmtp-no-self-signed.patch b/ssmtp-no-self-signed.patch
new file mode 100644
index 0000000..db25cb5
--- /dev/null
+++ b/ssmtp-no-self-signed.patch
@@ -0,0 +1,34 @@
+Upstream accepts certificates from unknown issuers unless AllowSelfSigned=NO is set,
+which leaves the default STARTTLS/TLS connection open to MITM; verify by default.
+
+diff -urNp ssmtp-2.66.orig/ssmtp.c ssmtp-2.66/ssmtp.c
+--- ssmtp-2.66.orig/ssmtp.c	2026-02-21 18:34:02.000000000 +0100
++++ ssmtp-2.66/ssmtp.c	2026-10-29 02:59:30.386856810 +0100
+@@ -55,7 +55,7 @@ bool_t use_cert = False;		/* Use a certi
+ bool_t use_oldauth = False;		/* use old AUTH LOGIN username style */
+ bool_t verify_peer = True;		/* Verify peer certificate. */
+ bool_t verify_peer_name = True;	/* Verify hostname in the certificate match server connected */
+-bool_t allow_self_signed = True;	/* Accept self signed certificates. */
++bool_t allow_self_signed = False;	/* Accept self signed certificates. */
+ 
+ #define ARPADATE_LENGTH 32		/* Current date in RFC format */
+ char arpadate[ARPADATE_LENGTH];
+diff -urNp ssmtp-2.66.orig/ssmtp.conf.5 ssmtp-2.66/ssmtp.conf.5
+--- ssmtp-2.66.orig/ssmtp.conf.5	2026-02-21 18:34:02.000000000 +0100
++++ ssmtp-2.66/ssmtp.conf.5	2026-10-29 02:59:30.397401087 +0100
+@@ -69,6 +69,7 @@ Specifies whether ssmtp to verify peer(s
+ .Pp
+ .It AllowSelfSigned
+ Specifies whether ssmtp to allow self signed certificates.
++The default is NO.
+ .Pp
+ .It Cm AuthUser
+ The user name to use for SMTP AUTH.
+diff -urNp ssmtp-2.66.orig/TLS ssmtp-2.66/TLS
+--- ssmtp-2.66.orig/TLS	2026-02-21 18:34:02.000000000 +0100
++++ ssmtp-2.66/TLS	2026-10-29 02:59:30.400815685 +0100
+@@ -40,3 +40,4 @@ Set this to yes to make ssmtp to verify
+ 
+ AllowSelfSigned=YES/NO
+ Set this to yes to make ssmtp to allow self signed certificates.
++Default: NO.
diff --git a/ssmtp-nonsl.patch b/ssmtp-nonsl.patch
deleted file mode 100644
index 1121475..0000000
--- a/ssmtp-nonsl.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- ssmtp-2.60/configure.in~	2002-09-27 12:35:42.000000000 +0000
-+++ ssmtp-2.60/configure.in	2003-06-25 16:42:29.000000000 +0000
-@@ -23,7 +23,6 @@
- AC_STRUCT_TM
- 
- dnl Checks for libraries.
--AC_SEARCH_LIBS(gethostname, nsl)
- AC_SEARCH_LIBS(socket, socket)
- 
- dnl Checks for library functions.
diff --git a/ssmtp-ssl.patch b/ssmtp-ssl.patch
deleted file mode 100644
index db88e65..0000000
--- a/ssmtp-ssl.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -urNp -x '*.orig' ssmtp-2.64.org/configure ssmtp-2.64/configure
---- ssmtp-2.64.org/configure	2008-03-06 21:53:03.000000000 +0100
-+++ ssmtp-2.64/configure	2021-10-03 21:46:24.811012739 +0200
-@@ -1562,7 +1562,7 @@ if test x$enableval = xyes ; then
- #define HAVE_SSL 1
- EOF
- 
--	LIBS="$LIBS -lssl"
-+	LIBS="$LIBS -lssl -lcrypto"
- fi
- enableval=""
- 
-diff -urNp -x '*.orig' ssmtp-2.64.org/configure.in ssmtp-2.64/configure.in
---- ssmtp-2.64.org/configure.in	2021-10-03 21:46:24.781012522 +0200
-+++ ssmtp-2.64/configure.in	2021-10-03 21:46:24.811012739 +0200
-@@ -51,7 +51,7 @@ AC_ARG_ENABLE(ssl,
- [  --enable-ssl           support for secure connection to mail server])
- if test x$enableval = xyes ; then
- 	AC_DEFINE(HAVE_SSL)
--	LIBS="$LIBS -lssl"
-+	LIBS="$LIBS -lssl -lcrypto"
- fi
- enableval=""
- 
diff --git a/ssmtp-validate-TLS-server-cert.patch b/ssmtp-validate-TLS-server-cert.patch
deleted file mode 100644
index 96cb331..0000000
--- a/ssmtp-validate-TLS-server-cert.patch
+++ /dev/null
@@ -1,153 +0,0 @@
-diff -up ssmtp-2.64/ssmtp.conf.5.orig ssmtp-2.64/ssmtp.conf.5
---- ssmtp-2.64/ssmtp.conf.5.orig	2013-08-20 10:09:28.912253115 +0300
-+++ ssmtp-2.64/ssmtp.conf.5	2013-08-20 10:10:05.666212495 +0300
-@@ -53,6 +53,13 @@ See RFC 2487.
- .Pp
- .It Cm TLSCert
- The file name of an RSA certificate to use for TLS, if required.
-+.It Cm TLSKey
-+The file name of an RSA key to use for TLS, if required.
-+.It Cm TLS_CA_File
-+A file of trusted certificates for validating the server, if required.
-+.Pp
-+.It Cm TLS_CA_Dir
-+A directory of trusted certificates for validating the server, if required.
- .Pp
- .It Cm AuthUser
- The user name to use for SMTP AUTH.
-diff -up ssmtp-2.64/ssmtp.c.orig ssmtp-2.64/ssmtp.c
---- ssmtp-2.64/ssmtp.c.orig	2013-08-20 10:09:03.510255402 +0300
-+++ ssmtp-2.64/ssmtp.c	2013-08-20 10:10:05.666212495 +0300
-@@ -69,7 +69,10 @@ char *minus_F = (char)NULL;
- char *gecos;
- char *prog = (char)NULL;
- char *root = NULL;
--char *tls_cert = "/etc/ssl/certs/ssmtp.pem";	/* Default Certificate */
-+char *tls_cert = "/etc/pki/tls/private/ssmtp.pem";	/* Default Certificate */
-+char *tls_key = "/etc/pki/tls/private/ssmtp.pem";    /* Default private key */
-+char *tls_ca_file = NULL;      /* Trusted Certificate file */
-+char *tls_ca_dir = NULL;       /* Trusted Certificate directory */
- char *uad = (char)NULL;
- char *config_file = (char)NULL;		/* alternate configuration file */
- 
-@@ -1084,6 +1087,33 @@ bool_t read_config()
- 					log_event(LOG_INFO, "Set TLSCert=\"%s\"\n", tls_cert);
- 				}
- 			}
-+                       else if(strcasecmp(p, "TLSKey") == 0) {
-+                               if((tls_key = strdup(q)) == (char *)NULL) {
-+                                       die("parse_config() -- strdup() failed");
-+                               }
-+
-+                               if(log_level > 0) {
-+                                       log_event(LOG_INFO, "Set TLSKey=\"%s\"\n", tls_key);
-+                               }
-+                       }
-+                       else if(strcasecmp(p, "TLS_CA_File") == 0) {
-+                               if((tls_ca_file = strdup(q)) == (char *)NULL) {
-+                                       die("parse_config() -- strdup() failed");
-+                               }
-+
-+                               if(log_level > 0) {
-+                                       log_event(LOG_INFO, "Set TLS_CA_File=\"%s\"\n", tls_ca_file);
-+                               }
-+                       }
-+                       else if(strcasecmp(p, "TLS_CA_Dir") == 0) {
-+                               if((tls_ca_dir = strdup(q)) == (char *)NULL) {
-+                                       die("parse_config() -- strdup() failed");
-+                               }
-+
-+                               if(log_level > 0) {
-+                                       log_event(LOG_INFO, "Set TLS_CA_Dir=\"%s\"\n", tls_ca_dir);
-+                               }
-+                       }
- #endif
- 			/* Command-line overrides these */
- 			else if(strcasecmp(p, "AuthUser") == 0 && !auth_user) {
-@@ -1168,6 +1198,8 @@ int smtp_open(char *host, int port)
- 
- #ifdef HAVE_SSL
- 	int err;
-+	long lerr;
-+	unsigned long ulerr;
- 	char buf[(BUF_SZ + 1)];
- 
- 	/* Init SSL stuff */
-@@ -1190,7 +1222,7 @@ int smtp_open(char *host, int port)
- 			return(-1);
- 		}
- 
--		if(SSL_CTX_use_PrivateKey_file(ctx, tls_cert, SSL_FILETYPE_PEM) <= 0) {
-+		if(SSL_CTX_use_PrivateKey_file(ctx, tls_key, SSL_FILETYPE_PEM) <= 0) {
- 			perror("Use PrivateKey");
- 			return(-1);
- 		}
-@@ -1200,6 +1232,16 @@ int smtp_open(char *host, int port)
- 			return(-1);
- 		}
- 	}
-+	if (tls_ca_file || tls_ca_dir) {
-+		if(!SSL_CTX_load_verify_locations(ctx, tls_ca_file, tls_ca_dir)) {
-+			ulerr = ERR_get_error();
-+			log_event(LOG_ERR, "Error setting verify location: %s",
-+				  ERR_reason_error_string(ulerr));
-+			return(-1);
-+		}
-+	}
-+
-+	SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, NULL);
- #endif
- 
- #ifdef INET6
-@@ -1303,14 +1345,20 @@ int smtp_open(char *host, int port)
- 
- 		ssl = SSL_new(ctx);
- 		if(!ssl) {
--			log_event(LOG_ERR, "SSL not working");
-+			ulerr = ERR_get_error();
-+			log_event(LOG_ERR, "SSL not working: %s",
-+                                 ERR_reason_error_string(ulerr));
- 			return(-1);
- 		}
- 		SSL_set_fd(ssl, s);
- 
- 		err = SSL_connect(ssl);
- 		if(err < 0) { 
--			perror("SSL_connect");
-+			ulerr = ERR_get_error();
-+			lerr = SSL_get_verify_result(ssl);
-+			log_event(LOG_ERR, "SSL not working: %s (%ld)",
-+				ERR_reason_error_string(ulerr), lerr);
-+
- 			return(-1);
- 		}
- 
-@@ -1324,8 +1372,6 @@ int smtp_open(char *host, int port)
- 			return(-1);
- 		}
- 		X509_free(server_cert);
--
--		/* TODO: Check server cert if changed! */
- 	}
- #endif
- 
-diff -up ssmtp-2.64/TLS.orig ssmtp-2.64/TLS
---- ssmtp-2.64/TLS.orig	2013-08-20 10:09:52.524212818 +0300
-+++ ssmtp-2.64/TLS	2013-08-20 10:10:05.667213425 +0300
-@@ -26,9 +26,13 @@ Set this to yes to make ssmtp identify i
- TLSCert=<file>
- Specify which certificate file should be used.
- 
-+TLSKey=<file>
-+Specify which key file should be used (can be the same as the certificate file).
- 
--TODO:
--* Check server certificate for changes and notify about it.
--* Diffrent Certificate and Key file?
-+TLS_CA_File=<file>
-+Optional file of trusted certificates for validating the server.
-+
-+TLS_CA_Dir=<file>
-+Optional directory of trusted certificates for validating the server.
- 
- 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ssmtp.git/commitdiff/ccaba63ea848fd362cf18168e5c57f785d304a68



More information about the pld-cvs-commit mailing list