From owner-svn-ports-all@freebsd.org Mon Feb 22 12:21:24 2016 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43681AB0ABC; Mon, 22 Feb 2016 12:21:24 +0000 (UTC) (envelope-from ashish@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 063B51F38; Mon, 22 Feb 2016 12:21:23 +0000 (UTC) (envelope-from ashish@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1MCLNtT047441; Mon, 22 Feb 2016 12:21:23 GMT (envelope-from ashish@FreeBSD.org) Received: (from ashish@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1MCLMm7047433; Mon, 22 Feb 2016 12:21:22 GMT (envelope-from ashish@FreeBSD.org) Message-Id: <201602221221.u1MCLMm7047433@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ashish set sender to ashish@FreeBSD.org using -f From: Ashish SHUKLA Date: Mon, 22 Feb 2016 12:21:22 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r409336 - in head/mail/opensmtpd-devel: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2016 12:21:24 -0000 Author: ashish Date: Mon Feb 22 12:21:22 2016 New Revision: 409336 URL: https://svnweb.freebsd.org/changeset/ports/409336 Log: - Update to 201602131907[1] - Switch to using DISTVERSIONSUFFIX[1] - Add SSL_PORT option to specify if OpenSSL from ports is to be used[1] - Enforce SSL_PORT for 9.x[1] - Cleanup OPTIONS[1] - Remove unnecessary diffs[1] - Add diff to handle long usernames (from mail/opensmtpd) - Mark smtpctl binary as setgid for offline mail queuing to work (reported/committed upstream) - Explicitly create symlink for makemap, as mailwrapper does not seem to manage the symlink - Fix rc.d script as process name has been changed PR: 206357 Submitted by: Andrey Fesenko [1] Added: head/mail/opensmtpd-devel/files/patch-usernamelen (contents, props changed) head/mail/opensmtpd-devel/files/pkg-message.in (contents, props changed) Deleted: head/mail/opensmtpd-devel/files/patch-openbsd-compat_defines.h Modified: head/mail/opensmtpd-devel/Makefile head/mail/opensmtpd-devel/distinfo head/mail/opensmtpd-devel/files/patch-mk_smtpd_Makefile.in head/mail/opensmtpd-devel/files/pkg-install.in head/mail/opensmtpd-devel/files/smtpd.in head/mail/opensmtpd-devel/pkg-plist Modified: head/mail/opensmtpd-devel/Makefile ============================================================================== --- head/mail/opensmtpd-devel/Makefile Mon Feb 22 12:15:55 2016 (r409335) +++ head/mail/opensmtpd-devel/Makefile Mon Feb 22 12:21:22 2016 (r409336) @@ -2,13 +2,13 @@ # $FreeBSD$ PORTNAME= opensmtpd -PORTVERSION= 201506112227 +PORTVERSION= 201602131907 +DISTVERSIONSUFFIX= p1 PORTEPOCH= 1 CATEGORIES= mail MASTER_SITES= http://www.opensmtpd.org/archives/ \ http://distfiles.pirateparty.in/ashish/ PKGNAMESUFFIX= -devel -DISTNAME= ${PORTNAME}-${PORTVERSION}p1 MAINTAINER= ashish@FreeBSD.org COMMENT= Security- and simplicity-focused SMTP server from OpenBSD @@ -18,17 +18,24 @@ LICENSE_FILE= ${WRKSRC}/LICENSE LIB_DEPENDS= libevent.so:${PORTSDIR}/devel/libevent2 -OPTIONS_DEFINE= CA_BUNDLE LIBASR MAILERCONF +OPTIONS_DEFINE= CA_BUNDLE LIBASR MAILERCONF PAM SSL_PORT OPTIONS_DEFAULT= CA_BUNDLE PAM -CA_BUNDLE_DESC= Install CA bundle for OpenSSL -LIBASR_DESC= Use stable version of libasr +CA_BUNDLE_DESC= Install CA bundle for SSL +LIBASR_DESC= Use stable version of libasr MAILERCONF_DESC= Activate OpenSMTPD in mailer.conf(5) +SSL_PORT_DESC= SSL/TLS support via OpenSSL/LibreSSL from port +USES= cpe libtool +USE_OPENSSL= yes GNU_CONFIGURE= yes -CONFIGURE_ARGS= --with-libevent-dir=${LOCALBASE} --sysconfdir=${PREFIX}/etc/mail/ \ - --with-mailwrapper --with-ssl-dir=${OPENSSLBASE} --enable-table-db +CONFIGURE_ARGS= --with-table-db \ + --sysconfdir=${PREFIX}/etc/mail/ \ + --with-libasr=${LOCALBASE} \ + --with-libevent=${LOCALBASE} \ + --with-libssl=${OPENSSLBASE} \ + --with-group-queue=${GROUPS} USE_RC_SUBR= smtpd SUB_FILES= pkg-install pkg-deinstall @@ -38,18 +45,29 @@ CONFLICTS_INSTALL= postfix-[0-9]* sendma USERS= _smtpd _smtpq GROUPS= _smtpd +PLIST_SUB+= SMTPQ_GROUP=${GROUPS} + OPTIONS_SUB= yes LIBASR_LIB_DEPENDS_OFF= libasr.so:${PORTSDIR}/dns/libasr-devel LIBASR_LIB_DEPENDS= libasr.so:${PORTSDIR}/dns/libasr -CA_BUNDLE_CONFIGURE_ON= --with-ca-file=${LOCALBASE}/share/certs/ca-root-nss.crt +CA_BUNDLE_CONFIGURE_WITH= path-CAfile=${LOCALBASE}/share/certs/ca-root-nss.crt CA_BUNDLE_RUN_DEPENDS= ${LOCALBASE}/share/certs/ca-root-nss.crt:${PORTSDIR}/security/ca_root_nss -USE_OPENSSL= yes +PAM_CONFIGURE_WITH= auth-pam=smtpd + +.include + +.if ${OPSYS} == FreeBSD && ${OSVERSION} < 1000000 && ! ${PORT_OPTIONS:MSSL_PORT} +WITH_OPENSSL_PORT= yes +.endif + +.if ${PORT_OPTIONS:MSSL_PORT} WITH_OPENSSL_PORT= yes +.endif -post-deinstall: - @${SETENV} ${SCRIPTS_ENV} ${SH} ${PKGINSTALL} ${PKGNAME} POST-DEINSTALL +post-install: + @${LN} -sf ${PREFIX}/sbin/smtpctl ${STAGEDIR}${PREFIX}/libexec/opensmtpd/makemap .include Modified: head/mail/opensmtpd-devel/distinfo ============================================================================== --- head/mail/opensmtpd-devel/distinfo Mon Feb 22 12:15:55 2016 (r409335) +++ head/mail/opensmtpd-devel/distinfo Mon Feb 22 12:21:22 2016 (r409336) @@ -1,2 +1,2 @@ -SHA256 (opensmtpd-201506112227p1.tar.gz) = f938796d2655f554e695adff6a3f3bbc4b1326912327b98acc7e29f705b9cf63 -SIZE (opensmtpd-201506112227p1.tar.gz) = 706259 +SHA256 (opensmtpd-201602131907p1.tar.gz) = 0fd10cff59719523e41fe489ff5c1490c2898a2ce47b98e4bf39f07ba3562252 +SIZE (opensmtpd-201602131907p1.tar.gz) = 686726 Modified: head/mail/opensmtpd-devel/files/patch-mk_smtpd_Makefile.in ============================================================================== --- head/mail/opensmtpd-devel/files/patch-mk_smtpd_Makefile.in Mon Feb 22 12:15:55 2016 (r409335) +++ head/mail/opensmtpd-devel/files/patch-mk_smtpd_Makefile.in Mon Feb 22 12:21:22 2016 (r409336) @@ -1,6 +1,6 @@ ---- mk/smtpd/Makefile.in.orig 2015-06-20 04:17:57.656811000 +0000 -+++ mk/smtpd/Makefile.in 2015-06-20 04:19:53.711103000 +0000 -@@ -1366,11 +1366,7 @@ install-exec-hook: $(CONFIGFILES) $(MANP +--- mk/smtpd/Makefile.in.orig 2016-02-07 00:04:24 UTC ++++ mk/smtpd/Makefile.in +@@ -1339,12 +1339,7 @@ install-exec-hook: $(CONFIGFILES) $(MANP $(MKDIR_P) $(DESTDIR)$(mandir)/$(mansubdir)5 $(MKDIR_P) $(DESTDIR)$(mandir)/$(mansubdir)8 @@ -9,7 +9,8 @@ - else \ - echo "$(DESTDIR)$(sysconfdir)/smtpd.conf already exists, install will not overwrite"; \ - fi -+ $(INSTALL) -m 644 smtpd.conf.out $(DESTDIR)$(sysconfdir)/smtpd.conf.sample - +- ++ $(INSTALL) -m 644 smtpd.conf.out $(DESTDIR)$(sysconfdir)/smtpd.conf.sample $(INSTALL) -m 644 aliases.5.out $(DESTDIR)$(mandir)/$(mansubdir)5/aliases.5 $(INSTALL) -m 644 forward.5.out $(DESTDIR)$(mandir)/$(mansubdir)5/forward.5 + $(INSTALL) -m 644 table.5.out $(DESTDIR)$(mandir)/$(mansubdir)5/table.5 Added: head/mail/opensmtpd-devel/files/patch-usernamelen ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/mail/opensmtpd-devel/files/patch-usernamelen Mon Feb 22 12:21:22 2016 (r409336) @@ -0,0 +1,52 @@ +diff --git a/smtpd/smtp_session.c b/smtpd/smtp_session.c +index 3a0ca2a..404ee50 100644 +--- smtpd/smtp_session.c ++++ 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 { +@@ -990,6 +991,15 @@ smtp_session_imsg(struct mproc *p, struct imsg *imsg) + + 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 ", +@@ -1929,7 +1939,7 @@ smtp_rfc4954_auth_plain(struct smtp_session *s, char *arg) + 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) +@@ -1969,9 +1979,12 @@ smtp_rfc4954_auth_login(struct smtp_session *s, char *arg) + + 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"); Modified: head/mail/opensmtpd-devel/files/pkg-install.in ============================================================================== --- head/mail/opensmtpd-devel/files/pkg-install.in Mon Feb 22 12:15:55 2016 (r409335) +++ head/mail/opensmtpd-devel/files/pkg-install.in Mon Feb 22 12:21:22 2016 (r409336) @@ -9,8 +9,8 @@ if [ "$TARGET" = POST-INSTALL -a -z "%%M sendmail %%PREFIX%%/sbin/smtpctl send-mail %%PREFIX%%/sbin/smtpctl mailq %%PREFIX%%/sbin/smtpctl -makemap %%PREFIX%%/libexec/opensmtpd/makemap -newaliases %%PREFIX%%/libexec/opensmtpd/makemap +makemap %%PREFIX%%/sbin/smtpctl +newaliases %%PREFIX%%/sbin/smtpctl EOF fi Added: head/mail/opensmtpd-devel/files/pkg-message.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/mail/opensmtpd-devel/files/pkg-message.in Mon Feb 22 12:21:22 2016 (r409336) @@ -0,0 +1,18 @@ +If you are upgrading from OpenSMTPD version 201303011853 or earlier, please +follow the procedure below to update the permissions on the OpenSMTPD +spool directories: + + 1. Stop 'smtpd' service: + + # %%PREFIX%%/etc/rc.d/smtpd stop + + 2. Update permissions: + + # chown -R _smtpq:wheel /var/spool/smtpd/corrupt + # chown -R _smtpq:wheel /var/spool/smtpd/purge + # chown -R _smtpq:wheel /var/spool/smtpd/queue + # chown -R _smtpq:wheel /var/spool/smtpd/temporary + + 3. Start 'smtpd' service: + + # %%PREFIX%%/etc/rc.d/smtpd start Modified: head/mail/opensmtpd-devel/files/smtpd.in ============================================================================== --- head/mail/opensmtpd-devel/files/smtpd.in Mon Feb 22 12:15:55 2016 (r409335) +++ head/mail/opensmtpd-devel/files/smtpd.in Mon Feb 22 12:21:22 2016 (r409336) @@ -20,7 +20,7 @@ check_process() { - /bin/pgrep -j none -f 'smtpd: \[priv\]' + /bin/pgrep -j none -f "^$smtpd_procname\$" } name="smtpd" Modified: head/mail/opensmtpd-devel/pkg-plist ============================================================================== --- head/mail/opensmtpd-devel/pkg-plist Mon Feb 22 12:15:55 2016 (r409335) +++ head/mail/opensmtpd-devel/pkg-plist Mon Feb 22 12:21:22 2016 (r409336) @@ -1,15 +1,15 @@ -etc/mail/smtpd.conf.sample +@sample etc/mail/smtpd.conf.sample +libexec/opensmtpd/encrypt libexec/opensmtpd/mail.local libexec/opensmtpd/makemap -libexec/opensmtpd/encrypt -sbin/smtpctl +@(,%%SMTPQ_GROUP%%,2555) sbin/smtpctl sbin/smtpd +man/man5/aliases.5.gz +man/man5/forward.5.gz +man/man5/smtpd.conf.5.gz +man/man5/table.5.gz +man/man8/makemap.8.gz man/man8/newaliases.8.gz man/man8/sendmail.8.gz -man/man8/smtpd.8.gz -man/man8/makemap.8.gz man/man8/smtpctl.8.gz -man/man5/table.5.gz -man/man5/smtpd.conf.5.gz -man/man5/forward.5.gz -man/man5/aliases.5.gz +man/man8/smtpd.8.gz