Sun May 1 05:56:40 2016 UTC ()
Updated to mail/opensmtpd-5.7.3p2 (from 5.3.3p1)
  - Based on PR pkg/51107 by ISIHARA Takanori
  ------------------------------------------------
  Announce: #OpenSMTPD 5.7.3p2 released
  - fixes crash when used with #OpenSSL 1.0.2f - portable only


(mef)
diff -r1.7 -r1.8 pkgsrc/mail/opensmtpd/Makefile
diff -r1.2 -r1.3 pkgsrc/mail/opensmtpd/PLIST
diff -r1.3 -r1.4 pkgsrc/mail/opensmtpd/distinfo
diff -r1.1 -r1.2 pkgsrc/mail/opensmtpd/files/mailer.conf
diff -r1.1 -r1.2 pkgsrc/mail/opensmtpd/patches/patch-configure.ac
diff -r0 -r1.1 pkgsrc/mail/opensmtpd/patches/patch-mk_smtpd_Makefile.am
diff -r0 -r1.1 pkgsrc/mail/opensmtpd/patches/patch-smtpd_queue__fs.c
diff -r0 -r1.1 pkgsrc/mail/opensmtpd/patches/patch-smtpd_smtp__session.c
diff -r1.1 -r0 pkgsrc/mail/opensmtpd/patches/patch-smtpd_Makefile.am
diff -r1.1 -r0 pkgsrc/mail/opensmtpd/patches/patch-smtpd_queue_fsqueue.c

cvs diff -r1.7 -r1.8 pkgsrc/mail/opensmtpd/Makefile (expand / switch to unified diff)

--- pkgsrc/mail/opensmtpd/Makefile 2016/03/05 11:28:49 1.7
+++ pkgsrc/mail/opensmtpd/Makefile 2016/05/01 05:56:40 1.8
@@ -1,68 +1,78 @@ @@ -1,68 +1,78 @@
1# $NetBSD: Makefile,v 1.7 2016/03/05 11:28:49 jperkin Exp $ 1# $NetBSD: Makefile,v 1.8 2016/05/01 05:56:40 mef Exp $
2 2
3VERSION= 5.3.3p1 3VERSION= 5.7.3p2
4DISTNAME= opensmtpd-${VERSION} 4DISTNAME= opensmtpd-${VERSION}
5PKGREVISION= 2 
6CATEGORIES= mail net 5CATEGORIES= mail net
7MASTER_SITES= http://www.opensmtpd.org/archives/ 6MASTER_SITES= http://www.opensmtpd.org/archives/
8 7
9MAINTAINER= ftigeot@wolfpond.org 8MAINTAINER= ftigeot@wolfpond.org
10HOMEPAGE= http://www.opensmtpd.org/ 9HOMEPAGE= http://www.opensmtpd.org/
11COMMENT= The OpenSMTPD mail transfer agent, a replacement for sendmail 10COMMENT= The OpenSMTPD mail transfer agent, a replacement for sendmail
12LICENSE= isc AND modified-bsd AND 2-clause-bsd 11LICENSE= isc AND modified-bsd AND 2-clause-bsd
13 12
14CONFLICTS+= courier-mta-[0-9]* fastforward>=0.51nb2 sendmail-[0-9]* 13CONFLICTS+= courier-mta-[0-9]* fastforward>=0.51nb2 sendmail-[0-9]*
15CONFLICTS+= esmtp>=1.2 nullmailer-[0-9]* postfix-[0-9]* 14CONFLICTS+= esmtp>=1.2 nullmailer-[0-9]* postfix-[0-9]*
16BROKEN_FOR_PLATFORM+= OpenBSD-*-* 15BROKEN_FOR_PLATFORM= OpenBSD-*-*
17 16
18BUILD_DEFS+= VARBASE 17BUILD_DEFS+= VARBASE
19 18
20USE_LANGUAGES= c 19USE_LANGUAGES= c
21USE_LIBTOOL= yes 20USE_LIBTOOL= yes
22USE_TOOLS+= pkg-config yacc 21USE_TOOLS+= pkg-config yacc
23USE_TOOLS+= automake aclocal autoheader autoconf 22USE_TOOLS+= automake aclocal autoheader autoconf
24 23
25SMTPD_HOME= ${VARBASE}/chroot/smtpd 24SMTPD_HOME= ${VARBASE}/chroot/smtpd
26OWN_DIRS= ${SMTPD_HOME} 25OWN_DIRS= ${SMTPD_HOME}
27 26
28PKG_GROUPS= _smtpd 27PKG_GROUPS= _smtpd _smtpq
29PKG_USERS= _smtpd:_smtpd 28PKG_USERS= _smtpd:_smtpd _smtpq:_smtpq
30PKG_GECOS._smtpd= OpenSMTPD pseudo-user 29PKG_GECOS._smtpd= OpenSMTPD pseudo-user
31PKG_HOME._smtpd= ${SMTPD_HOME} 30PKG_HOME._smtpd= ${SMTPD_HOME}
 31PKG_GECOS._smtpq= OpenSMTPD pseudo-user
 32PKG_HOME._smtpq= ${SMTPD_HOME}
