diff options
author | ashish <ashish@FreeBSD.org> | 2016-02-22 20:21:22 +0800 |
---|---|---|
committer | ashish <ashish@FreeBSD.org> | 2016-02-22 20:21:22 +0800 |
commit | 135cec0844429eee8a98a45317647c173e794c5d (patch) | |
tree | 437c814acd16805900b1a173b949384dfa22b81a /mail | |
parent | 187660d01d32b027f43bcef723773a85c08e7042 (diff) | |
download | freebsd-ports-gnome-135cec0844429eee8a98a45317647c173e794c5d.tar.gz freebsd-ports-gnome-135cec0844429eee8a98a45317647c173e794c5d.tar.zst freebsd-ports-gnome-135cec0844429eee8a98a45317647c173e794c5d.zip |
- 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 <andrey at bsdnir dot info>[1]
Diffstat (limited to 'mail')
-rw-r--r-- | mail/opensmtpd-devel/Makefile | 40 | ||||
-rw-r--r-- | mail/opensmtpd-devel/distinfo | 4 | ||||
-rw-r--r-- | mail/opensmtpd-devel/files/patch-mk_smtpd_Makefile.in | 11 | ||||
-rw-r--r-- | mail/opensmtpd-devel/files/patch-openbsd-compat_defines.h | 17 | ||||
-rw-r--r-- | mail/opensmtpd-devel/files/patch-usernamelen | 52 | ||||
-rw-r--r-- | mail/opensmtpd-devel/files/pkg-install.in | 4 | ||||
-rw-r--r-- | mail/opensmtpd-devel/files/pkg-message.in | 18 | ||||
-rw-r--r-- | mail/opensmtpd-devel/files/smtpd.in | 2 | ||||
-rw-r--r-- | mail/opensmtpd-devel/pkg-plist | 18 |
9 files changed, 119 insertions, 47 deletions
diff --git a/mail/opensmtpd-devel/Makefile b/mail/opensmtpd-devel/Makefile index 4eef13f60d34..54451f848e66 100644 --- a/mail/opensmtpd-devel/Makefile +++ b/mail/opensmtpd-devel/Makefile @@ -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]* sendmail-[0-9]* opensmtpd-[0-9]* 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 <bsd.port.options.mk> + +.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 <bsd.port.mk> diff --git a/mail/opensmtpd-devel/distinfo b/mail/opensmtpd-devel/distinfo index 0e07e5952fc0..63f463193440 100644 --- a/mail/opensmtpd-devel/distinfo +++ b/mail/opensmtpd-devel/distinfo @@ -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 diff --git a/mail/opensmtpd-devel/files/patch-mk_smtpd_Makefile.in b/mail/opensmtpd-devel/files/patch-mk_smtpd_Makefile.in index 88c5fd2d93aa..c8fcdad57bc0 100644 --- a/mail/opensmtpd-devel/files/patch-mk_smtpd_Makefile.in +++ b/mail/opensmtpd-devel/files/patch-mk_smtpd_Makefile.in @@ -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 diff --git a/mail/opensmtpd-devel/files/patch-openbsd-compat_defines.h b/mail/opensmtpd-devel/files/patch-openbsd-compat_defines.h deleted file mode 100644 index bbff8ea5ff20..000000000000 --- a/mail/opensmtpd-devel/files/patch-openbsd-compat_defines.h +++ /dev/null @@ -1,17 +0,0 @@ -Fix for a build failure, taken from - -http://article.gmane.org/gmane.mail.opensmtpd.general/2291 - ---- openbsd-compat/defines.h.orig -+++ openbsd-compat/defines.h -@@ -79,6 +79,10 @@ - # define MAXHOSTNAMELEN 64 - #endif - -+#ifndef HOST_NAME_MAX -+# define HOST_NAME_MAX 255 -+#endif -+ - #ifndef LOGIN_NAME_MAX - # define LOGIN_NAME_MAX 9 - #endif diff --git a/mail/opensmtpd-devel/files/patch-usernamelen b/mail/opensmtpd-devel/files/patch-usernamelen new file mode 100644 index 000000000000..e5e5330d14e5 --- /dev/null +++ b/mail/opensmtpd-devel/files/patch-usernamelen @@ -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"); diff --git a/mail/opensmtpd-devel/files/pkg-install.in b/mail/opensmtpd-devel/files/pkg-install.in index 07f1a67957df..b19e4c261d08 100644 --- a/mail/opensmtpd-devel/files/pkg-install.in +++ b/mail/opensmtpd-devel/files/pkg-install.in @@ -9,8 +9,8 @@ if [ "$TARGET" = POST-INSTALL -a -z "%%MAILERCONF%%" ]; then 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 diff --git a/mail/opensmtpd-devel/files/pkg-message.in b/mail/opensmtpd-devel/files/pkg-message.in new file mode 100644 index 000000000000..52ac5365641b --- /dev/null +++ b/mail/opensmtpd-devel/files/pkg-message.in @@ -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 diff --git a/mail/opensmtpd-devel/files/smtpd.in b/mail/opensmtpd-devel/files/smtpd.in index e887f7d6c170..5530b1c2b14d 100644 --- a/mail/opensmtpd-devel/files/smtpd.in +++ b/mail/opensmtpd-devel/files/smtpd.in @@ -20,7 +20,7 @@ check_process() { - /bin/pgrep -j none -f 'smtpd: \[priv\]' + /bin/pgrep -j none -f "^$smtpd_procname\$" } name="smtpd" diff --git a/mail/opensmtpd-devel/pkg-plist b/mail/opensmtpd-devel/pkg-plist index 8c6fb3836738..2c65ebf2f93c 100644 --- a/mail/opensmtpd-devel/pkg-plist +++ b/mail/opensmtpd-devel/pkg-plist @@ -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 |