mirror of
https://git.freebsd.org/ports.git
synced 2025-06-03 03:46:30 -04:00
- Update to 201605221711[1]
- Add option for table db (aliases)[1] - Add CPE information[1] PR: 209770[1] 208991 Submitted by: fluffy[1]
This commit is contained in:
parent
17b47f0c0e
commit
e0af6de415
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=416133
5 changed files with 42 additions and 86 deletions
|
@ -2,7 +2,7 @@
|
||||||
# $FreeBSD$
|
# $FreeBSD$
|
||||||
|
|
||||||
PORTNAME= opensmtpd
|
PORTNAME= opensmtpd
|
||||||
PORTVERSION= 201602131907
|
PORTVERSION= 201605221711
|
||||||
DISTVERSIONSUFFIX= p1
|
DISTVERSIONSUFFIX= p1
|
||||||
PORTEPOCH= 1
|
PORTEPOCH= 1
|
||||||
PORTREVISION= 1
|
PORTREVISION= 1
|
||||||
|
@ -19,58 +19,65 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
|
||||||
|
|
||||||
LIB_DEPENDS= libevent.so:devel/libevent2
|
LIB_DEPENDS= libevent.so:devel/libevent2
|
||||||
|
|
||||||
OPTIONS_DEFINE= CA_BUNDLE LIBASR MAILERCONF PAM SSL_PORT
|
OPTIONS_DEFINE= CA_BUNDLE LIBASR MAILERCONF PAM SSL_PORT TABLE_DB
|
||||||
|
|
||||||
OPTIONS_DEFAULT= CA_BUNDLE PAM
|
OPTIONS_DEFAULT= CA_BUNDLE PAM TABLE_DB
|
||||||
|
|
||||||
CA_BUNDLE_DESC= Install CA bundle for SSL
|
CA_BUNDLE_DESC= Install CA bundle for SSL
|
||||||
LIBASR_DESC= Use stable version of libasr
|
LIBASR_DESC= Use stable version of libasr
|
||||||
MAILERCONF_DESC= Activate OpenSMTPD in mailer.conf(5)
|
MAILERCONF_DESC= Activate OpenSMTPD in mailer.conf(5)
|
||||||
SSL_PORT_DESC= SSL/TLS support via OpenSSL/LibreSSL from port
|
SSL_PORT_DESC= SSL/TLS support via OpenSSL/LibreSSL from port
|
||||||
|
TABLE_DB_DESC= Build table-db plugin (aliases)
|
||||||
|
|
||||||
USES= cpe libtool
|
USES= cpe libtool
|
||||||
USE_OPENSSL= yes
|
USE_OPENSSL= yes
|
||||||
GNU_CONFIGURE= yes
|
GNU_CONFIGURE= yes
|
||||||
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
|
|
||||||
|
|
||||||
CPE_VENDOR= openbsd
|
CPE_VENDOR= openbsd
|
||||||
|
|
||||||
|
USE_RC_SUBR= smtpd
|
||||||
|
SUB_FILES= pkg-install pkg-deinstall pkg-message
|
||||||
|
|
||||||
CONFLICTS_INSTALL= postfix-[0-9]* sendmail-[0-9]* opensmtpd-[0-9]*
|
CONFLICTS_INSTALL= postfix-[0-9]* sendmail-[0-9]* opensmtpd-[0-9]*
|
||||||
|
|
||||||
USERS= _smtpd _smtpq
|
USERS= _smtpd _smtpq
|
||||||
GROUPS= _smtpd
|
GROUPS= _smtpd _smtpq
|
||||||
|
|
||||||
PLIST_SUB+= SMTPQ_GROUP=${GROUPS}
|
OPTIONS_SUB= yes
|
||||||
|
|
||||||
OPTIONS_SUB= yes
|
|
||||||
|
|
||||||
LIBASR_LIB_DEPENDS_OFF= libasr.so:dns/libasr-devel
|
|
||||||
LIBASR_LIB_DEPENDS= libasr.so:dns/libasr
|
|
||||||
|
|
||||||
CA_BUNDLE_CONFIGURE_WITH= path-CAfile=${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:security/ca_root_nss
|
CA_BUNDLE_RUN_DEPENDS= ${LOCALBASE}/share/certs/ca-root-nss.crt:security/ca_root_nss
|
||||||
|
|
||||||
|
LIBASR_LIB_DEPENDS= libasr.so:dns/libasr
|
||||||
|
LIBASR_LIB_DEPENDS_OFF= libasr.so:dns/libasr-devel
|
||||||
|
|
||||||
PAM_CONFIGURE_WITH= auth-pam=smtpd
|
PAM_CONFIGURE_WITH= auth-pam=smtpd
|
||||||
|
SSL_PORT_VARS= with_openssl_port=yes
|
||||||
|
TABLE_DB_CONFIGURE_WITH= table-db
|
||||||
|
|
||||||
.include <bsd.port.options.mk>
|
.include <bsd.port.options.mk>
|
||||||
|
|
||||||
.if ${OPSYS} == FreeBSD && ${OSVERSION} < 1000000 && ! ${PORT_OPTIONS:MSSL_PORT}
|
.if ${OPSYS} == FreeBSD && ${OSVERSION} <= 1000015
|
||||||
WITH_OPENSSL_PORT= yes
|
WITH_OPENSSL_PORT= yes
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
.if ${PORT_OPTIONS:MSSL_PORT}
|
.include <bsd.port.pre.mk>
|
||||||
WITH_OPENSSL_PORT= yes
|
|
||||||
.endif
|
|
||||||
|
|
||||||
|
CONFIGURE_ARGS+= --with-libasr=${LOCALBASE} \
|
||||||
|
--with-libevent=${LOCALBASE} \
|
||||||
|
--with-libssl=${OPENSSLBASE} \
|
||||||
|
--sysconfdir=${PREFIX}/etc/mail/
|
||||||
|
|
||||||
|
post-patch:
|
||||||
|
${REINPLACE_CMD} -e '/chmod 2555/d' ${WRKSRC}/mk/smtpctl/Makefile.in
|
||||||
|
# https://github.com/OpenSMTPD/OpenSMTPD/issues/700
|
||||||
|
${REINPLACE_CMD} -r -e \
|
||||||
|
'/SMTPD_VERSION/s/"[^"]+"$$/"${PORTVERSION}${DISTVERSIONSUFFIX}"/' \
|
||||||
|
${WRKSRC}/smtpd/smtpd.h
|
||||||
|
|
||||||
|
.if ${PORT_OPTIONS:MTABLE_DB}
|
||||||
post-install:
|
post-install:
|
||||||
@${LN} -sf ${PREFIX}/sbin/smtpctl ${STAGEDIR}${PREFIX}/libexec/opensmtpd/makemap
|
@${LN} -sf ${PREFIX}/sbin/smtpctl ${STAGEDIR}${PREFIX}/libexec/opensmtpd/makemap
|
||||||
|
.endif
|
||||||
|
|
||||||
.include <bsd.port.mk>
|
.include <bsd.port.post.mk>
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
SHA256 (opensmtpd-201602131907p1.tar.gz) = 0fd10cff59719523e41fe489ff5c1490c2898a2ce47b98e4bf39f07ba3562252
|
SHA256 (opensmtpd-201605221711p1.tar.gz) = e7f63a4d5c26386cffe61f35d6e4a959a1f6f38b3fbe0351c746326cf2329418
|
||||||
SIZE (opensmtpd-201602131907p1.tar.gz) = 686726
|
SIZE (opensmtpd-201605221711p1.tar.gz) = 691693
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
--- mk/smtpd/Makefile.in.orig 2016-02-07 00:04:24 UTC
|
--- mk/smtpd/Makefile.in.orig 2016-02-02 20:40:51 UTC
|
||||||
+++ mk/smtpd/Makefile.in
|
+++ mk/smtpd/Makefile.in
|
||||||
@@ -1339,12 +1339,7 @@ install-exec-hook: $(CONFIGFILES) $(MANP
|
@@ -1365,13 +1365,7 @@ install-exec-hook: $(CONFIGFILES) $(MANP
|
||||||
|
$(MKDIR_P) $(DESTDIR)$(bindir)
|
||||||
$(MKDIR_P) $(DESTDIR)$(mandir)/$(mansubdir)5
|
$(MKDIR_P) $(DESTDIR)$(mandir)/$(mansubdir)5
|
||||||
$(MKDIR_P) $(DESTDIR)$(mandir)/$(mansubdir)8
|
$(MKDIR_P) $(DESTDIR)$(mandir)/$(mansubdir)8
|
||||||
|
-
|
||||||
- @if [ ! -f $(DESTDIR)$(sysconfdir)/smtpd.conf ]; then \
|
- @if [ ! -f $(DESTDIR)$(sysconfdir)/smtpd.conf ]; then \
|
||||||
- $(INSTALL) -m 644 smtpd.conf.out $(DESTDIR)$(sysconfdir)/smtpd.conf; \
|
- $(INSTALL) -m 644 smtpd.conf.out $(DESTDIR)$(sysconfdir)/smtpd.conf; \
|
||||||
- else \
|
- else \
|
||||||
|
|
|
@ -1,52 +0,0 @@
|
||||||
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");
|
|
|
@ -1,15 +1,15 @@
|
||||||
@sample etc/mail/smtpd.conf.sample
|
@sample etc/mail/smtpd.conf.sample
|
||||||
libexec/opensmtpd/encrypt
|
libexec/opensmtpd/encrypt
|
||||||
libexec/opensmtpd/mail.local
|
libexec/opensmtpd/mail.local
|
||||||
libexec/opensmtpd/makemap
|
%%TABLE_DB%%libexec/opensmtpd/makemap
|
||||||
@(,%%SMTPQ_GROUP%%,2555) sbin/smtpctl
|
@(,,2555) sbin/smtpctl
|
||||||
sbin/smtpd
|
sbin/smtpd
|
||||||
man/man5/aliases.5.gz
|
man/man5/aliases.5.gz
|
||||||
man/man5/forward.5.gz
|
man/man5/forward.5.gz
|
||||||
man/man5/smtpd.conf.5.gz
|
man/man5/smtpd.conf.5.gz
|
||||||
man/man5/table.5.gz
|
man/man5/table.5.gz
|
||||||
man/man8/makemap.8.gz
|
%%TABLE_DB%%man/man8/makemap.8.gz
|
||||||
man/man8/newaliases.8.gz
|
%%TABLE_DB%%man/man8/newaliases.8.gz
|
||||||
man/man8/sendmail.8.gz
|
man/man8/sendmail.8.gz
|
||||||
man/man8/smtpctl.8.gz
|
man/man8/smtpctl.8.gz
|
||||||
man/man8/smtpd.8.gz
|
man/man8/smtpd.8.gz
|
||||||
|
|
Loading…
Add table
Reference in a new issue