32 33
33GNU_CONFIGURE= yes 34GNU_CONFIGURE= yes
 35USE_DB185= yes
 36CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR:Q}
 37CONFIGURE_ARGS+= --with-mantype=man
 38CONFIGURE_ARGS+= --with-privsep-path=${SMTPD_HOME}
 39CONFIGURE_ARGS+= --with-ssl-dir=${SSLBASE:Q}
 40CONFIGURE_ARGS+= --enable-table-db
 41CONFIGURE_ARGS+= --without-zlib-version-check
34 42
35EXAMPLEDIR= ${PREFIX}/share/examples/opensmtpd 43EXAMPLEDIR= ${PREFIX}/share/examples/opensmtpd
36CONF_FILES= ${EXAMPLEDIR}/smtpd.conf ${PKG_SYSCONFDIR}/smtpd.conf 44CONF_FILES= ${EXAMPLEDIR}/smtpd.conf ${PKG_SYSCONFDIR}/smtpd.conf
37 45
38RCD_SCRIPTS= opensmtpd 46RCD_SCRIPTS= opensmtpd
39 47
40SUBST_CLASSES+= paths 48SUBST_CLASSES+= paths
41SUBST_FILES.paths= ${WRKDIR}/mailer.conf 49SUBST_FILES.paths= ${WRKDIR}/mailer.conf
42SUBST_SED.paths+= -e 's,@PREFIX@,${PREFIX},g' 50SUBST_SED.paths+= -e 's,@PREFIX@,${PREFIX},g'
43SUBST_STAGE.paths= post-patch 51SUBST_STAGE.paths= post-patch
44 52
45SUBST_CLASSES+= exampledir 53SUBST_CLASSES+= exampledir
46SUBST_STAGE.exampledir= pre-configure 54SUBST_STAGE.exampledir= pre-configure
47SUBST_MESSAGE.exampledir= Fixing exampledir path 55SUBST_MESSAGE.exampledir= Fixing exampledir path
48SUBST_FILES.exampledir= smtpd/Makefile.am 56SUBST_FILES.exampledir= mk/smtpd/Makefile.am
49SUBST_SED.exampledir+= -e 's,@EXAMPLE_DIR@,${EXAMPLEDIR},' 57SUBST_SED.exampledir+= -e 's,@EXAMPLE_DIR@,${EXAMPLEDIR},'
50 58
51post-extract: 59post-extract:
52 cp ${FILESDIR}/mailer.conf ${WRKDIR}/mailer.conf 60 cp ${FILESDIR}/mailer.conf ${WRKDIR}/mailer.conf
53 61
54pre-configure: 62pre-configure:
55 cd $(WRKSRC) && ${PREFIX}/bin/libtoolize --copy --force 63 cd $(WRKSRC) && ${PREFIX}/bin/libtoolize --copy --force
56 cd $(WRKSRC) && ${TOOLS_CMD.aclocal} 64 cd $(WRKSRC) && ${TOOLS_CMD.aclocal}
57 cd $(WRKSRC) && ${TOOLS_CMD.autoconf} 65 cd $(WRKSRC) && ${TOOLS_CMD.autoconf}
58 cd $(WRKSRC) && ${TOOLS_CMD.autoheader} 66 cd $(WRKSRC) && ${TOOLS_CMD.autoheader}
59 cd $(WRKSRC) && ${TOOLS_CMD.automake} --foreign --add-missing --copy 67 cd $(WRKSRC) && ${TOOLS_CMD.automake} --foreign --add-missing --copy
60 68
61post-install: 69post-install:
62 ${INSTALL_DATA} ${WRKDIR}/mailer.conf \ 70 ${INSTALL_DATA} ${WRKDIR}/mailer.conf \
63 ${DESTDIR}${EXAMPLEDIR}/mailer.conf 71 ${DESTDIR}${EXAMPLEDIR}/mailer.conf
64 72
65.include "../../databases/db/buildlink3.mk" 73.include "../../databases/db5/buildlink3.mk"
66.include "../../devel/libevent/buildlink3.mk" 74.include "../../devel/libevent/buildlink3.mk"
67.include "../../devel/zlib/buildlink3.mk" 75.include "../../devel/zlib/buildlink3.mk"
 76.include "../../net/libasr/buildlink3.mk"
 77.include "../../security/openssl/buildlink3.mk"
