diff options
-rw-r--r-- | net-mail/ssmtp/ChangeLog | 9 | ||||
-rw-r--r-- | net-mail/ssmtp/Manifest | 6 | ||||
-rw-r--r-- | net-mail/ssmtp/files/digest-ssmtp-2.60.3 | 1 | ||||
-rw-r--r-- | net-mail/ssmtp/files/starttls.diff | 150 | ||||
-rw-r--r-- | net-mail/ssmtp/ssmtp-2.60.3.ebuild | 69 |
5 files changed, 232 insertions, 3 deletions
diff --git a/net-mail/ssmtp/ChangeLog b/net-mail/ssmtp/ChangeLog index 525bb48eb801..81c461e5a71a 100644 --- a/net-mail/ssmtp/ChangeLog +++ b/net-mail/ssmtp/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for net-mail/ssmtp # Copyright 2002-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-mail/ssmtp/ChangeLog,v 1.12 2003/04/18 20:33:13 tuxus Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-mail/ssmtp/ChangeLog,v 1.13 2003/06/10 00:10:35 raker Exp $ + +*ssmtp-2.60.3 (09 Jun 2003) + + 09 Jun 2003; Nick Hadaway <raker@gentoo.org> ssmtp-2.60.3.ebuild, + files/digest-ssmtp-2.60.3, files/starttls.diff: + Version bump. Major features added upstream and included in the + ebuild. Many thanks to ferdy@ferdyx.org for the updates. 20 Feb 2003; Zach Welch <zwelch@gentoo.org> : Added arm to keywords. diff --git a/net-mail/ssmtp/Manifest b/net-mail/ssmtp/Manifest index 64c279897fdb..1bfd747ee667 100644 --- a/net-mail/ssmtp/Manifest +++ b/net-mail/ssmtp/Manifest @@ -1,5 +1,7 @@ +MD5 1a895df2684790d43bc35e951bc035d7 ssmtp-2.48.ebuild 1580 +MD5 0c2611ddd3b3fbed0d549d738ae64f2d ssmtp-2.60.3.ebuild 1870 MD5 98adc82059ed21884b9dafb1f24571fa ChangeLog 1653 MD5 6096cf673dfb54bc14f20a14bc9cc8eb ssmtp-2.38.14-r1.ebuild 1506 -MD5 1a895df2684790d43bc35e951bc035d7 ssmtp-2.48.ebuild 1580 -MD5 0c220581f9fe43f95d74864b63cf5121 files/digest-ssmtp-2.38.14-r1 64 MD5 7acea6571783e2e8d40bb7aafad39d21 files/digest-ssmtp-2.48 62 +MD5 0c220581f9fe43f95d74864b63cf5121 files/digest-ssmtp-2.38.14-r1 64 +MD5 fdf4a04b5fc0cec5d1e9b0cf355d0567 files/digest-ssmtp-2.60.3 64 diff --git a/net-mail/ssmtp/files/digest-ssmtp-2.60.3 b/net-mail/ssmtp/files/digest-ssmtp-2.60.3 new file mode 100644 index 000000000000..b33de3435a9c --- /dev/null +++ b/net-mail/ssmtp/files/digest-ssmtp-2.60.3 @@ -0,0 +1 @@ +MD5 b9b1c07f513ff2b46ae8a09eaf3e04e5 ssmtp_2.60.3.tar.gz 159289 diff --git a/net-mail/ssmtp/files/starttls.diff b/net-mail/ssmtp/files/starttls.diff new file mode 100644 index 000000000000..0cd4b7a0d65c --- /dev/null +++ b/net-mail/ssmtp/files/starttls.diff @@ -0,0 +1,150 @@ +diff -rup ssmtp-2.60/ssmtp.c ssmtp-2.60-starttls/ssmtp.c +--- ssmtp-2.60/ssmtp.c 2002-12-08 19:26:20.000000000 +0200 ++++ ssmtp-2.60-starttls/ssmtp.c 2003-06-09 00:32:24.000000000 +0300 +@@ -48,8 +48,12 @@ bool_t minus_t = False; + bool_t minus_v = False; + bool_t override_from = False; + bool_t rewrite_domain = False; ++#ifdef HAVE_SSL + bool_t use_tls = False; /* Use SSL to transfer mail to HUB */ ++bool_t use_starttls = False; /* Use STARTTLS SMTP command to initiate TLS */ + bool_t use_cert = False; /* Use a certificate to transfer SSL mail */ ++bool_t tls_initialized = False; ++#endif + + #define ARPADATE_LENGTH 32 /* Current date in RFC format */ + char arpadate[ARPADATE_LENGTH]; +@@ -878,11 +882,24 @@ bool_t read_config() + use_tls = False; + } + +- if(log_level > 0) { ++ if(log_level > 0) { + log_event(LOG_INFO, + "Set UseTLS=\"%s\"\n", use_tls ? "True" : "False"); + } + } ++ else if(strcasecmp(p, "UseSTARTTLS") == 0) { ++ if(strcasecmp(q, "YES") == 0) { ++ use_starttls = True; ++ } ++ else { ++ use_starttls = False; ++ } ++ ++ if(log_level > 0) { ++ log_event(LOG_INFO, ++ "Set UseSTARTTLS=\"%s\"\n", use_starttls ? "True" : "False"); ++ } ++ } + else if(strcasecmp(p, "UseTLSCert") == 0) { + if(strcasecmp(q, "YES") == 0) { + use_cert = True; +@@ -920,8 +937,11 @@ bool_t read_config() + /* + smtp_open() -- Open connection to a remote SMTP listener + */ ++void smtp_write(int fd, char *format, ...); ++int smtp_okay(int fd, char *response); + int smtp_open(char *host, int port) + { ++ char buf[(BUF_SZ + 1)]; + #ifdef INET6 + struct addrinfo hints, *ai0, *ai; + char servname[NI_MAXSERV]; +@@ -949,7 +969,7 @@ int smtp_open(char *host, int port) + return(-1); + } + +- if(use_cert == True) { ++ if(use_cert == True) { + if(SSL_CTX_use_certificate_chain_file(ctx, tls_cert) <= 0) { + perror("Use certfile"); + return(-1); +@@ -1028,11 +1048,24 @@ int smtp_open(char *host, int port) + return(-1); + } + #endif ++ if(smtp_okay(s, buf) == False) { ++ log_event(LOG_ERR, "Invalid response SMTP server"); ++ return(-1); ++ } + + #ifdef HAVE_SSL + if(use_tls == True) { + log_event(LOG_INFO, "Creating SSL connection to host"); + ++ if(use_starttls == True) { ++ smtp_write(s, "STARTTLS", hostname); ++ (void)alarm((unsigned) MEDWAIT); ++ if(smtp_okay(s, buf) == False) { ++ log_event(LOG_ERR, "STARTTLS failed: %s", buf); ++ return(-1); ++ } ++ } ++ + ssl = SSL_new(ctx); + if(!ssl) { + log_event(LOG_ERR, "SSL not working"); +@@ -1041,12 +1074,13 @@ int smtp_open(char *host, int port) + SSL_set_fd(ssl, s); + + err = SSL_connect(ssl); +- if(err < 0) { ++ if(err < 0) { + perror("SSL_connect"); + return(-1); + } ++ tls_initialized = True; + +- if(log_level > 0) { ++ if(log_level > 0) { + log_event(LOG_INFO, "SSL connection using %s", + SSL_get_cipher(ssl)); + } +@@ -1070,7 +1104,7 @@ fd_getc() -- Read a character from an fd + ssize_t fd_getc(int fd, void *c) + { + #ifdef HAVE_SSL +- if(use_tls == True) { ++ if(use_tls == True && tls_initialized == True) { + return(SSL_read(ssl, c, 1)); + } + #endif +@@ -1134,10 +1168,10 @@ int smtp_okay(int fd, char *response) + /* + fd_puts() -- Write characters to fd + */ +-ssize_t fd_puts(int fd, const void *buf, size_t count) ++ssize_t fd_puts(int fd, const void *buf, size_t count) + { + #ifdef HAVE_SSL +- if(use_tls == True) { ++ if(use_tls == True && tls_initialized == True) { + return(SSL_write(ssl, buf, count)); + } + #endif +@@ -1237,9 +1271,6 @@ int ssmtp(char *argv[]) + if((sock = smtp_open(mailhost, port)) == -1) { + die("Cannot open %s:%d", mailhost, port); + } +- else if(smtp_okay(sock, buf) == False) { +- die("Invalid response SMTP server"); +- } + + /* If user supplied username and password, then try ELHO */ + if(auth_user) { +diff -rup ssmtp-2.60/ssmtp.conf ssmtp-2.60-starttls/ssmtp.conf +--- ssmtp-2.60/ssmtp.conf 2001-05-08 13:22:08.000000000 +0300 ++++ ssmtp-2.60-starttls/ssmtp.conf 2003-06-09 00:35:01.000000000 +0300 +@@ -30,6 +30,10 @@ hostname=_HOSTNAME_ + # Use SSL/TLS to send secure messages to server. + #UseTLS=YES + ++# Use STARTTLS SMTP command to initiate SSL, you should enable UseTLS too ++# for this option to work ++UseSTARTTLS=YES ++ + # Use SSL/TLS certificate to authenticate against smtp host. + #UseTLSCert=YES + diff --git a/net-mail/ssmtp/ssmtp-2.60.3.ebuild b/net-mail/ssmtp/ssmtp-2.60.3.ebuild new file mode 100644 index 000000000000..768a33343938 --- /dev/null +++ b/net-mail/ssmtp/ssmtp-2.60.3.ebuild @@ -0,0 +1,69 @@ +# Copyright 1999-2003 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-mail/ssmtp/ssmtp-2.60.3.ebuild,v 1.1 2003/06/10 00:10:35 raker Exp $ + +DESCRIPTION="Extremely simple MTA to get mail off the system to a Mailhub" +SRC_URI="ftp://ftp.es.debian.org/debian/pool/main/s/ssmtp/ssmtp_${PV}.tar.gz" +HOMEPAGE="ftp://ftp.es.debian.org/debian/pool/main/s/ssmtp/" + +SLOT="0" +KEYWORDS="~x86 ~ppc ~sparc ~alpha ~hppa ~arm ~mips" +LICENSE="GPL-2" +IUSE="ssl ipv6 md5" + +DEPEND="virtual/glibc + ssl? ( dev-libs/openssl )" +RDEPEND="!virtual/mta + net-mail/mailbase + ssl? ( dev-libs/openssl )" +PROVIDE="virtual/mta" + +S=${WORKDIR}/ssmtp-2.60 + +src_compile() { + local myconf + + use ssl && ( epatch ${FILESDIR}/starttls.diff || die ) + use ssl && myconf="${myconf} --enable-ssl" + use ipv6 && myconf="${myconf} --enable-inet6" + use md5 && myconf="${myconf} --enable-md5suth" + + econf \ + --sysconfdir=/etc/ssmtp \ + ${myconf} || die + + make clean || die + make etcdir=/etc || die +} + +src_install() { + dodir /usr/bin /usr/sbin /usr/lib + dosbin ssmtp + chmod 755 ${D}/usr/sbin/ssmtp + dosym /usr/sbin/ssmtp /usr/bin/mailq + dosym /usr/sbin/ssmtp /usr/bin/newaliases + # Removed symlink due to conflict with mailx + # See bug #7448 + #dosym /usr/sbin/ssmtp /usr/bin/mail + dosym /usr/sbin/ssmtp /usr/sbin/sendmail + dosym /usr/sbin/ssmtp /usr/lib/sendmail + doman ssmtp.8 + dosym /usr/share/man/man8/ssmtp.8 /usr/share/man/man8/sendmail.8 + dodoc INSTALL README TLS + newdoc ssmtp-2.60.lsm + insinto /etc/ssmtp + doins ssmtp.conf revaliases +} + +pkg_config() { + + local conffile="/etc/ssmtp/ssmtp.conf" + local hostname=`hostname -f` + local domainname=`hostname -d` + mv ${conffile} ${conffile}.orig + sed -e "s:rewriteDomain=:rewriteDomain=${domainname}:g" \ + -e "s:_HOSTNAME_:${hostname}:" \ + -e "s:^mailhub=mail:mailhub=mail.${domainname}:g" \ + ${conffile}.orig > ${conffile} +} + |