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 onlydiff -r1.7 -r1.8 pkgsrc/mail/opensmtpd/Makefile
(mef)
@@ -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 | |||
3 | VERSION= 5.3.3p1 | 3 | VERSION= 5.7.3p2 | |
4 | DISTNAME= opensmtpd-${VERSION} | 4 | DISTNAME= opensmtpd-${VERSION} | |
5 | PKGREVISION= 2 | |||
6 | CATEGORIES= mail net | 5 | CATEGORIES= mail net | |
7 | MASTER_SITES= http://www.opensmtpd.org/archives/ | 6 | MASTER_SITES= http://www.opensmtpd.org/archives/ | |
8 | 7 | |||
9 | MAINTAINER= ftigeot@wolfpond.org | 8 | MAINTAINER= ftigeot@wolfpond.org | |
10 | HOMEPAGE= http://www.opensmtpd.org/ | 9 | HOMEPAGE= http://www.opensmtpd.org/ | |
11 | COMMENT= The OpenSMTPD mail transfer agent, a replacement for sendmail | 10 | COMMENT= The OpenSMTPD mail transfer agent, a replacement for sendmail | |
12 | LICENSE= isc AND modified-bsd AND 2-clause-bsd | 11 | LICENSE= isc AND modified-bsd AND 2-clause-bsd | |
13 | 12 | |||
14 | CONFLICTS+= courier-mta-[0-9]* fastforward>=0.51nb2 sendmail-[0-9]* | 13 | CONFLICTS+= courier-mta-[0-9]* fastforward>=0.51nb2 sendmail-[0-9]* | |
15 | CONFLICTS+= esmtp>=1.2 nullmailer-[0-9]* postfix-[0-9]* | 14 | CONFLICTS+= esmtp>=1.2 nullmailer-[0-9]* postfix-[0-9]* | |
16 | BROKEN_FOR_PLATFORM+= OpenBSD-*-* | 15 | BROKEN_FOR_PLATFORM= OpenBSD-*-* | |
17 | 16 | |||
18 | BUILD_DEFS+= VARBASE | 17 | BUILD_DEFS+= VARBASE | |
19 | 18 | |||
20 | USE_LANGUAGES= c | 19 | USE_LANGUAGES= c | |
21 | USE_LIBTOOL= yes | 20 | USE_LIBTOOL= yes | |
22 | USE_TOOLS+= pkg-config yacc | 21 | USE_TOOLS+= pkg-config yacc | |
23 | USE_TOOLS+= automake aclocal autoheader autoconf | 22 | USE_TOOLS+= automake aclocal autoheader autoconf | |
24 | 23 | |||
25 | SMTPD_HOME= ${VARBASE}/chroot/smtpd | 24 | SMTPD_HOME= ${VARBASE}/chroot/smtpd | |
26 | OWN_DIRS= ${SMTPD_HOME} | 25 | OWN_DIRS= ${SMTPD_HOME} | |
27 | 26 | |||
28 | PKG_GROUPS= _smtpd | 27 | PKG_GROUPS= _smtpd _smtpq | |
29 | PKG_USERS= _smtpd:_smtpd | 28 | PKG_USERS= _smtpd:_smtpd _smtpq:_smtpq | |
30 | PKG_GECOS._smtpd= OpenSMTPD pseudo-user | 29 | PKG_GECOS._smtpd= OpenSMTPD pseudo-user | |
31 | PKG_HOME._smtpd= ${SMTPD_HOME} | 30 | PKG_HOME._smtpd= ${SMTPD_HOME} | |
31 | PKG_GECOS._smtpq= OpenSMTPD pseudo-user | |||
32 | PKG_HOME._smtpq= ${SMTPD_HOME} | |||
32 | 33 | |||
33 | GNU_CONFIGURE= yes | 34 | GNU_CONFIGURE= yes | |
35 | USE_DB185= yes | |||
36 | CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR:Q} | |||
37 | CONFIGURE_ARGS+= --with-mantype=man | |||
38 | CONFIGURE_ARGS+= --with-privsep-path=${SMTPD_HOME} | |||
39 | CONFIGURE_ARGS+= --with-ssl-dir=${SSLBASE:Q} | |||
40 | CONFIGURE_ARGS+= --enable-table-db | |||
41 | CONFIGURE_ARGS+= --without-zlib-version-check | |||
34 | 42 | |||
35 | EXAMPLEDIR= ${PREFIX}/share/examples/opensmtpd | 43 | EXAMPLEDIR= ${PREFIX}/share/examples/opensmtpd | |
36 | CONF_FILES= ${EXAMPLEDIR}/smtpd.conf ${PKG_SYSCONFDIR}/smtpd.conf | 44 | CONF_FILES= ${EXAMPLEDIR}/smtpd.conf ${PKG_SYSCONFDIR}/smtpd.conf | |
37 | 45 | |||
38 | RCD_SCRIPTS= opensmtpd | 46 | RCD_SCRIPTS= opensmtpd | |
39 | 47 | |||
40 | SUBST_CLASSES+= paths | 48 | SUBST_CLASSES+= paths | |
41 | SUBST_FILES.paths= ${WRKDIR}/mailer.conf | 49 | SUBST_FILES.paths= ${WRKDIR}/mailer.conf | |
42 | SUBST_SED.paths+= -e 's,@PREFIX@,${PREFIX},g' | 50 | SUBST_SED.paths+= -e 's,@PREFIX@,${PREFIX},g' | |
43 | SUBST_STAGE.paths= post-patch | 51 | SUBST_STAGE.paths= post-patch | |
44 | 52 | |||
45 | SUBST_CLASSES+= exampledir | 53 | SUBST_CLASSES+= exampledir | |
46 | SUBST_STAGE.exampledir= pre-configure | 54 | SUBST_STAGE.exampledir= pre-configure | |
47 | SUBST_MESSAGE.exampledir= Fixing exampledir path | 55 | SUBST_MESSAGE.exampledir= Fixing exampledir path | |
48 | SUBST_FILES.exampledir= smtpd/Makefile.am | 56 | SUBST_FILES.exampledir= mk/smtpd/Makefile.am | |
49 | SUBST_SED.exampledir+= -e 's,@EXAMPLE_DIR@,${EXAMPLEDIR},' | 57 | SUBST_SED.exampledir+= -e 's,@EXAMPLE_DIR@,${EXAMPLEDIR},' | |
50 | 58 | |||
51 | post-extract: | 59 | post-extract: | |
52 | cp ${FILESDIR}/mailer.conf ${WRKDIR}/mailer.conf | 60 | cp ${FILESDIR}/mailer.conf ${WRKDIR}/mailer.conf | |
53 | 61 | |||
54 | pre-configure: | 62 | pre-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 | |||
61 | post-install: | 69 | post-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" |
@@ -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 $ | |
2 | bin/mailq | 2 | bin/sendmail | |
3 | bin/newaliases | 3 | libexec/opensmtpd/encrypt | |
4 | bin/smtpscript | 4 | libexec/opensmtpd/mail.local | |
5 | libexec/mail.local | |||
6 | libexec/opensmtpd/makemap | |||
7 | man/man5/aliases.5 | 5 | man/man5/aliases.5 | |
8 | man/man5/forward.5 | 6 | man/man5/forward.5 | |
9 | man/man5/smtpd.conf.5 | 7 | man/man5/smtpd.conf.5 | |
8 | man/man5/table.5 | |||
10 | man/man8/makemap.8 | 9 | man/man8/makemap.8 | |
11 | man/man8/newaliases.8 | 10 | man/man8/newaliases.8 | |
11 | man/man8/sendmail.8 | |||
12 | man/man8/smtpctl.8 | 12 | man/man8/smtpctl.8 | |
13 | man/man8/smtpd.8 | 13 | man/man8/smtpd.8 | |
14 | sbin/mailq | |||
14 | sbin/makemap | 15 | sbin/makemap | |
16 | sbin/newaliases | |||
15 | sbin/smtpctl | 17 | sbin/smtpctl | |
16 | sbin/smtpd | 18 | sbin/smtpd | |
17 | share/examples/opensmtpd/mailer.conf | 19 | share/examples/opensmtpd/mailer.conf | |
18 | share/examples/opensmtpd/smtpd.conf | 20 | share/examples/opensmtpd/smtpd.conf |
@@ -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 | |||
3 | SHA1 (opensmtpd-5.3.3p1.tar.gz) = a7fc3a15b5dc622410fcedf51bbe62e6b6d64df3 | 3 | SHA1 (opensmtpd-5.7.3p2.tar.gz) = 4d1edc5811a80ec26de040227a298a742c494e72 | |
4 | RMD160 (opensmtpd-5.3.3p1.tar.gz) = 97f63e37fa6ce1f5f58d816088c5b356f99167c3 | 4 | RMD160 (opensmtpd-5.7.3p2.tar.gz) = 5d6faebea3a303e5effeafbef5def597bfac434e | |
5 | SHA512 (opensmtpd-5.3.3p1.tar.gz) = 8ea72773dca4f907d2b8285fc7abcd5c4c19ceb50b547cc4a217ec296a222f8134bfc4bc7707439b0c5d58b5354f92ebed65966179d7598c4793cad4370b087b | 5 | SHA512 (opensmtpd-5.7.3p2.tar.gz) = bac0b8d6a6969a5e49a1d45b2c74cb2f3da44d06b12c7162500adf3ca312751020762bc8301075a9d7634d94cf51f978d04fac327f843680646e9e687737c42f | |
6 | Size (opensmtpd-5.3.3p1.tar.gz) = 343733 bytes | 6 | Size (opensmtpd-5.7.3p2.tar.gz) = 709074 bytes | |
7 | SHA1 (patch-configure.ac) = ed819952951700c057c11200095a72972aafc1f9 | 7 | SHA1 (patch-configure.ac) = bcf442cf536b44019d25a1e4e9ac2812fc76d928 | |
8 | SHA1 (patch-smtpd_Makefile.am) = 4267002ecadceaf68868b9d782d5e6f8571ebc36 | 8 | SHA1 (patch-mk_smtpd_Makefile.am) = ebc62819300d3ddd824178c08a5630ca85dc6fdc | |
9 | SHA1 (patch-smtpd_queue_fsqueue.c) = 80dae37705378c022c1a76d31ea54a3f907b6c1a | 9 | SHA1 (patch-smtpd_queue__fs.c) = f13d1bf1d26544b3c81e5e2c813d2fe5e917b96b | |
10 | SHA1 (patch-smtpd_smtp__session.c) = f9c034827519a02b97cadb3c034ad1e84abc805a |
@@ -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 | # | |
5 | sendmail @PREFIX@/libexec/mail.local | 5 | sendmail @PREFIX@/sbin/smtpctl | |
6 | mailq @PREFIX@/bin/mailq | 6 | send-mail @PREFIX@/sbin/smtpctl | |
7 | newaliases @PREFIX@/bin/newaliases | 7 | mailq @PREFIX@/sbin/mailq | |
8 | makemap @PREFIX@/sbin/makemap | |||
9 | newaliases @PREFIX@/sbin/newaliases |
@@ -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 | |||
3 | Add sys/statvfs for NetBSD | 3 | Add 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 \ |
$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
$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>
$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");