68.include "../../mk/bsd.pkg.mk" 78.include "../../mk/bsd.pkg.mk"

cvs diff -r1.2 -r1.3 pkgsrc/mail/opensmtpd/Attic/PLIST (expand / switch to unified diff)

--- pkgsrc/mail/opensmtpd/Attic/PLIST 2014/03/11 14:05:04 1.2
+++ pkgsrc/mail/opensmtpd/Attic/PLIST 2016/05/01 05:56:40 1.3
@@ -1,18 +1,20 @@ @@ -1,18 +1,20 @@
1@comment $NetBSD: PLIST,v 1.2 2014/03/11 14:05:04 jperkin Exp $ 1@comment $NetBSD: PLIST,v 1.3 2016/05/01 05:56:40 mef Exp $
2bin/mailq 2bin/sendmail
3bin/newaliases 3libexec/opensmtpd/encrypt
4bin/smtpscript 4libexec/opensmtpd/mail.local
5libexec/mail.local 
6libexec/opensmtpd/makemap 
7man/man5/aliases.5 5man/man5/aliases.5
8man/man5/forward.5 6man/man5/forward.5
9man/man5/smtpd.conf.5 7man/man5/smtpd.conf.5
 8man/man5/table.5
10man/man8/makemap.8 9man/man8/makemap.8
11man/man8/newaliases.8 10man/man8/newaliases.8
 11man/man8/sendmail.8
12man/man8/smtpctl.8 12man/man8/smtpctl.8
13man/man8/smtpd.8 13man/man8/smtpd.8
 14sbin/mailq
14sbin/makemap 15sbin/makemap
 16sbin/newaliases
15sbin/smtpctl 17sbin/smtpctl
16sbin/smtpd 18sbin/smtpd
17share/examples/opensmtpd/mailer.conf 19share/examples/opensmtpd/mailer.conf
18share/examples/opensmtpd/smtpd.conf 20share/examples/opensmtpd/smtpd.conf

cvs diff -r1.3 -r1.4 pkgsrc/mail/opensmtpd/distinfo (expand / switch to unified diff)

--- pkgsrc/mail/opensmtpd/distinfo 2015/11/03 23:27:11 1.3
+++ pkgsrc/mail/opensmtpd/distinfo 2016/05/01 05:56:40 1.4
@@ -1,9 +1,10 @@ @@ -1,9 +1,10 @@
1$NetBSD: distinfo,v 1.3 2015/11/03 23:27:11 agc Exp $ 1$NetBSD: distinfo,v 1.4 2016/05/01 05:56:40 mef Exp $
2 2
3SHA1 (opensmtpd-5.3.3p1.tar.gz) = a7fc3a15b5dc622410fcedf51bbe62e6b6d64df3 3SHA1 (opensmtpd-5.7.3p2.tar.gz) = 4d1edc5811a80ec26de040227a298a742c494e72
4RMD160 (opensmtpd-5.3.3p1.tar.gz) = 97f63e37fa6ce1f5f58d816088c5b356f99167c3 4RMD160 (opensmtpd-5.7.3p2.tar.gz) = 5d6faebea3a303e5effeafbef5def597bfac434e
5SHA512 (opensmtpd-5.3.3p1.tar.gz) = 8ea72773dca4f907d2b8285fc7abcd5c4c19ceb50b547cc4a217ec296a222f8134bfc4bc7707439b0c5d58b5354f92ebed65966179d7598c4793cad4370b087b 5SHA512 (opensmtpd-5.7.3p2.tar.gz) = bac0b8d6a6969a5e49a1d45b2c74cb2f3da44d06b12c7162500adf3ca312751020762bc8301075a9d7634d94cf51f978d04fac327f843680646e9e687737c42f
6Size (opensmtpd-5.3.3p1.tar.gz) = 343733 bytes 6Size (opensmtpd-5.7.3p2.tar.gz) = 709074 bytes
7SHA1 (patch-configure.ac) = ed819952951700c057c11200095a72972aafc1f9 7SHA1 (patch-configure.ac) = bcf442cf536b44019d25a1e4e9ac2812fc76d928
8SHA1 (patch-smtpd_Makefile.am) = 4267002ecadceaf68868b9d782d5e6f8571ebc36 8SHA1 (patch-mk_smtpd_Makefile.am) = ebc62819300d3ddd824178c08a5630ca85dc6fdc
9SHA1 (patch-smtpd_queue_fsqueue.c) = 80dae37705378c022c1a76d31ea54a3f907b6c1a 9SHA1 (patch-smtpd_queue__fs.c) = f13d1bf1d26544b3c81e5e2c813d2fe5e917b96b
 10SHA1 (patch-smtpd_smtp__session.c) = f9c034827519a02b97cadb3c034ad1e84abc805a

