diff --git a/mail/sendmail-devel/Makefile b/mail/sendmail-devel/Makefile index 303ce90632c6..bfa500f503a5 100644 --- a/mail/sendmail-devel/Makefile +++ b/mail/sendmail-devel/Makefile @@ -1,379 +1,398 @@ PORTNAME= sendmail PORTVERSION= 8.18.1.16 -PORTREVISION= 0 +PORTREVISION= 1 CATEGORIES= mail MASTER_SITES= ftp://ftp.sendmail.org/pub/sendmail/snapshots/ PKGNAMESUFFIX?= -devel${PKGNAMESUFFIX2} DISTNAME= ${PORTNAME}.${PORTVERSION} MAINTAINER= dinoex@FreeBSD.org COMMENT= Reliable, highly configurable mail transfer agent with utilities WWW= https://www.sendmail.org/ LICENSE= Sendmail LICENSE_NAME= Sendmail License LICENSE_FILE= ${WRKSRC}/LICENSE LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept CONFLICTS?= courier-0.* postfix-1.* postfix-2.* smail-3.* zmailer-2.* opensmtpd USERS= smmsp GROUPS= smmsp USES= cpe uidfix groff MAKE_ARGS= UBINOWN=${UID} UBINGRP=${GID} \ SBINOWN=${UID} SBINGRP=${GID} \ GBINOWN=${UID} GBINGRP=${GID} \ MANOWN=${UID} MANGRP=${GID} \ CFOWN=${UID} CFGRP=${GID} \ MSPQOWN=${UID} \ LIBMODE=0644 UBINMODE=0755 GBINMODE=2755 WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION} DOCS= KNOWNBUGS LICENSE PGPKEYS README RELEASE_NOTES \ sendmail/TRACEFLAGS sendmail/SECURITY sendmail/TUNING PLIST_SUB+= PREFIX=${PREFIX:S=${PREFIX}/==} \ MANPREFIX=${PREFIX}/share/ SUB_FILES= pkg-message WCONF= ${WRKSRC}/devtools/Site SITE= ${FILESDIR}/site.config.m4.pre4 PLIST= ${WRKDIR}/.PLIST.more LMAN1= mailq.1 newaliases.1 vacation.1 LMAN5= aliases.5 LMAN8= sendmail.8 mailstats.8 makemap.8 praliases.8 smrsh.8 \ mail.local.8 rmail.8 editmap.8 SENDMAIL= ${PREFIX}/sbin/sendmail BASEMAIL= /usr/libexec/sendmail/sendmail MILTER_SOVER?= 6 OPTIONS_DEFINE?= SHMEM SEM LA NIS IPV6 TLS DANE SASL SASLAUTHD LDAP \ - BDB GDBM SOCKETMAP CYRUSLOOKUP BLACKLISTD SMTPUTF8 \ + BDB GDBM SOCKETMAP CYRUSLOOKUP BLOCKLISTD SMTPUTF8 \ PICKY_HELO_CHECK MILTER MTA_STS \ TLS_CERT_CHAIN DOCS OPTIONS_DEFAULT?= SHMEM SEM LA NIS TLS DANE SASL SASLAUTHD BDB1 \ - BLACKLISTD PICKY_HELO_CHECK MILTER + BLOCKLISTD PICKY_HELO_CHECK MILTER NO_OPTIONS_SORT=yes SHMEM_DESC= System V shared memory support LA_DESC= load averages support TLS_DESC= SMTP-TLS and SMTPS support DANE_DESC= Enable DANE support SASLAUTHD_DESC= SASLAUTHD support BDB_DESC= Berkeley DB version 4+ support GDBM_DESC= GNU dbm library support (option COMPAT needed) SOCKETMAP_DESC= Enable socketmap feature -BLACKLISTD_DESC= Enable blacklistd support +BLOCKLISTD_DESC= Enable blocklistd support CYRUSLOOKUP_DESC= Enable cyruslookup feature PICKY_HELO_CHECK_DESC= Enable picky HELO check MILTER_DESC= Enable milter support SMTPUTF8_DESC= Enable unicode address support MTA_STS_DESC= Enable MTA-STS support (option SOCKETMAP and TLS needed) TLS_CERT_CHAIN_DESC= Enable certificate chain file support (incompatibility) TLS_USES= ssl SASL_LIB_DEPENDS= libsasl2.so:security/cyrus-sasl2 SASLAUTHD_RUN_DEPENDS= saslauthd:security/cyrus-sasl2-saslauthd DANE_IMPLIES= TLS LDAP_USES= ldap LDAP_IMPLIES= DANE BDB_USES= bdb GDBM_LIB_DEPENDS= libgdbm.so:databases/gdbm GDBM_CONFIGURE_WITH= compat CYRUSLOOKUP_IMPLIES= SOCKETMAP SMTPUTF8_LIB_DEPENDS= libidn2.so:dns/libidn2 libicui18n.so:devel/icu MTA_STS_IMPLIES= SOCKETMAP TLS TLS_CERT_CHAIN_IMPLIES= TLS +BLOCKLISTD_EXTRA_PATCHES= ${FILESDIR}/extra-patch-proto.m4 .include .if ${PORT_OPTIONS:MSHMEM} && !defined(BUILDING_INDEX) IPCCHECK!= ipcrm -q 0 2>&1 || true .if ${IPCCHECK:Mimplemented} IGNORE= your system does not support sysvipc .endif .endif .if ${PORT_OPTIONS:MBDB} BDB_SUFFIX= +${BDB_INCLUDE_DIR:S,^${LOCALBASE}/include/,,} CONFLICTS+= sendmail-ldap-8.* sendmail-sasl2-8.* sendmail-tls-8.* .endif .if ${PORT_OPTIONS:MLDAP} LDAP_SUFFIX?= +ldap CONFLICTS+= sendmail-sasl2-8.* sendmail-tls-8.* .endif .if ${PORT_OPTIONS:MSASL} SASL_SUFFIX?= +sasl2 CONFLICTS+= sendmail-ldap-8.* sendmail-tls-8.* .endif .if ${PORT_OPTIONS:MCYRUSLOOKUP} EXTRA_PATCHES+= ${FILESDIR}/cyruslookup.patch .endif .if ${PORT_OPTIONS:MTLS} TLS_SUFFIX?= +tls CONFLICTS+= sendmail-ldap-8.* sendmail-sasl2-8.* .endif MAKE_PKGNAMES= for i in "" +tls; do \ for j in "" +sasl2; do \ for k in "" +ldap; do \ for l in "" +db48 +db5 +db6; do \ echo "sendmail$${i}$${j}$${k}$${l}-8.*" ;\ done done done done ALL_PKGNAMES!= ${MAKE_PKGNAMES} CONFLICTS2!= ${MAKE_PKGNAMES} | ${GREP} -v "${PORTNAME}${PKGNAMESUFFIX:S|${PKGNAMESUFFIX2}||}-8." CONFLICTS+= ${CONFLICTS2} # Build site.config.m4 SITE+= ${FILESDIR}/site.config.m4 .if ${PORT_OPTIONS:MIPV6} SITE+= ${FILESDIR}/site.config.m4.ipv6 .endif .if ${PORT_OPTIONS:MDANE} SITE+= ${FILESDIR}/site.config.m4.dane .endif .if ${PORT_OPTIONS:MSASL} SITE+= ${FILESDIR}/site.config.m4.sasl2 .endif .if ${PORT_OPTIONS:MLDAP} SITE+= ${FILESDIR}/site.config.m4.ldap .endif -.if ${PORT_OPTIONS:MBLACKLISTD} -SITE+= ${FILESDIR}/site.config.m4.blacklistd +.if ${PORT_OPTIONS:MBLOCKLISTD} +SITE+= ${FILESDIR}/site.config.m4.blocklistd .endif .if ${PORT_OPTIONS:MSMTPUTF8} SITE+= ${FILESDIR}/site.config.m4.smtputf8 .endif .if ${PORT_OPTIONS:MMILTER} SITE+= ${FILESDIR}/site.config.m4.milter .endif .if ${PORT_OPTIONS:MGDBM} LICENSE_PERMS= dist-mirror dist-sell no-pkg-mirror no-pkg-sell auto-accept SITE+= ${FILESDIR}/site.config.m4.gdbm .endif .if ${PORT_OPTIONS:MMTA_STS} SITE+= ${FILESDIR}/site.config.m4.mta-sts .endif SED_SCRIPT= -e "s|\`-O'|\`${CFLAGS}'|" \ -e 's|%%CC%%|${CC}|' -e 's|%%LD%%|${LD}|' .if ! ${PORT_OPTIONS:MNIS} SED_SCRIPT+= -e "s;-DNIS ;;" .endif post-patch: @cd ${WRKSRC} && ${FIND} cf -type f -name "*.orig" -print0 | ${XARGS} -0 ${RM} +.if ${PORT_OPTIONS:MBLOCKLISTD} +.if ${OPSYS} == FreeBSD && ${OSVERSION} < 1500000 + ${REINPLACE_CMD} \ + -e 's|#include |#include |' \ + -e 's|struct blocklist|struct blacklist|' \ + -e 's|blocklist_open|blacklist_open|' \ + -e 's|blocklist_r|blacklist_r|' \ + ${WRKSRC}/sendmail/blocklist.c \ + ${WRKSRC}/sendmail/sendmail.h +.endif +.endif do-configure: .if ${PORT_OPTIONS:MGDBM} @(if [ ! -e "${LOCALBASE}/lib/libgdbm_compat.so" ] ; then \ ${ECHO_MSG} "===> option COMPAT is missing in databases/gdbm."; \ ${FALSE}; \ fi) .endif ${REINPLACE_CMD} ${SED_SCRIPT} ${WRKSRC}/devtools/OS/FreeBSD ${SED} -e "s=%%PREFIX%%=${PREFIX}=g" \ -e "s=%%LOCALBASE%%=${LOCALBASE}=g" \ ${SITE} > ${WCONF}/site.config.m4 +.if ${PORT_OPTIONS:MBLOCKLISTD} +.if ${OPSYS} == FreeBSD && ${OSVERSION} < 1500000 + ${REINPLACE_CMD} \ + -e 's|-lblocklist|-lblacklist|' \ + ${WCONF}/site.config.m4 +.endif +.endif .if ${PORT_OPTIONS:MBDB} ${ECHO_CMD} \ 'APPENDDEF(`confENVDEF'\'', `-I${BDB_INCLUDE_DIR}'\'')' \ >> ${WCONF}/site.config.m4 ${ECHO_CMD} \ 'APPENDDEF(`confLIBDIRS'\'', `-L${LOCALBASE}/lib'\'')' \ >> ${WCONF}/site.config.m4 .for i in sendmail editmap makemap praliases vacation ${ECHO_CMD} \ 'APPENDDEF(`conf_${i}_LIBS'\'', `-l${BDB_LIB_NAME}'\'')' \ >> ${WCONF}/site.config.m4 .endfor .endif .if ${PORT_OPTIONS:MSOCKETMAP} ${ECHO_CMD} \ 'APPENDDEF(`conf_sendmail_ENVDEF'\'', `-DSOCKETMAP'\'')' \ >> ${WCONF}/site.config.m4 .endif .if ${PORT_OPTIONS:MPICKY_HELO_CHECK} ${ECHO_CMD} \ 'APPENDDEF(`conf_sendmail_ENVDEF'\'', `-DPICKY_HELO_CHECK'\'')' \ >> ${WCONF}/site.config.m4 .endif .if ! ${PORT_OPTIONS:MSHMEM} ${ECHO_CMD} \ 'APPENDDEF(`confENVDEF'\'', `-DSM_CONF_SHM=0'\'')' \ >> ${WCONF}/site.config.m4 .endif .if ! ${PORT_OPTIONS:MSEM} ${ECHO_CMD} \ 'APPENDDEF(`confENVDEF'\'', `-DSM_CONF_SEM=0'\'')' \ >> ${WCONF}/site.config.m4 .endif .if ! ${PORT_OPTIONS:MLA} ${ECHO_CMD} \ 'APPENDDEF(`confENVDEF'\'', `-DLA_TYPE=LA_ZERO'\'')' \ >> ${WCONF}/site.config.m4 .endif post-build: (cd ${WRKSRC}/doc/op && \ ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} op.txt) pre-install: ${MKDIR} ${STAGEDIR}/etc/mail \ ${STAGEDIR}${PREFIX}/share/man/cat1 \ ${STAGEDIR}${PREFIX}/share/man/cat5 \ ${STAGEDIR}${PREFIX}/share/man/cat8 @${CAT} ${PKGDIR}/pkg-plist >${PLIST} @cd ${WRKSRC} && ${FIND} cf -type f | \ ${AWK} '{print "share/sendmail/" $$1}' >>${PLIST} .if ${PORT_OPTIONS:MDOCS} .for i in ${DOCS} @${ECHO_CMD} `${BASENAME} ${i}` | \ ${AWK} '{print "%%DOCSDIR%%/" $$1}' >>${PLIST} .endfor .if ${PORT_OPTIONS:MCYRUSLOOKUP} @${ECHO_CMD} "share/doc/sendmail/CYRUS_LOOKUP" >>${PLIST} .endif .endif ${MKDIR} ${STAGEDIR}${PREFIX}/etc/mail @${SED} \ -e "s=\([ ]\)/.*$$=\\1${SENDMAIL}=" \ ${FILESDIR}/mailer.conf \ > ${STAGEDIR}${PREFIX}/etc/mail/mailer.conf.sendmail # We want mail.local and rmail for our system. # the build install catmans only, we have to fix this. post-install: (cd ${WRKSRC}/mail.local && \ ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} force-install) (cd ${WRKSRC}/rmail && \ ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} force-install) .for i in ${LMAN8} ${INSTALL_MAN} ${WRKSRC}/*/${i} ${STAGEDIR}${PREFIX}/share/man/man8/ .endfor .for i in ${LMAN5} ${INSTALL_MAN} ${WRKSRC}/*/${i} ${STAGEDIR}${PREFIX}/share/man/man5/ .endfor .for i in ${LMAN1} ${INSTALL_MAN} ${WRKSRC}/*/${i} ${STAGEDIR}${PREFIX}/share/man/man1/ .endfor ${MKDIR} ${STAGEDIR}${PREFIX}/share/sendmail ${TAR} -C ${WRKSRC} -cf - cf | \ ${TAR} -C ${STAGEDIR}${PREFIX}/share/sendmail -xf - ${RM} -rfv ${STAGEDIR}${PREFIX}/share/man/cat* # final perm of sendmail is 2555 (see plist), needed for strip cmd ${CHMOD} 755 ${STAGEDIR}${PREFIX}/sbin/sendmail ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/vacation ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/rmail ${STRIP_CMD} ${STAGEDIR}${PREFIX}/sbin/* ${STRIP_CMD} ${STAGEDIR}${PREFIX}/libexec/* post-install-DOCS-on: ${MKDIR} ${STAGEDIR}${DOCSDIR} cd ${WRKSRC} && ${INSTALL_DATA} ${DOCS} ${STAGEDIR}${DOCSDIR}/ ${INSTALL_DATA} ${WRKSRC}/doc/op/op.ps ${STAGEDIR}${DOCSDIR}/op.ps ${INSTALL_DATA} ${WRKSRC}/doc/op/op.txt ${STAGEDIR}${DOCSDIR}/op.txt ${INSTALL_DATA} ${WRKSRC}/devtools/README ${STAGEDIR}${DOCSDIR}/DEVTOOLS ${INSTALL_DATA} ${WRKSRC}/sendmail/README ${STAGEDIR}${DOCSDIR}/SENDMAIL ${INSTALL_DATA} ${WRKSRC}/mail.local/README ${STAGEDIR}${DOCSDIR}/MAIL.LOCAL ${INSTALL_DATA} ${WRKSRC}/smrsh/README ${STAGEDIR}${DOCSDIR}/SMRSH .if ${PORT_OPTIONS:MCYRUSLOOKUP} ${INSTALL_DATA} ${FILESDIR}/CYRUS_LOOKUP ${STAGEDIR}${DOCSDIR}/CYRUS_LOOKUP .endif mailer.base: @${SED} \ -e "s=\([ ]\)/.*$$=\\1${BASEMAIL}=" \ ${FILESDIR}/mailer.conf > ${DESTDIR}/etc/mail/mailer.conf.new ${MV} ${DESTDIR}/etc/mail/mailer.conf.new \ ${DESTDIR}/etc/mail/mailer.conf mailer.conf: .if exists(${DESTDIR}${PREFIX}/etc/mail/mailer.conf.sendmail) @${CP} -v ${DESTDIR}${PREFIX}/etc/mail/mailer.conf.sendmail \ ${DESTDIR}${PREFIX}/etc/mail/mailer.conf .else @${MKDIR} ${DESTDIR}${PREFIX}/etc/mail @${SED} \ -e "s=\([ ]\)/.*$$=\\1${SENDMAIL}=" \ ${FILESDIR}/mailer.conf \ > ${DESTDIR}${PREFIX}/etc/mail/mailer.conf .endif # create sumbit.cf on older systems # submit.cf: ${DESTDIR}/etc/mail/submit.cf ${DESTDIR}/etc/mail/submit.mc: ${INSTALL_DATA} ${PREFIX}/share/sendmail/cf/cf/submit.mc \ ${DESTDIR}/etc/mail/submit.mc ${DESTDIR}/etc/mail/submit.cf: ${DESTDIR}/etc/mail/submit.mc @( cd ${DESTDIR}/etc/mail && ${MAKE} \ SENDMAIL_CF_DIR=${PREFIX}/share/sendmail/cf \ SENDMAIL_MC=submit ) # create basics for smtp-auth # howto-sasldb: @${ECHO_CMD} "# Links:" @${ECHO_CMD} "#" @${ECHO_CMD} "# http://www.sendmail.org/~gshapiro/" @${ECHO_CMD} "# http://www.sendmail.org/~ca/email/auth.html" @${ECHO_CMD} "# http://www.bme.ogi.edu/~pchytil/linux/sendmail/" @${ECHO_CMD} "# http://blue-labs.org/software/sm-pgsql/" @${ECHO_CMD} "# http://www.falkotimme.com/howtos/sendmail_smtp_auth_tls/" @${ECHO_CMD} "#" # create certificates for TLS/SSL # tls-install: ${SETENV} DESTDIR=${DESTDIR} FILESDIR=${FILESDIR} \ ${SH} ${FILESDIR}/tls-install.sh help: @${ECHO_CMD} "# additional targets:" @${ECHO_CMD} "#" @${ECHO_CMD} "# configure ${DESTDIR}/etc/mail/mailer.conf" @${ECHO_CMD} "# for sendmail from ports" @${ECHO_CMD} "make mailer.conf" @${ECHO_CMD} "# for sendmail in the base" @${ECHO_CMD} "make mailer.base" @${ECHO_CMD} "#" @${ECHO_CMD} "# show howto for configuring sasldb" @${ECHO_CMD} "make howto-sasldb" @${ECHO_CMD} "#" @${ECHO_CMD} "# create a self-signed certificate" @${ECHO_CMD} "make tls-install" @${ECHO_CMD} "#" .include .if ${PORT_OPTIONS:MTLS} .if ${SSL_DEFAULT} != base SITE+= ${FILESDIR}/site.config.m4.ssl .endif SITE+= ${FILESDIR}/site.config.m4.tls .if ${PORT_OPTIONS:MTLS_CERT_CHAIN} SITE+= ${FILESDIR}/site.config.m4.tls-cert-chain .endif .endif .if exists(${FILESDIR}/site.config.m4.local) SITE+= ${FILESDIR}/site.config.m4.local .endif .if ${PREFIX} == "/usr" pre-everything:: @${ECHO_CMD} "#" @${ECHO_CMD} "# You can't override the base sendmail this way." @${ECHO_CMD} "# your version FreeBSD use mailwrapper." @${ECHO_CMD} "#" @${ECHO_CMD} "# Please install with normal PREFIX" @${ECHO_CMD} "# and activate the port version with" @${ECHO_CMD} "# cd /usr/local/etc/mail && cp mailer.conf.sendmail mailer.conf" @${ECHO_CMD} "#" @${FALSE} .endif .include diff --git a/mail/sendmail-devel/files/extra-patch-proto.m4 b/mail/sendmail-devel/files/extra-patch-proto.m4 new file mode 100644 index 000000000000..cf7eae20a6f7 --- /dev/null +++ b/mail/sendmail-devel/files/extra-patch-proto.m4 @@ -0,0 +1,12 @@ +--- cf/m4/proto.m4.orig 2024-01-31 06:38:32 UTC ++++ cf/m4/proto.m4 +@@ -720,6 +720,9 @@ _OPTION(HeloName, `confHELO_NAME') + # Name to use for EHLO (defaults to $j) + _OPTION(HeloName, `confHELO_NAME') + ++# Use Blocklistd ++_OPTION(UseBlocklist, `confBLOCKLIST', `false') ++ + ifdef(`_NEED_SMTPOPMODES_', `dnl + # SMTP operation modes + C{SMTPOpModes} s d D') diff --git a/mail/sendmail-devel/files/patch-Makefile.m4 b/mail/sendmail-devel/files/patch-Makefile.m4 index 515b01ec7142..cef6e2c3ebe6 100644 --- a/mail/sendmail-devel/files/patch-Makefile.m4 +++ b/mail/sendmail-devel/files/patch-Makefile.m4 @@ -1,21 +1,21 @@ --- sendmail/Makefile.m4.orig 2025-02-05 06:35:18 UTC +++ sendmail/Makefile.m4 @@ -7,6 +7,7 @@ define(`bldSOURCES', `main.c alias.c arpadate.c bf.c c define(`bldBIN_TYPE', `G') define(`bldINSTALL_DIR', `') define(`bldSOURCES', `main.c alias.c arpadate.c bf.c collect.c conf.c control.c convtime.c daemon.c deliver.c domain.c envelope.c err.c headers.c macro.c map.c mci.c milter.c mime.c parseaddr.c queue.c ratectrl.c readcf.c recipient.c sasl.c savemail.c sched.c sfsasl.c shmticklib.c sm_resolve.c srvrsmtp.c stab.c stats.c sysexits.c timers.c tlsh.c tls.c trace.c udb.c usersmtp.c util.c version.c ') -+APPENDDEF(`bldSOURCES',`blacklist.c ') ++APPENDDEF(`bldSOURCES',`blocklist.c ') PREPENDDEF(`confENVDEF', `confMAPDEF') PUSHDIVERT(3) ldap.c: @@ -18,8 +19,8 @@ dnl hack: /etc/mail is not defined as "location of .cf dnl hack: /etc/mail is not defined as "location of .cf" in the build system -define(`bldTARGET_INST_DEP', ifdef(`confINST_DEP', `confINST_DEP', -`${DESTDIR}/etc/mail/submit.cf ${DESTDIR}${MSPQ}'))dnl +define(`bldTARGET_INST_DEP', ifdef(`confINST_DEP', `confINST_DEP')) +dnl define(`bldTARGET_LINKS', ifdef(`confLINKS', `confLINKS', `${DESTDIR}${UBINDIR}/newaliases ${DESTDIR}${UBINDIR}/mailq ${DESTDIR}${UBINDIR}/hoststat ${DESTDIR}${UBINDIR}/purgestat') )dnl diff --git a/mail/sendmail-devel/files/patch-blacklist.c b/mail/sendmail-devel/files/patch-blocklist.c similarity index 78% rename from mail/sendmail-devel/files/patch-blacklist.c rename to mail/sendmail-devel/files/patch-blocklist.c index 59782a08473e..10fc16c954d8 100644 --- a/mail/sendmail-devel/files/patch-blacklist.c +++ b/mail/sendmail-devel/files/patch-blocklist.c @@ -1,60 +1,60 @@ ---- sendmail/blacklist.c.orig 2018-01-02 20:16:44 UTC -+++ sendmail/blacklist.c +--- sendmail/blocklist.c.orig 2018-01-02 20:16:44 UTC ++++ sendmail/blocklist.c @@ -0,0 +1,57 @@ +/*- + * Copyright (c) 2016 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Kurt Lidl under sponsorship from the + * FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ + +/* $FreeBSD$ */ + -+#ifdef USE_BLACKLIST ++#ifdef USE_BLOCKLIST +#include -+#include /* for EXTERN UseBlacklist */ ++#include /* for EXTERN UseBlocklist */ + -+#include -+#include "blacklist_client.h" ++#include ++#include "blocklist_client.h" + -+static struct blacklist *blstate; ++static struct blocklist *blstate; + +void -+blacklist_init(void) ++blocklist_init(void) +{ + -+ if (UseBlacklist) -+ blstate = blacklist_open(); ++ if (UseBlocklist) ++ blstate = blocklist_open(); +} + +void -+blacklist_notify(int action, int fd, const char *msg) ++blocklist_notify(int action, int fd, const char *msg) +{ + + if (blstate == NULL) + return; -+ (void)blacklist_r(blstate, action, fd, msg); ++ (void)blocklist_r(blstate, action, fd, msg); +} + -+#endif /* USE_BLACKLIST */ ++#endif /* USE_BLOCKLIST */ diff --git a/mail/sendmail-devel/files/patch-blacklist_client.h b/mail/sendmail-devel/files/patch-blocklist_client.h similarity index 73% rename from mail/sendmail-devel/files/patch-blacklist_client.h rename to mail/sendmail-devel/files/patch-blocklist_client.h index 6f8c130045c3..6067c54701a2 100644 --- a/mail/sendmail-devel/files/patch-blacklist_client.h +++ b/mail/sendmail-devel/files/patch-blocklist_client.h @@ -1,60 +1,60 @@ ---- sendmail/blacklist_client.h.orig 2018-01-02 20:16:44 UTC -+++ sendmail/blacklist_client.h +--- sendmail/blocklist_client.h.orig 2018-01-02 20:16:44 UTC ++++ sendmail/blocklist_client.h @@ -0,0 +1,57 @@ +/*- + * Copyright (c) 2016 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Kurt Lidl under sponsorship from the + * FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ + +/* $FreeBSD$ */ + -+#ifndef BLACKLIST_CLIENT_H -+#define BLACKLIST_CLIENT_H ++#ifndef BLOCKLIST_CLIENT_H ++#define BLOCKLIST_CLIENT_H + -+#ifndef BLACKLIST_API_ENUM ++#ifndef BLOCKLIST_API_ENUM +enum { -+ BLACKLIST_AUTH_OK = 0, -+ BLACKLIST_AUTH_FAIL, -+ BLACKLIST_ABUSIVE_BEHAVIOR, -+ BLACKLIST_BAD_USER ++ BLOCKLIST_AUTH_OK = 0, ++ BLOCKLIST_AUTH_FAIL, ++ BLOCKLIST_ABUSIVE_BEHAVIOR, ++ BLOCKLIST_BAD_USER +}; +#endif + -+#ifdef USE_BLACKLIST -+void blacklist_init(void); -+void blacklist_notify(int, int, const char *); ++#ifdef USE_BLOCKLIST ++void blocklist_init(void); ++void blocklist_notify(int, int, const char *); + -+#define BLACKLIST_INIT() blacklist_init() -+#define BLACKLIST_NOTIFY(x, y, msg) blacklist_notify(x, y, msg) ++#define BLOCKLIST_INIT() blocklist_init() ++#define BLOCKLIST_NOTIFY(x, y, msg) blocklist_notify(x, y, msg) + +#else + -+#define BLACKLIST_INIT() -+#define BLACKLIST_NOTIFY(x, y, msg) ++#define BLOCKLIST_INIT() ++#define BLOCKLIST_NOTIFY(x, y, msg) + +#endif + -+#endif /* BLACKLIST_CLIENT_H */ ++#endif /* BLOCKLIST_CLIENT_H */ diff --git a/mail/sendmail-devel/files/patch-daemon.c b/mail/sendmail-devel/files/patch-daemon.c index 6b5cdca95e77..66e4f7c460d4 100644 --- a/mail/sendmail-devel/files/patch-daemon.c +++ b/mail/sendmail-devel/files/patch-daemon.c @@ -1,11 +1,11 @@ --- sendmail/daemon.c.orig 2023-10-27 05:47:26 UTC +++ sendmail/daemon.c @@ -782,6 +782,8 @@ getrequests(e) anynet_ntoa(&RealHostAddr)); } -+ BLACKLIST_INIT(); ++ BLOCKLIST_INIT(); + if (pipefd[0] != -1) { auto char c; diff --git a/mail/sendmail-devel/files/patch-readcf.c b/mail/sendmail-devel/files/patch-readcf.c index f388cec6b827..485cb088bb83 100644 --- a/mail/sendmail-devel/files/patch-readcf.c +++ b/mail/sendmail-devel/files/patch-readcf.c @@ -1,26 +1,27 @@ --- sendmail/readcf.c.orig 2025-10-23 19:33:31 UTC +++ sendmail/readcf.c -@@ -3213,6 +3213,10 @@ static struct optioninfo +@@ -3213,6 +3213,11 @@ static struct optioninfo { "SameDomainOnly", O_SAMEDOMAINONLY, OI_NONE }, #endif -+#if USE_BLACKLIST -+# define O_BLACKLIST 0xfb -+ { "UseBlacklist", O_BLACKLIST, OI_NONE }, ++#if USE_BLOCKLIST ++# define O_BLOCKLIST 0xfb ++ { "UseBlocklist", O_BLOCKLIST, OI_NONE }, ++ { "UseBlacklist", O_BLOCKLIST, OI_NONE }, /* alias */ +#endif { NULL, '\0', OI_NONE } }; @@ -4944,6 +4948,12 @@ setoption(opt, val, safe, sticky, e) #if _FFR_MTA_STS case O_MTASTS: StrictTransportSecurity = atobool(val); + break; +#endif + -+#if USE_BLACKLIST -+ case O_BLACKLIST: -+ UseBlacklist = atobool(val); ++#if USE_BLOCKLIST ++ case O_BLOCKLIST: ++ UseBlocklist = atobool(val); break; #endif diff --git a/mail/sendmail-devel/files/patch-sendmail.8 b/mail/sendmail-devel/files/patch-sendmail.8 index b3d24e22bb7b..b4c826fd2121 100644 --- a/mail/sendmail-devel/files/patch-sendmail.8 +++ b/mail/sendmail-devel/files/patch-sendmail.8 @@ -1,14 +1,14 @@ --- sendmail/sendmail.8.orig 2024-01-24 17:09:22 UTC +++ sendmail/sendmail.8 @@ -552,6 +552,11 @@ The default is five days. failed messages will be returned to the sender. The default is five days. .TP -+UseBlacklist ++UseBlocklist +If set, send authentication failure and success notifications to the -+.BR blacklistd (8) ++.BR blocklistd (8) +daemon. +.TP .RI UserDatabaseSpec= userdatabase If set, a user database is consulted to get forwarding information. You can consider this an adjunct to the aliasing mechanism, diff --git a/mail/sendmail-devel/files/patch-sendmail.h b/mail/sendmail-devel/files/patch-sendmail.h index 5f47cd90fcbb..00e37bfb543b 100644 --- a/mail/sendmail-devel/files/patch-sendmail.h +++ b/mail/sendmail-devel/files/patch-sendmail.h @@ -1,24 +1,24 @@ --- sendmail/sendmail.h.orig 2025-10-23 19:33:31 UTC +++ sendmail/sendmail.h @@ -73,6 +73,10 @@ SM_UNUSED(static char SmailId[]) = "@(#)$Id: sendmail. #endif #include "bf.h" -+#if USE_BLACKLIST -+#include ++#if USE_BLOCKLIST ++#include +#endif -+#include "blacklist_client.h" ++#include "blocklist_client.h" #include "timers.h" #include #include @@ -2807,6 +2811,10 @@ EXTERN int ConnectionRateWindowSize; #endif EXTERN int ConnectionRateWindowSize; + -+#if USE_BLACKLIST -+EXTERN bool UseBlacklist; ++#if USE_BLOCKLIST ++EXTERN bool UseBlocklist; +#endif /* ** Declarations of useful functions diff --git a/mail/sendmail-devel/files/patch-srvrsmtp.c b/mail/sendmail-devel/files/patch-srvrsmtp.c index 96f217110007..8d6f414e3ed4 100644 --- a/mail/sendmail-devel/files/patch-srvrsmtp.c +++ b/mail/sendmail-devel/files/patch-srvrsmtp.c @@ -1,128 +1,128 @@ --- sendmail/srvrsmtp.c.orig 2025-10-20 19:09:43 UTC +++ sendmail/srvrsmtp.c @@ -953,6 +953,9 @@ do \ # define SHOWCMDINREPLY(inp) inp # define SHOWSHRTCMDINREPLY(inp) shortenstring(inp, MAXSHORTSTR) #endif -+#ifdef USE_BLACKLIST ++#ifdef USE_BLOCKLIST + int saved_bl_fd; +#endif void smtp(nullserver, d_flags, e) @@ -1546,6 +1549,8 @@ smtp(nullserver, d_flags, e) /* check if data is on the socket during the pause */ if ((tp = channel_readable(InChannel, msecs)) != NULL) { + int fd; + greetcode = "554"; nullserver = "Command rejected"; sm_syslog(LOG_INFO, e->e_id, @@ -1555,6 +1560,8 @@ smtp(nullserver, d_flags, e) (int) tp->tv_sec + (tp->tv_usec >= 500000 ? 1 : 0) ); + fd = sm_io_getinfo(InChannel, SM_IO_WHAT_FD, NULL); -+ BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL, fd, "pre-greeting traffic"); ++ BLOCKLIST_NOTIFY(BLOCKLIST_AUTH_FAIL, fd, "pre-greeting traffic"); } } } @@ -1674,6 +1681,10 @@ smtp(nullserver, d_flags, e) SmtpPhase = "server cmd read"; sm_setproctitle(true, e, "server %s cmd read", CurSmtpClient); -+#ifdef USE_BLACKLIST ++#ifdef USE_BLOCKLIST + saved_bl_fd = dup(sm_io_getinfo(InChannel, SM_IO_WHAT_FD, NULL)); +#endif + /* handle errors */ if (sm_io_error(OutChannel) || (p = sfgets(inp, sizeof(inp), InChannel, @@ -1989,8 +2000,11 @@ smtp(nullserver, d_flags, e) #define LOGAUTHFAIL \ do \ { \ + int fd; \ SET_AUTH_USER_CONDITIONALLY \ message("535 5.7.0 authentication failed"); \ + fd = sm_io_getinfo(InChannel, SM_IO_WHAT_FD, NULL); \ -+ BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL, fd, "AUTH FAIL"); \ ++ BLOCKLIST_NOTIFY(BLOCKLIST_AUTH_FAIL, fd, "AUTH FAIL"); \ if (LogLevel >= 9) \ sm_syslog(LOG_WARNING, e->e_id, \ "AUTH failure (%s): %s (%d) %s%s%.*s, relay=%.100s", \ @@ -2089,6 +2103,13 @@ smtp(nullserver, d_flags, e) case CMDEHLO: case CMDNOOP: case CMDRSET: + if (lognullconnection) + { + int fd = sm_io_getinfo(InChannel, SM_IO_WHAT_FD, NULL); -+ BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL, fd, nullserver); ++ BLOCKLIST_NOTIFY(BLOCKLIST_AUTH_FAIL, fd, nullserver); + } + /* FALLTHROUGH */ + case CMDERROR: /* process normally */ break; @@ -2116,6 +2137,11 @@ smtp(nullserver, d_flags, e) #endif /* MAXBADCOMMANDS > 0 */ if (nullserver != NULL) { + if (lognullconnection) + { + int fd = sm_io_getinfo(InChannel, SM_IO_WHAT_FD, NULL); -+ BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL, fd, nullserver); ++ BLOCKLIST_NOTIFY(BLOCKLIST_AUTH_FAIL, fd, nullserver); + } if (ISSMTPREPLY(nullserver)) { /* Can't use ("%s", ...) due to usrerr() requirements */ @@ -2140,6 +2166,9 @@ smtp(nullserver, d_flags, e) DELAY_CONN("AUTH"); if (!sasl_ok || n_mechs <= 0) { + int fd; + fd = sm_io_getinfo(InChannel, SM_IO_WHAT_FD, NULL); -+ BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL, fd, "AUTH LOGIN FAIL"); ++ BLOCKLIST_NOTIFY(BLOCKLIST_AUTH_FAIL, fd, "AUTH LOGIN FAIL"); message("503 5.3.3 AUTH not available"); break; } @@ -3929,10 +3958,17 @@ smtp(nullserver, d_flags, e) ** timeouts for the same connection. */ -+#ifdef USE_BLACKLIST -+ /* no immediate BLACKLIST_ABUSIVE_BEHAVIOR */ -+ BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL, saved_bl_fd, "no command issued"); ++#ifdef USE_BLOCKLIST ++ /* no immediate BLOCKLIST_ABUSIVE_BEHAVIOR */ ++ BLOCKLIST_NOTIFY(BLOCKLIST_AUTH_FAIL, saved_bl_fd, "no command issued"); +#endif sm_syslog(LOG_INFO, e->e_id, "%s did not issue MAIL/EXPN/VRFY/ETRN during connection to %s", CurSmtpClient, d); } -+#ifdef USE_BLACKLIST ++#ifdef USE_BLOCKLIST + close(saved_bl_fd); +#endif if (tTd(93, 100)) { /* return to handle next connection */ @@ -4014,7 +4050,10 @@ smtp(nullserver, d_flags, e) #if MAXBADCOMMANDS > 0 if (++n_badcmds > MAXBADCOMMANDS) { + int fd; stopattack: + fd = sm_io_getinfo(InChannel, SM_IO_WHAT_FD, NULL); -+ BLACKLIST_NOTIFY(BLACKLIST_ABUSIVE_BEHAVIOR, fd, "too many bad commands"); ++ BLOCKLIST_NOTIFY(BLOCKLIST_ABUSIVE_BEHAVIOR, fd, "too many bad commands"); message("421 4.7.0 %s Too many bad commands; closing connection", MyHostName); @@ -4068,6 +4107,9 @@ smtp(nullserver, d_flags, e) } #if SASL } +#endif -+#ifdef USE_BLACKLIST ++#ifdef USE_BLOCKLIST + close(saved_bl_fd); #endif } SM_EXCEPT(exc, "[!F]*") diff --git a/mail/sendmail-devel/files/patch-usersmtp.c b/mail/sendmail-devel/files/patch-usersmtp.c index f875ed25b342..7710b1fbf9e3 100644 --- a/mail/sendmail-devel/files/patch-usersmtp.c +++ b/mail/sendmail-devel/files/patch-usersmtp.c @@ -1,26 +1,26 @@ --- sendmail/usersmtp.c.orig 2025-10-27 17:06:50 UTC +++ sendmail/usersmtp.c @@ -1946,6 +1946,9 @@ attemptauth(m, mci, e, sai) if (saslresult != SASL_OK && saslresult != SASL_CONTINUE) { + int fd = sm_io_getinfo(mci->mci_in, SM_IO_WHAT_FD, NULL); -+ BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL, fd, "AUTH FAIL"); ++ BLOCKLIST_NOTIFY(BLOCKLIST_AUTH_FAIL, fd, "AUTH FAIL"); + if (tTd(95, 5)) sm_dprintf("AUTH FAIL=%s (%d)\n", sasl_errstring(saslresult, NULL, NULL), @@ -2091,9 +2094,11 @@ smtpauth(m, mci, e) do { result = attemptauth(m, mci, e, &(mci->mci_sai)); - if (result == EX_OK) + if (result == EX_OK) { + int fd = sm_io_getinfo(mci->mci_in, SM_IO_WHAT_FD, NULL); -+ BLACKLIST_NOTIFY(BLACKLIST_AUTH_OK, fd, "AUTH OK"); ++ BLOCKLIST_NOTIFY(BLOCKLIST_AUTH_OK, fd, "AUTH OK"); mci->mci_sasl_auth = true; - else if (result == EX_TEMPFAIL || result == EX_NOPERM) + } else if (result == EX_TEMPFAIL || result == EX_NOPERM) { mci->mci_saslcap = removemech((mci->mci_sai)[SASL_MECH], mci->mci_saslcap, diff --git a/mail/sendmail-devel/files/site.config.m4.blacklistd b/mail/sendmail-devel/files/site.config.m4.blacklistd deleted file mode 100644 index bc3a46e40d60..000000000000 --- a/mail/sendmail-devel/files/site.config.m4.blacklistd +++ /dev/null @@ -1,2 +0,0 @@ -APPENDDEF(`conf_sendmail_ENVDEF', `-DUSE_BLACKLIST') -APPENDDEF(`conf_sendmail_LIBS', `-lblacklist') diff --git a/mail/sendmail-devel/files/site.config.m4.blocklistd b/mail/sendmail-devel/files/site.config.m4.blocklistd new file mode 100644 index 000000000000..beb2e07de6c1 --- /dev/null +++ b/mail/sendmail-devel/files/site.config.m4.blocklistd @@ -0,0 +1,2 @@ +APPENDDEF(`conf_sendmail_ENVDEF', `-DUSE_BLOCKLIST') +APPENDDEF(`conf_sendmail_LIBS', `-lblocklist')