cvs diff -r1.1 -r1.2 pkgsrc/mail/opensmtpd/files/mailer.conf (expand / switch to unified diff)

--- pkgsrc/mail/opensmtpd/files/mailer.conf 2013/11/18 22:50:01 1.1
+++ pkgsrc/mail/opensmtpd/files/mailer.conf 2016/05/01 05:56:40 1.2
@@ -1,7 +1,9 @@ @@ -1,7 +1,9 @@
1# $NetBSD: mailer.conf,v 1.1 2013/11/18 22:50:01 pettai Exp $ 1# $NetBSD: mailer.conf,v 1.2 2016/05/01 05:56:40 mef Exp $
2# 2#
3# Use "opensmtpd" replacements  3# Use "opensmtpd" replacements
4# 4#
5sendmail @PREFIX@/libexec/mail.local 5sendmail @PREFIX@/sbin/smtpctl
6mailq @PREFIX@/bin/mailq 6send-mail @PREFIX@/sbin/smtpctl
7newaliases @PREFIX@/bin/newaliases 7mailq @PREFIX@/sbin/mailq
 8makemap @PREFIX@/sbin/makemap
 9newaliases @PREFIX@/sbin/newaliases

cvs diff -r1.1 -r1.2 pkgsrc/mail/opensmtpd/patches/Attic/patch-configure.ac (expand / switch to unified diff)

--- pkgsrc/mail/opensmtpd/patches/Attic/patch-configure.ac 2013/11/18 22:50:01 1.1
+++ pkgsrc/mail/opensmtpd/patches/Attic/patch-configure.ac 2016/05/01 05:56:40 1.2
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1$NetBSD: patch-configure.ac,v 1.1 2013/11/18 22:50:01 pettai Exp $ 1$NetBSD: patch-configure.ac,v 1.2 2016/05/01 05:56:40 mef Exp $
2 2
3Add sys/statvfs for NetBSD 3Add sys/statvfs for NetBSD.
4 4
5--- configure.ac.orig 2013-05-16 15:19:59.000000000 +0000 5--- configure.ac.orig 2016-02-02 07:40:06.000000000 +0000
6+++ configure.ac 6+++ configure.ac
7@@ -261,6 +261,7 @@ AC_CHECK_HEADERS([ \ 7@@ -338,6 +338,7 @@ AC_CHECK_HEADERS([ \
8 sys/ndir.h \ 8 sys/ndir.h \
9 sys/pstat.h \ 9 sys/pstat.h \
10 sys/statfs.h \ 10 sys/statfs.h \
11+ sys/statvfs.h \ 11+ sys/statvfs.h \
 12 sys/time.h \
12 sys/un.h \ 13 sys/un.h \
13 ucred.h \ 14 time.h \
14 util.h \ 

File Added: pkgsrc/mail/opensmtpd/patches/patch-mk_smtpd_Makefile.am
$NetBSD: patch-mk_smtpd_Makefile.am,v 1.1 2016/05/01 05:56:40 mef Exp $

Install the configuration file in the example directory.

--- mk/smtpd/Makefile.am.orig	2016-02-02 07:40:06.000000000 +0000
+++ mk/smtpd/Makefile.am
@@ -151,17 +151,16 @@ $(CONFIGFILES): $(CONFIGFILES_IN)
 
 # smtpd.conf
 # newaliases makemap
+
+EXAMPLE_DIR=@EXAMPLE_DIR@
+
 install-exec-hook: $(CONFIGFILES) $(MANPAGES)
-	$(MKDIR_P) $(DESTDIR)$(sysconfdir)
+	$(MKDIR_P) $(DESTDIR)$(EXAMPLE_DIR)
 	$(MKDIR_P) $(DESTDIR)$(bindir)
 	$(MKDIR_P) $(DESTDIR)$(mandir)/$(mansubdir)5
 	$(MKDIR_P) $(DESTDIR)$(mandir)/$(mansubdir)8
 
-	@if [ ! -f $(DESTDIR)$(sysconfdir)/smtpd.conf ]; then			\
-		$(INSTALL) -m 644 smtpd.conf.out $(DESTDIR)$(sysconfdir)/smtpd.conf; \
-	else									\
-		echo "$(DESTDIR)$(sysconfdir)/smtpd.conf already exists, install will not overwrite"; \
-	fi
+	$(INSTALL) -m 644 smtpd.conf.out $(DESTDIR)$(EXAMPLE_DIR)/smtpd.conf
 
 	$(INSTALL) -m 644 aliases.5.out		$(DESTDIR)$(mandir)/$(mansubdir)5/aliases.5
 	$(INSTALL) -m 644 forward.5.out		$(DESTDIR)$(mandir)/$(mansubdir)5/forward.5

File Added: pkgsrc/mail/opensmtpd/patches/Attic/patch-smtpd_queue__fs.c
$NetBSD: patch-smtpd_queue__fs.c,v 1.1 2016/05/01 05:56:40 mef Exp $

NetBSD use statvfs, not statfs.

--- smtpd/queue_fs.c.orig	2016-02-02 07:40:06.000000000 +0000
+++ smtpd/queue_fs.c
@@ -30,6 +30,12 @@
 #ifdef HAVE_SYS_STATFS_H
 #include <sys/statfs.h>
 #endif
+#ifdef HAVE_SYS_STATVFS_H
+#include <sys/statvfs.h>
+#ifdef __NetBSD__
+#define statfs statvfs
+#endif
+#endif
 
 #include <ctype.h>
 #include <dirent.h>

File Added: pkgsrc/mail/opensmtpd/patches/Attic/patch-smtpd_smtp__session.c
$NetBSD: patch-smtpd_smtp__session.c,v 1.1 2016/05/01 05:56:40 mef Exp $

Add a patch to handle long usernames during SMTP authentication,
e.g. often username exceeds the limit when it contains @host.name
part.

From FreeBSD's ports.

cf.http://svnweb.freebsd.org/ports?view=revision&revision=394424

--- smtpd/smtp_session.c.orig	2016-02-02 07:40:06.000000000 +0000
+++ smtpd/smtp_session.c
@@ -84,6 +84,7 @@ enum session_flags {
 	SF_BADINPUT		= 0x0080,
 	SF_FILTERCONN		= 0x0100,
 	SF_FILTERDATA		= 0x0200,
+	SF_USERTOOLONG		= 0x0400,
 };
 
 enum message_flags {
@@ -133,7 +134,7 @@ struct smtp_session {
 
 	char			 helo[LINE_MAX];
 	char			 cmd[LINE_MAX];
-	char			 username[LOGIN_NAME_MAX];
+	char			 username[LOGIN_NAME_MAX+HOST_NAME_MAX+1];
 
 	struct envelope		 evp;
 
@@ -986,6 +987,15 @@ smtp_session_imsg(struct mproc *p, struc
 
 		s = tree_xpop(&wait_parent_auth, reqid);
 		strnvis(user, s->username, sizeof user, VIS_WHITE | VIS_SAFE);
+
+		if (s->flags & SF_USERTOOLONG) {
+			log_info("smtp-in: sesson %016"PRIx64
+				": auth failed because username too long",
+				s->id);
+			s->flags &= (~SF_USERTOOLONG);
+			success = LKA_PERMFAIL;
+		}
+
 		if (success == LKA_OK) {
 			log_info("smtp-in: session %016"PRIx64
 			    ": authentication successful for user %s ",
@@ -1925,7 +1935,7 @@ smtp_rfc4954_auth_plain(struct smtp_sess
 		user++; /* skip NUL */
 		if (strlcpy(s->username, user, sizeof(s->username))
 		    >= sizeof(s->username))
-			goto abort;
+			s->flags |= SF_USERTOOLONG;
 
 		pass = memchr(user, '\0', len - (user - buf));
 		if (pass == NULL || pass >= buf + len - 2)
@@ -1965,9 +1975,12 @@ smtp_rfc4954_auth_login(struct smtp_sess
 
 	case STATE_AUTH_USERNAME:
 		memset(s->username, 0, sizeof(s->username));
-		if (base64_decode(arg, (unsigned char *)s->username,
-				  sizeof(s->username) - 1) == -1)
+		if (base64_decode(arg, (unsigned char *)buf,
+				  sizeof(buf) - 1) == -1)
 			goto abort;
+		if (strlcpy(s->username, buf, sizeof(s->username))
+		    >= sizeof(s->username))
+			s->flags |= SF_USERTOOLONG;
 
 		smtp_enter_state(s, STATE_AUTH_PASSWORD);
 		smtp_reply(s, "334 UGFzc3dvcmQ6");

File Deleted: pkgsrc/mail/opensmtpd/patches/Attic/patch-smtpd_Makefile.am

File Deleted: pkgsrc/mail/opensmtpd/patches/Attic/patch-smtpd_queue_fsqueue.c