Exim original port

This commit is contained in:
2025-12-18 02:01:07 +01:00
parent 1d39ae8491
commit 8544126ef2
23 changed files with 1890 additions and 0 deletions

654
mail/exim/Makefile Normal file
View File

@ -0,0 +1,654 @@
PORTNAME= exim
PORTVERSION?= ${EXIM_VERSION}
PORTREVISION?= 0
CATEGORIES= mail
MASTER_SITES= EXIM:exim
MASTER_SITE_SUBDIR= /exim4/:exim \
/exim4/fixes/:exim \
/exim4/old/:exim
DISTNAME= ${PORTNAME}-${EXIM_VERSION}
DISTFILES= ${DISTNAME}${EXTRACT_SUFX}:exim
DIST_SUBDIR= exim
EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
MAINTAINER= fluffy@FreeBSD.org
COMMENT?= High performance MTA for Unix systems on the Internet
WWW= https://www.exim.org/
LICENSE= GPLv2
BUILD_DEPENDS= p5-File-FcntlLock>0:devel/p5-File-FcntlLock
RUN_DEPENDS= p5-File-FcntlLock>0:devel/p5-File-FcntlLock
USES= compiler cpe tar:bzip2 perl5
USE_CSTD= c99
# Exim build system is job unsafe atm
MAKE_JOBS_UNSAFE= yes
# One can tune the following "hidden" knobs:
# - EXIM_USER: user exim is running as;
# - EXIM_GROUP: ditto for the group;
# - LOGDIR: where Exim logs will be put;
# - LOG_FILE_PATH: path where '%s' will be substituted with
# the target name (main, reject, etc);
# - CONFIG_FILE_PATH: path to the default configuration file;
# - ALT_CONFIG_PREFIX: path to the default prefix for all
# configuration files, excluding the main one;
# will be effective only when WITH_ALT_CONFIG_PREFIX
# will be set via OPTIONS.
.if make(makesum) && !defined(FETCH_ALL)
.error "You forgot to define FETCH_ALL to create the sane distinfo"
.endif
.include "options"
OPTIONS_SUB= yes
AUTH_SASL_LIB_DEPENDS= libsasl2.so:security/cyrus-sasl2
BDB_USES= bdb
DMARC_LIB_DEPENDS= libopendmarc.so:mail/opendmarc
EXIMON_USES= xorg
EXIMON_USE= xorg=x11,xaw,xext,xmu,xt
GNUTLS_LIB_DEPENDS= libgnutls.so:security/gnutls
ICONV_USES= iconv:lib,build
INTERNATIONAL_LIB_DEPENDS= libidn.so:dns/libidn libidn2.so:dns/libidn2
LMDB_LIB_DEPENDS= liblmdb.so:databases/lmdb
MYSQL_USES= mysql
OPENLDAP_USES= ldap
PGSQL_LIB_DEPENDS= libicudata.so:devel/icu
PGSQL_USES= pgsql pkgconfig
REDIS_LIB_DEPENDS= libhiredis.so:databases/hiredis
SASLAUTHD_RUN_DEPENDS= ${LOCALBASE}/sbin/saslauthd:security/cyrus-sasl2-saslauthd
SA_EXIM_RUN_DEPENDS= ${LOCALBASE}/bin/spamc:mail/spamassassin
SPF_LIB_DEPENDS= libspf2.so:mail/libspf2
SQLITE_LIB_DEPENDS= libicudata.so:devel/icu
SQLITE_USES= pkgconfig sqlite
#DEBIAN_PATCHES_PREFIX= ${FILESDIR}/debian/75
#EXTRA_PATCHES= \
# ${DEBIAN_PATCHES_PREFIX}_01-Fix-exit-on-attempt-to-rewrite-a-malformed-address.-.patch:-p1 \
# ${DEBIAN_PATCHES_PREFIX}_05-SPF-fix-memory-accounting-for-error-case.patch:-p1
.include <bsd.port.options.mk>
# OCSP is supported for openssl only
.if ${PORT_OPTIONS:MOCSP}
.if ! ${PORT_OPTIONS:MTLS}
IGNORE= you cannot enable OCSP stapling without TLS support
.elif ${PORT_OPTIONS:MGNUTLS}
IGNORE= you cannot enable OCSP stapling with gnutls
.endif
.endif
# DMARC implies SPF and DKIM
.if ${PORT_OPTIONS:MDMARC}
.if ! ${PORT_OPTIONS:MSPF} || ! ${PORT_OPTIONS:MDKIM}
IGNORE= you cannot enable DMARC without SPF and DKIM support
.endif
.endif
# ARC implies SPF and DKIM
.if ${PORT_OPTIONS:MARC}
.if ! ${PORT_OPTIONS:MSPF} || ! ${PORT_OPTIONS:MDKIM}
IGNORE= you cannot enable ARC without SPF and DKIM support
.endif
.endif
# DANE implies DNSSEC
.if ${PORT_OPTIONS:MDANE}
.if ! ${PORT_OPTIONS:MDNSSEC} || ! ${PORT_OPTIONS:MTLS}
IGNORE= you cannot enable DANE without DNSSEC support or without TLS support
.endif
.endif
.if ${PORT_OPTIONS:MSA_EXIM} || defined(FETCH_ALL)
MASTER_SITES+= http://marc.merlins.org/linux/exim/files/:sa_exim \
SF/sa-exim/sa-exim/${SA_EXIM_VERSION}:sa_exim
DISTFILES+= sa-exim-${SA_EXIM_VERSION}.tar.gz:sa_exim
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-Local-sa-exim.c
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-Local-sa-exim.conf
.endif
EXIM_VERSION= 4.98.2
SA_EXIM_VERSION=4.2.1
EXIM_INSTALL_ARG+= "-no_chown" "-no_symlink"
EXTRA_PATCHES+= `${FIND} ${PATCHDIR} -name '74_*.patch'|${SORT} -h`
.if !defined(EXIMON_ONLY)
PLIST_SUB+= EXIM=""
.if defined(PKGNAMESUFFIX)
CONFLICTS+= ${PKGNAMEPREFIX}${PORTNAME}-4.*
.endif
.for suffix in -ldap2 -mysql -postgresql -sa-exim -sqlite
.if !defined(PKGNAMESUFFIX) || ${PKGNAMESUFFIX} != ${suffix}
CONFLICTS+= ${PKGNAMEPREFIX}${PORTNAME}${suffix}-4.*
.endif
.endfor
.if ${PORT_OPTIONS:MEXIMON}
CONFLICTS+= ${PKGNAMEPREFIX}${PORTNAME}-monitor-4.*
.endif
PKGMESSAGE= ${WRKDIR}/POST-INSTALL-NOTES
.else # !EXIMON_ONLY
PLIST_SUB+= EXIM="@comment "
PORT_OPTIONS+= EXIMON
PKGMESSAGE= ${WRKDIR}/pkg-message
EXIM_INSTALL_ARG+= "eximon" "eximon.bin"
.endif # !EXIMON_ONLY
PORTDOC_BASE= ACKNOWLEDGMENTS NOTICE README.UPDATING
PORTDOC_FILES= ChangeLog Exim3.upgrade Exim4.upgrade NewStuff \
OptionLists.txt README README.SIEVE dbm.discuss.txt \
experimental-spec.txt filter.txt spec.txt
PORT_EXAMPLES= convert4r3 convert4r4 transport-filter.pl
DAILY_SCRIPTS= 150.exim-tidydb 460.exim-mail-rejects
MAKE_ENV+= OSTYPE="${OPSYS}" ARCHTYPE="${ARCH}" DUMMY_LDFLAGS="${DUMMY_LDFLAGS}" STRIP_COMMAND="${STRIP_CMD}"
EXIM_USER?= mailnull
EXIM_GROUP?= mail
# Default user/group are system ones, so we don't want to check them
.if ${EXIM_USER} != "mailnull"
USERS= ${EXIM_USER}
.endif
.if ${EXIM_GROUP} != "mail"
GROUPS= ${EXIM_GROUP}
.endif
LOGDIR?= /var/log/exim
LOG_FILE_PATH?= ${LOGDIR}/%slog
CONFIG_FILE_PATH?= ${PREFIX}/etc/exim/configure
ALT_CONFIG_PREFIX?= ${PREFIX}/etc/exim/
EXIM_DYNAMIC_LDFLAGS= -fPIC -rdynamic -Wl,--export-dynamic
SED_SCRIPT= -e 's,%%PREFIX%%,${PREFIX},g' \
-e 's,%%DOCSDIR%%,${DOCSDIR},g' \
-e 's,%%EXAMPLESDIR%%,${EXAMPLESDIR},g' \
-e 's,%%EXIM_USER%%,${EXIM_USER},g' \
-e 's,%%EXIM_GROUP%%,${EXIM_GROUP},g' \
-e 's,%%LOGDIR%%,${LOGDIR},g'
SEDLIST+= -e 's,XX_CFLAGS_XX,${CFLAGS:S/,/\\,/g},' \
-e 's,XX_PREFIX_XX,${PREFIX:S/,/\\,/g},' \
-e 's,XX_LOCALBASE_XX,${LOCALBASE:S/,/\\,/g},' \
-e 's,XX_LOG_FILE_PATH_XX,${LOG_FILE_PATH:S/,/\\,/g},' \
-e 's,XX_CONFIG_FILE_PATH_XX,${CONFIG_FILE_PATH:S/,/\\,/g},' \
-e 's,XX_ALT_CONFIG_PREFIX_XX,${ALT_CONFIG_PREFIX:S/,/\\,/g},' \
-e 's,XX_EXIM_USER_XX,${EXIM_USER:S/,/\\,/g},' \
-e 's,XX_EXIM_GROUP_XX,${EXIM_GROUP:S/,/\\,/g},' \
-e 's,XX_DEFAULT_CHARSET_XX,${WITH_DEFAULT_CHARSET:S/,/\\,/g},' \
-e 's,XX_DYNAMIC_LDFLAGS_XX,${EXIM_DYNAMIC_LDFLAGS:S/,/\\,/g},'
PLIST_SUB+= EXIM_VERSION="${EXIM_VERSION}-${PORTREVISION}" \
EXIM_USER=${EXIM_USER} \
EXIM_GROUP=${EXIM_GROUP} \
LOGDIR="${LOGDIR:S/^\///}"
# Exim refuses to run local deliveries as root by default. You can
# add other users to this colon-separated list that cannot be
# overridden at runtime below, but are advised not to remove "root".
#WITH_FIXED_NEVER_USERS= root:daemon:bin
# When Exim is decoding MIME "words" in header lines it converts any foreign
# character sets to the one that is set in the headers_charset option.
# The default setting is defined by this setting:
WITH_DEFAULT_CHARSET?= ISO-8859-1
# You should not need to fiddle with anything below this point.
LIB_DEPENDS+= libpcre2-posix.so:devel/pcre2
.if ! ${PORT_OPTIONS:MDKIM}
SEDLIST+= -e 's,^\# (DISABLE_DKIM=),\1,'
.endif
.if ${PORT_OPTIONS:MLISTMATCH_RHS}
SEDLIST+= -e 's,^\# (EXPAND_LISTMATCH_RHS=),\1,'
.endif
.if ${PORT_OPTIONS:MDCC}
SEDLIST+= -e 's,^\# (EXPERIMENTAL_DCC=),\1,'
.endif
.if ${PORT_OPTIONS:MPROXY}
SEDLIST+= -e 's,^\# (SUPPORT_PROXY=),\1,'
.endif
.if ${PORT_OPTIONS:MCERTNAMES}
SEDLIST+= -e 's,^\# (EXPERIMENTAL_CERTNAMES=),\1,'
.endif
.if ${PORT_OPTIONS:MDSN}
SEDLIST+= -e 's,^\# (EXPERIMENTAL_DSN=),\1,'
.endif
.if !${PORT_OPTIONS:MDANE}
SEDLIST+= -e 's,^(SUPPORT_DANE=),\#\1,'
.endif
.if ${PORT_OPTIONS:MARC}
SEDLIST+= -e 's,^\# (EXPERIMENTAL_ARC=),\1,'
.endif
.if !${PORT_OPTIONS:MEVENT}
SEDLIST+= -e 's,^\# (DISABLE_EVENT=),\1,'
.endif
.if ${PORT_OPTIONS:MINTERNATIONAL}
SEDLIST+= -e 's,^\# (SUPPORT_I18N=),\1,' \
-e 's,^\# (SUPPORT_I18N_2008=),\1,' \
-e 's,XX_IDN_LIBS_XX,-L${LOCALBASE}/lib -lidn -lidn2,'
.else
SEDLIST+= -e 's,XX_IDN_LIBS_XX,,'
.endif
.if ${PORT_OPTIONS:MSOCKS}
SEDLIST+= -e 's,^\# (SUPPORT_SOCKS=),\1,'
.endif
.if !${PORT_OPTIONS:MPRDR}
SEDLIST+= -e 's,^\# (DISABLE_PRDR=),\1,'
.endif
.if !${PORT_OPTIONS:MOCSP}
SEDLIST+= -e 's,^\# (DISABLE_OCSP=),\1,'
.endif
.if !${PORT_OPTIONS:MDNSSEC}
SEDLIST+= -e 's,^\# (DISABLE_DNSSEC=),\1,'
.endif
.if ${PORT_OPTIONS:MDMARC}
SEDLIST+= -e 's,XX_DMARC_LIBS_XX,-L${LOCALBASE}/lib -lopendmarc,' \
-e 's,^\# (SUPPORT_DMARC=),\1,'
.else
SEDLIST+= -e 's,XX_DMARC_LIBS_XX,,'
.endif
.if ${PORT_OPTIONS:MWISHLIST}
EXTRA_PATCHES+= `${FIND} ${PATCHDIR} -name 'wishlist-*.patch'`
.endif
.if ${PORT_OPTIONS:MFIXED_NEVER_USERS}
SEDLIST+= -e 's,^(FIXED_NEVER_USERS=).*,\1${WITH_FIXED_NEVER_USERS:S/,/\\,/g},'
.endif
.if ${PORT_OPTIONS:MEXIMON}
SEDLIST+= -e 's,^\# (EXIM_MONITOR=),\1,'
.endif
.if ${PORT_OPTIONS:MTLS}
.if ! ${PORT_OPTIONS:MGNUTLS}
USES+= ssl
SEDLIST+= -e 's,^\# (USE_OPENSSL=),\1,'
SEDLIST+= -e 's,^\# (TLS_LIBS=.*-lssl[[:space:]]),\1,'
BROKEN_SSL= openssl31
BROKEN_SSL_REASON= error: token is not a valid binary operator in a preprocessor subexpression
.else
SEDLIST+= -e 's,^\# (USE_GNUTLS=),\1,'
SEDLIST+= -e 's,^\# (TLS_LIBS=.*-lgnutls[[:space:]]),\1,'
.endif
.else # TLS support
SEDLIST+= -e 's,^\# (DISABLE_TLS=),\1,'
.endif
.if ${PORT_OPTIONS:MEMBEDDED_PERL}
SEDLIST+= -e 's,^\# (EXIM_PERL=),\1,'
.endif
.if ${PORT_OPTIONS:MTCP_WRAPPERS}
SEDLIST+= -e 's,XX_TCP_WRAPPERS_LIBS_XX,-lwrap,' \
-e 's,^\# (USE_TCP_WRAPPERS=),\1,'
.else
SEDLIST+= -e 's,XX_TCP_WRAPPERS_LIBS_XX,,'
.endif
.if ${PORT_OPTIONS:MICONV}
SEDLIST+= -e 's,XX_ICONV_LIBS_XX,-L${LOCALBASE:S/,/\\,/g}/lib ${ICONV_LIB},' \
-e 's,^\# (HAVE_ICONV=),\1,'
.else
SEDLIST+= -e 's,XX_ICONV_LIBS_XX,,'
.endif
.if ${PORT_OPTIONS:MOPENLDAP}
LDAP_LIB_TYPE= OPENLDAP2
SEDLIST+= -e 's,XX_LDAP_LIBS_XX,-L${LOCALBASE:S/,/\\,/g}/lib -llber -lldap,' \
-e 's,XX_LDAP_INCLUDE_XX,-I${LOCALBASE:S/,/\\,/g}/include,' \
-e 's,XX_LDAP_TYPE_XX,${LDAP_LIB_TYPE:S/,/\\,/g},' \
-e 's,^\# (LOOKUP_LDAP=),\1,'
.else
SEDLIST+= -e 's,XX_LDAP_[^ ]*_XX,,' \
-e 's,^(LDAP_LIB_TYPE=),\# \1,'
.endif
.if ${PORT_OPTIONS:MBDB}
INVALID_BDB_VER= 2 3 6 18
DB_LIBS= -L${BDB_LIB_DIR} -l${BDB_LIB_NAME}
DB_INCLUDES= -I${BDB_INCLUDE_DIR}
.else
DB_LIBS=
DB_INCLUDES=
SEDLIST+= -e 's,^(DBMLIB=),\# \1,'
.endif
SEDLIST+= -e 's,XX_DB_LIBS_XX,${DB_LIBS:S/,/\\,/g},' \
-e 's,XX_DB_INCLUDES_XX,${DB_INCLUDES:S/,/\\,/g},'
.if ${PORT_OPTIONS:MLMDB}
_LMDB_LIBS= -L${LOCALBASE}/lib -llmdb
_LMDB_INCLUDES= -I${LOCALBASE}/include
SEDLIST+= -e 's,^\# (EXPERIMENTAL_LMDB=),\1,'
.else
_LMDB_LIBS=
_LMDB_INCLUDES=
.endif
SEDLIST+= -e 's,XX_LMDB_LIBS_XX,${_LMDB_LIBS:S/,/\\,/g},' \
-e 's,XX_LMDB_INCLUDES_XX,${_LMDB_INCLUDES:S/,/\\,/g},'
.if ${PORT_OPTIONS:MMYSQL}
SEDLIST+= -e 's,XX_MYSQL_LIBS_XX,-L${LOCALBASE:S/,/\\,/g}/lib/mysql -l${_MYSQL_SHLIB:S/lib//},' \
-e 's,XX_MYSQL_INCLUDE_XX,-I${LOCALBASE:S/,/\\,/g}/include/mysql,' \
-e 's,^\# (LOOKUP_MYSQL=),\1,'
.else
SEDLIST+= -e 's,XX_MYSQL_[^ ]*_XX,,'
.endif
.if ${PORT_OPTIONS:MSASLAUTHD}
SASLAUTHD_SOCKET?= /var/run/saslauthd/mux
SEDLIST+= -e 's,^\# (CYRUS_SASLAUTHD_SOCKET=).*,\1${SASLAUTHD_SOCKET:S/,/\\,/g},'
.endif
.if ${PORT_OPTIONS:MPAM}
SEDLIST+= -e 's,XX_PAM_LIBS_XX,-lpam,' \
-e 's,^\# (SUPPORT_PAM=),\1,'
.else
SEDLIST+= -e 's,XX_PAM_LIBS_XX,,'
.endif
.if ${PORT_OPTIONS:MAUTH_CRAM_MD5}
SEDLIST+= -e 's,^\# (AUTH_CRAM_MD5=),\1,'
.endif
.if ${PORT_OPTIONS:MAUTH_PLAINTEXT}
SEDLIST+= -e 's,^\# (AUTH_PLAINTEXT=),\1,'
.endif
.if ${PORT_OPTIONS:MAUTH_DOVECOT}
SEDLIST+= -e 's,^\# (AUTH_DOVECOT=),\1,'
.endif
.if ${PORT_OPTIONS:MAUTH_SPA}
SEDLIST+= -e 's,^\# (AUTH_SPA=),\1,'
.endif
.if ${PORT_OPTIONS:MAUTH_SASL}
SEDLIST+= -e 's,^\# (AUTH_CYRUS_SASL=),\1,' \
-e 's,^\# (AUTH_LIBS=.*-lsasl2),\1,'
.endif
.if ${PORT_OPTIONS:MAUTH_TLS}
SEDLIST+= -e 's,^\# (AUTH_TLS=),\1,'
.endif
.if ${PORT_OPTIONS:MAUTH_RADIUS}
WITH_RADIUS_TYPE?= RADLIB
.if ${WITH_RADIUS_TYPE:tl} == radlib
SEDLIST+= -e 's,XX_RADIUS_LIBS_XX,-lradius,' \
-e 's,^\# (RADIUS_CONFIG_FILE=).*,\1/etc/radius.conf,' \
-e 's,^\# (RADIUS_LIB_TYPE=).*,\1RADLIB,'
.elif ${WITH_RADIUS_TYPE:tl} == radiusclient
LIB_DEPENDS+= libfreeradius-client.so:net/freeradius-client
SEDLIST+= -e 's,XX_RADIUS_LIBS_XX,-L${LOCALBASE:S/,/\\,/g}/lib -lfreeradius-client,' \
-e 's,^\# (RADIUS_CONFIG_FILE=).*,\1${LOCALBASE:S/,/\\,/g}/etc/radiusclient/radiusclient.conf,' \
-e 's,^\# (RADIUS_LIB_TYPE=).*,\1RADIUSCLIENTNEW,'
.else
IGNORE= the variable WITH_RADIUS_TYPE must be either RADLIB or RADIUSCLIENT
.endif
.else
SEDLIST+= -e 's,XX_RADIUS_LIBS_XX,,'
.endif
.if ${PORT_OPTIONS:MPGSQL}
SEDLIST+= -e 's,XX_PGSQL_LIBS_XX,-L${LOCALBASE:S/,/\\,/g}/lib -lpq,' \
-e 's,XX_PGSQL_INCLUDE_XX,-I${LOCALBASE:S/,/\\,/g}/include/pgsql,' \
-e 's,^\# (LOOKUP_PGSQL=),\1,'
.else
SEDLIST+= -e 's,XX_PGSQL_[^ ]*_XX,,'
.endif
.if ! ${PORT_OPTIONS:MPGSQL} && ! ${PORT_OPTIONS:MMYSQL} && !defined(LDAP_LIB_TYPE) && \
! ${PORT_OPTIONS:MBDB} && ! ${PORT_OPTIONS:MLMDB}
SEDLIST+= -e 's,^(LOOKUP_LIBS=),\# \1,' \
-e 's,^(LOOKUP_INCLUDE=),\# \1,'
.endif
.if ! ${PORT_OPTIONS:MDNSDB}
SEDLIST+= -e 's,^(LOOKUP_DNSDB=),\# \1,'
.endif
.if ${PORT_OPTIONS:MMAILDIR}
SEDLIST+= -e 's,^\# (SUPPORT_MAILDIR=),\1,'
.endif
.if ${PORT_OPTIONS:MMAILSTORE}
SEDLIST+= -e 's,^\# (SUPPORT_MAILSTORE=),\1,'
.endif
.if ${PORT_OPTIONS:MMBX}
SEDLIST+= -e 's,^\# (SUPPORT_MBX=),\1,'
.endif
.if ${PORT_OPTIONS:MCDB}
SEDLIST+= -e 's,^\# (LOOKUP_CDB=),\1,'
.endif
.if ${PORT_OPTIONS:MDSEARCH}
SEDLIST+= -e 's,^\# (LOOKUP_DSEARCH=),\1,'
.endif
.if ! ${PORT_OPTIONS:MLSEARCH}
SEDLIST+= -e 's,^(LOOKUP_LSEARCH=),\# \1,'
.endif
.if ${PORT_OPTIONS:MNIS}
SEDLIST+= -e 's,^\# (LOOKUP_NIS=),\1,'
.endif
.if ${PORT_OPTIONS:MPASSWD}
SEDLIST+= -e 's,^\# (LOOKUP_PASSWD=),\1,'
.endif
.if ${PORT_OPTIONS:MSQLITE}
SEDLIST+= -e 's,XX_SQLITE_LIBS_XX,`pkg-config --static --libs sqlite3`,' \
-e 's,XX_SQLITE_FLAGS_XX,`pkg-config --cflags sqlite3`,' \
-e 's,^\# (LOOKUP_SQLITE=),\1,'
.else
SEDLIST+= -e 's,XX_SQLITE_LIBS_XX,,' \
-e 's,XX_SQLITE_FLAGS_XX,,'
.endif
.if ${PORT_OPTIONS:MREDIS}
SEDLIST+= -e 's,XX_REDIS_LIBS_XX,-L${LOCALBASE}/lib -lhiredis,' \
-e 's,^\# (LOOKUP_REDIS=),\1,' \
-e 's,^\# (REDIS=),\1,'
.else
SEDLIST+= -e 's,XX_REDIS_LIBS_XX,,'
.endif
.if ${PORT_OPTIONS:MLMTP}
SEDLIST+= -e 's,^\# (TRANSPORT_LMTP=),\1,'
.endif
.if ! ${PORT_OPTIONS:MALT_CONFIG_PREFIX}
SEDLIST+= -e 's,^(ALT_CONFIG_PREFIX=),\# \1,'
.endif
.if ${PORT_OPTIONS:MSPF}
SEDLIST+= -e 's,XX_SPF_FLAGS_XX,-DSPF,' \
-e 's,XX_SPF_LIBS_XX,-L${LOCALBASE}/lib -lspf2 -lpthread,' \
-e 's,^\# (SUPPORT_SPF=),\1,'
.else
SEDLIST+= -e 's,XX_SPF_FLAGS_XX,,' \
-e 's,XX_SPF_LIBS_XX,,'
.endif
.if ${PORT_OPTIONS:MSRS}
SEDLIST+= -e 's,XX_SRS_FLAGS_XX,-DSUPPORT_SRS,' \
-e 's,XX_SRS_LIBS_XX,,'
.elif ${PORT_OPTIONS:MOLD_SRS}
LIB_DEPENDS+= libsrs_alt.so:mail/libsrs_alt
SEDLIST+= -e 's,XX_SRS_FLAGS_XX,-DEXPERIMENTAL_SRS_ALT,' \
-e 's,XX_SRS_LIBS_XX,-L${LOCALBASE}/lib -lsrs_alt,'
.else
SEDLIST+= -e 's,XX_SRS_FLAGS_XX,,' \
-e 's,XX_SRS_LIBS_XX,,'
.endif
.if ${PORT_OPTIONS:MREADLINE}
SEDLIST+= -e 's,^\# (USE_READLINE=),\1,'
.endif
.if ${PORT_OPTIONS:MCONTENT_SCAN}
SEDLIST+= -e 's,^\# (WITH_CONTENT_SCAN=),\1,'
.endif
.if !defined(EXIMON_ONLY) && ${PORT_OPTIONS:MDAEMON}
USE_RC_SUBR= exim
PLIST_SUB+= EXIMDAEMON=""
SUB_LIST+= LOGDIR="${LOGDIR}"
.else
PLIST_SUB+= EXIMDAEMON="@comment "
.endif
.if ${PORT_OPTIONS:MIPV6}
SEDLIST+= -e 's,^\# (HAVE_IPV6=),\1,'
.endif
.if ${PORT_OPTIONS:MDISABLE_D_OPT}
SEDLIST+= -e 's,^\# (DISABLE_D_OPTION=),\1,'
.else
.if defined(WHITELIST_D_MACROS)
SEDLIST+= -e 's,^\# (WHITELIST_D_MACROS=).*$$,\1${WHITELIST_D_MACROS:S/,/\\,/g},'
.endif
.endif
.if defined(TRUSTED_CONFIG_LIST)
SEDLIST+= -e 's,^\# (TRUSTED_CONFIG_LIST=).*$$,\1${TRUSTED_CONFIG_LIST:S/,/\\,/g},'
.endif
.if ${PORT_OPTIONS:MQUEUEFILE}
SEDLIST+= -e 's,^\# (EXPERIMENTAL_QUEUEFILE=),\1,'
.endif
MAKE_ENV+= INSTALL_ARG="${EXIM_INSTALL_ARG}"
DUMMY_LDFLAGS!= ${ECHO_CMD} ${LDFLAGS} | ${SED} -e 's|-Wl,-rpath|-Wl,-DUMMYrpath|g; s|-rpath|-Wl,-rpath|g; s|-DUMMYrpath|-rpath|g'
pre-everything::
@${ECHO} 'Exim now drops privileges when alternate configuration'
@${ECHO} 'files are used. You can set make variable TRUSTED_CONFIG_LIST'
@${ECHO} 'to specify the list of configuration files for which'
@${ECHO} 'root privileges will be retained.'
@${ECHO} ''
@${ECHO} 'You can whitelist some macros using the make variable'
@${ECHO} 'WHITELIST_D_MACROS. This is useful if you are running'
@${ECHO} 'with DISABLE_D_OPT set, but macros whitelisting will be'
@${ECHO} 'removed in some future Exim release, so it is better'
@${ECHO} 'to use TRUSTED_CONFIG_LIST to set the list of trusted'
@${ECHO} 'configuration files.'
.if empty(.MAKEFLAGS:M-s) && ${PORT_OPTIONS:MWISHLIST}
@${ECHO} ''
@${ECHO} 'Included extra patches:'
@${FIND} ${PATCHDIR} -name 'wishlist-*.patch' \
-exec ${SED} -ne 's,^# , ,p' {} \;
@${ECHO} ''
.endif
post-extract:
.if ${PORT_OPTIONS:MSA_EXIM}
@cd ${WRKDIR} && ${TAR} ${EXTRACT_BEFORE_ARGS} ${_DISTDIR}/sa-exim-${SA_EXIM_VERSION}.tar.gz ${EXTRACT_AFTER_ARGS}
@@${CP} ${WRKDIR}/sa-exim-${SA_EXIM_VERSION}/sa-exim.c ${WRKSRC}/Local
@@${CP} ${WRKDIR}/sa-exim-${SA_EXIM_VERSION}/sa-exim.conf ${WRKSRC}/Local
.endif
do-configure:
@${MKDIR} ${WRKSRC}/Local
@${SED} -E ${SEDLIST} ${WRKSRC}/src/EDITME > ${WRKSRC}/Local/Makefile
.if ${PORT_OPTIONS:MEXIMON}
@${CP} ${WRKSRC}/exim_monitor/EDITME ${WRKSRC}/Local/eximon.conf
.endif
@${REINPLACE_CMD} -E ${SEDLIST} ${WRKSRC}/src/configure.default
@${REINPLACE_CMD} -e 's!$$(LDFLAGS)!$$(DUMMY_LDFLAGS) -L$${LOCALBASE}/lib!' ${WRKSRC}/OS/Makefile-Base
@${REINPLACE_CMD} -e 's/"(Exim $$version_number)\\n\\t"/"(Exim $$version_number (${OPSYS}))\\n\\t"/' \
${WRKSRC}/src/globals.c
@${REINPLACE_CMD} -e 's/Exim version %s \(#%s \)\{0,1\}/&(${OPSYS} ${OSREL}) /' ${WRKSRC}/src/exim.c
@${REINPLACE_CMD} -e 's/^#include "cnumber\.h"$$/${PORTREVISION}/' ${WRKSRC}/src/version.c
@${REINPLACE_CMD} -E -e 's/^(PERL_COMMAND=).*/\1${PERL:S,/,\/,g}/' \
-e 's/^(CC=).*/\1${CC:S,/,\/,g}/' ${WRKSRC}/OS/Makefile-Default
.if ${PORT_OPTIONS:MSA_EXIM}
@${REINPLACE_CMD} -E -e 's/^\# (HAVE_LOCAL_SCAN=).*/\1yes/' \
${WRKSRC}/OS/Makefile-Default
@${REINPLACE_CMD} -E -e 's/^(LOCAL_SCAN_SOURCE=).*/\1Local\/sa-exim.c/' \
${WRKSRC}/OS/Makefile-Default
@{ \
${ECHO_CMD} "char *version=\"${SA_EXIM_VERSION}\";"; \
${ECHO_CMD} "#define SPAMC_LOCATION \"${LOCALBASE}/bin/spamc\""; \
${ECHO_CMD} "#define SPAMASSASSIN_CONF \"${PREFIX}/etc/exim/sa-exim.conf\""; \
} > ${WRKSRC}/Local/sa-exim.h
@${REINPLACE_CMD} -e 's,/usr/bin/spamc,${LOCALBASE}/bin/spamc,' \
${WRKSRC}/Local/sa-exim.conf
.endif
@(cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} configure)
post-build:
.for script in ${DAILY_SCRIPTS}
@${SED} ${SED_SCRIPT} ${FILESDIR}/${script}.sh > ${WRKDIR}/${script}.sh
.endfor
@${SED} ${SED_SCRIPT} ${FILESDIR}/POST-INSTALL-NOTES > \
${WRKDIR}/POST-INSTALL-NOTES
@${SED} ${SED_SCRIPT} ${FILESDIR}/POST-INSTALL-NOTES.clamd > ${WRKDIR}/POST-INSTALL-NOTES.clamd
@${SED} ${SED_SCRIPT} ${FILESDIR}/POST-INSTALL-NOTES > ${WRKDIR}/POST-INSTALL-NOTES
@[ ! -f ${PKGDIR}/pkg-message ] || ${SED} ${SED_SCRIPT} ${PKGDIR}/pkg-message > ${WRKDIR}/pkg-message
.if !defined(EXIMON_ONLY)
post-install:
.if ${PORT_OPTIONS:MDAEMON}
${MKDIR} ${STAGEDIR}${PREFIX}/etc/periodic/daily
.for script in ${DAILY_SCRIPTS}
${INSTALL_SCRIPT} ${WRKDIR}/${script}.sh ${STAGEDIR}${PREFIX}/etc/periodic/daily/${script}
.endfor
.endif
@${MKDIR} -m 750 ${STAGEDIR}${LOGDIR}
${INSTALL_MAN} ${WRKSRC}/doc/exim.8 ${STAGEDIR}${PREFIX}/share/man/man8
.if ${PORT_OPTIONS:MDOCS}
@${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${WRKDIR}/POST-INSTALL-NOTES ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${WRKDIR}/POST-INSTALL-NOTES.clamd ${STAGEDIR}${DOCSDIR}
.for docfile in ${PORTDOC_BASE}
${INSTALL_DATA} ${WRKSRC}/${docfile} ${STAGEDIR}${DOCSDIR}
.endfor
.for docfile in ${PORTDOC_FILES}
${INSTALL_DATA} ${WRKSRC}/doc/${docfile} ${STAGEDIR}${DOCSDIR}
.endfor
@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
.for example in ${PORT_EXAMPLES}
${INSTALL_SCRIPT} ${WRKSRC}/build-${OPSYS}-${ARCH}/${example} ${STAGEDIR}${EXAMPLESDIR}
.endfor
.endif
.if ${PORT_OPTIONS:MSA_EXIM}
${INSTALL_DATA} ${WRKSRC}/Local/sa-exim.conf \
${STAGEDIR}${PREFIX}/etc/exim/sa-exim.conf.sample
.endif
.endif # ! defined(EXIMON_ONLY)
.include <bsd.port.pre.mk>
# If using clang, avoid too many warnings due to Exim code style
.if ${CHOSEN_COMPILER_TYPE} == "clang"
EXIM_WARN_FLAGS?= -Wno-logical-op-parentheses -Wno-macro-redefined -Wno-parentheses -Wno-dangling-else
.endif
CFLAGS+= ${EXIM_WARN_FLAGS}
.include <bsd.port.post.mk>

5
mail/exim/distinfo Normal file
View File

@ -0,0 +1,5 @@
TIMESTAMP = 1743093330
SHA256 (exim/exim-4.98.2.tar.bz2) = 14d7ead473394c8712f2d28835ea93c475603cbc2b3200b6188eac8782985cf1
SIZE (exim/exim-4.98.2.tar.bz2) = 2098693
SHA256 (exim/sa-exim-4.2.1.tar.gz) = 24d4bf7b0fdddaea11f132981cebb6a86a4ab20ef54111a8ebd481b421c6e2c1
SIZE (exim/sa-exim-4.2.1.tar.gz) = 68933

View File

@ -0,0 +1,49 @@
#!/bin/sh
#
# Exim hints database maintenance
#
# contributed by: Oliver Eikemeier <eikemeier@fillmore-labs.com>
#
# If there is a global system configuration file, suck it in.
#
if [ -r /etc/defaults/periodic.conf ]; then
. /etc/defaults/periodic.conf
source_periodic_confs
fi
: ${exim_tidydb_enable="YES"}
: ${exim_tidydb="%%PREFIX%%/sbin/exim_tidydb"}
# Set this to arbitrary shell command to filter
# the output from this periodic script, for example,
# exim_tidydb_filter="| tail -100".
: ${exim_tidydb_filter=""}
: ${exim_dbdir="/var/spool/exim"}
tidy () {
for db in "$exim_dbdir"/db/*.lockfile; do
[ "$db" = "$exim_dbdir/db/*.lockfile" ] && continue
echo
db_name=`basename "$db" .lockfile`
if [ -e "${exim_dbdir}/db/${db_name}.db" ]; then
"$exim_tidydb" "$exim_dbdir" "$db_name"
fi
done
}
case "$exim_tidydb_enable" in
[Yy][Ee][Ss])
echo ""
echo "Tidying Exim hints databases:"
eval tidy "$exim_tidydb_filter"
if [ $? = 0 ]; then
rc=0
else
rc=1
fi
;;
*) rc=0;;
esac
exit $rc

View File

@ -0,0 +1,66 @@
#!/bin/sh
#
# Check for rejected mail
# Log lines that end with ' : IGNORE' will not be reported
#
# contributed by: Oliver Eikemeier <eikemeier@fillmore-labs.com>
#
# If there is a global system configuration file, suck it in.
#
if [ -r /etc/defaults/periodic.conf ]
then
. /etc/defaults/periodic.conf
source_periodic_confs
fi
: ${exim_status_mail_rejects_enable="YES"}
: ${exim_status_mail_rejects_logs=2}
: ${exim_rejectlog="%%LOGDIR%%/rejectlog"}
case "$exim_status_mail_rejects_enable" in
[Yy][Ee][Ss])
if [ ! -d `dirname "$exim_rejectlog"` ]
then
echo '$exim_status_mail_rejects_enable is set but' \
"`dirname "$exim_rejectlog"` doesn't exist"
rc=2
elif [ "$exim_status_mail_rejects_logs" -le 0 ]
then
echo '$exim_status_mail_rejects_enable is set but' \
'$exim_status_mail_rejects_logs is not greater than zero'
rc=2
else
echo
echo "Checking for rejected mail:"
start=`date -v-1d '+%Y-%m-%d'`
n=$(($exim_status_mail_rejects_logs - 2))
rc=$({
while [ $n -ge 0 ]
do
if [ -f "$exim_rejectlog.$n" ]
then
cat "$exim_rejectlog.$n"
elif [ -f "$exim_rejectlog.$n.gz" ]
then
zcat -fc "$exim_rejectlog.$n.gz"
elif [ -f "$exim_rejectlog.$n.bz2" ]
then
bzcat -fc "$exim_rejectlog.$n.bz2"
fi
n=$(($n - 1))
done
if [ -f "$exim_rejectlog" ]
then
cat "$exim_rejectlog"
fi
} |
grep -e "^$start" | grep -v ' : IGNORE$' | tee /dev/stderr | wc -l)
[ $rc -gt 0 ] && rc=1
fi;;
*) rc=0;;
esac
exit $rc

View File

@ -0,0 +1,48 @@
[
{ type: install
message: <<EOM
The following documentation has been installed:
man exim -> Exim options (command line)
%%DOCSDIR%%/spec.txt -> Exim Specification (User Guide)
%%DOCSDIR%%/filter.txt -> Exim Filter Specification (for end-users)
Postscript, PDF, HTML and texinfo versions of these documents can be
installed via one of the mail/exim-doc-* ports.
An online version as well as a comprehensive FAQ and a mailing list
archive is available at:
http://www.exim.org/
Descriptions of new features not available it the manual, and a listing
of all changes, including bug fixes are documented in:
%%DOCSDIR%%/NewStuff
%%DOCSDIR%%/ChangeLog
To use Exim instead of sendmail on startup:
*) Clear the sendmail queue and stop the sendmail daemon.
*) Adjust mailer.conf(5) as appropriate.
*) Set the 'sendmail_enable' rc.conf(5) variable to 'NONE'.
*) Set the 'daily_status_include_submit_mailq' and
'daily_clean_hoststat_enable' periodic.conf(5)
variables to 'NO'.
*) Consider setting 'daily_queuerun_enable' and
'daily_submit_queuerun' to "NO" in periodic.conf(5),
if you intend to manage queue runners / deliveries closely.
*) Set the 'exim_enable' rc.conf(5) variable to 'YES'.
*) Start exim with '%%PREFIX%%/etc/rc.d/exim start'.
You may also want to configure newsyslog(8) to rotate Exim log files:
%%LOGDIR%%/mainlog mailnull:mail 640 7 * @T00 ZN
%%LOGDIR%%/rejectlog mailnull:mail 640 7 * @T00 ZN
Additional scripts to help upgrading are installed in:
%%EXAMPLESDIR%%
EOM
}
]

View File

@ -0,0 +1,52 @@
[
{ type: install
message: <<EOM
The following steps will enable clamd malware scanning using exiscan ACLs.
It is important to follow them in sequence.
* Install security/clamav from the ports tree.
* Confirm that user clamav was added to the mail group in /etc/group.
* Confirm that /var/log/clamav and /var/run/clamav exist and are owned
by clamav:clamav.
* In Exim's configure file, set av_scanner=clamd:/var/run/clamav/clamd
* Adjust the exiscan ACLs in Exim's configure file. Make sure you use
the demime option with the malware check, e.g.:
deny message = This message contains malware ($malware_name)
demime = *
malware = *
* Edit clamav.conf as follows:
LogFile /var/log/clamav/clamd.log
PidFile /var/run/clamav/clamd.pid
LocalSocket /var/run/clamav/clamd
User clamav
AllowSupplementaryGroups
ScanArchive
ScanMail
You may wish to make other changes as well.
* Make sure clamd_enable="YES" has been added to /etc/rc.conf; this is
required by the clamav port's startup script,
%%RC_DIR%%/clamd%%RC_SUFX%% .
* Run freshclam.
* Add a cron job that runs freshclam --daemon-notify --quiet at least
once a day.
* Start clamd with %%RC_DIR%%/clamd%%RC_SUFX%% start .
* Start Exim with %%RC_DIR%%/exim%%RC_SUFX%% start .
Sheldon Hearn <sheldonh@FreeBSD.org>
EOM
}
]

60
mail/exim/files/exim.in Normal file
View File

@ -0,0 +1,60 @@
#!/bin/sh
# PROVIDE: mail
# REQUIRE: LOGIN
# KEYWORD: shutdown
# we make mail start late, so that things like .forward's are not
# processed until the system is fully operational
#
# Add the following lines to /etc/rc.conf to enable exim:
#
#exim_enable="YES"
#
# See exim(8) for flags
#
. /etc/rc.subr
name=exim
rcvar=exim_enable
command=%%PREFIX%%/sbin/exim
pidfile=/var/run/exim.pid
required_dirs=%%LOGDIR%%
required_files=%%PREFIX%%/etc/exim/configure
start_precmd=start_precmd
stop_postcmd=stop_postcmd
extra_commands="reload"
start_precmd()
{
case $sendmail_enable in
[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
warn "sendmail_enable should be set to NONE"
;;
[Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0)
case $sendmail_submit_enable in
[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
warn "sendmail_submit_enable should be set to NO"
;;
esac
;;
[Nn][Oo][Nn][Ee])
;;
esac
}
stop_postcmd()
{
rm -f $pidfile
}
# read settings, set default values
load_rc_config $name
: ${exim_enable="NO"}
: ${exim_flags="-bd -q30m"}
run_rc_command "$1"

View File

@ -0,0 +1,200 @@
--- Local/sa-exim.c.orig 2020-02-19 03:04:43 UTC
+++ Local/sa-exim.c
@@ -29,10 +29,7 @@ http://lists.merlins.org/lists/listinfo/sa-exim
#include "sa-exim.h"
/* Exim includes */
-#include "local_scan.h"
-extern FILE *smtp_out; /* Exim's incoming SMTP output file */
-extern int body_linecount; /* Line count in body */
-extern uschar *primary_hostname;
+#include <local_scan.h>
#ifdef DLOPEN_LOCAL_SCAN
@@ -409,6 +406,11 @@ int parsemlheader(char *buffer, FILE *readfh, char *he
if (buffer[strlen(buffer)-1] == '\n')
{
buffer[strlen(buffer)-1]=0;
+ /* and any carriage return */
+ if (buffer[strlen(buffer)-1] == '\r')
+ {
+ buffer[strlen(buffer)-1]=0;
+ }
}
if (SAEximDebug > 5)
{
@@ -515,6 +517,7 @@ int local_scan(volatile int fd, uschar **return_text)
int pid;
int writefd[2];
int readfd[2];
+ char *spamc_argv[10];
int i;
/* These are the only values that we want working after the longjmp
* The automatic ones can be clobbered, but we don't really care */
@@ -550,8 +553,9 @@ int local_scan(volatile int fd, uschar **return_text)
static char *SAspamcpath=SPAMC_LOCATION;
static char *SAsafemesgidchars=SAFEMESGIDCHARS
static char *SAspamcSockPath=NULL;
- static char *SAspamcPort="783";
- static char *SAspamcHost="127.0.0.1";
+ static char *SAspamcPort=NULL;
+ static char *SAspamcHost=NULL;
+ static char *SAspamcUser=NULL;
static char *SAEximRunCond="0";
static char *SAEximRejCond="1";
static int SAmaxbody=250*1024;
@@ -602,6 +606,10 @@ int local_scan(volatile int fd, uschar **return_text)
/* Do not put a %s in there, or you'll segfault */
static char *SAmsgerror="Temporary local error while processing message, please contact postmaster";
+ /* This needs to be retrieved through expand_string in order
+ not to violate the API. */
+ uschar *primary_hostname=expand_string("$primary_hostname");
+
/* New values we read from spamassassin */
char *xspamstatus=NULL;
char *xspamflag=NULL;
@@ -712,6 +720,7 @@ int local_scan(volatile int fd, uschar **return_text)
M_CHECKFORSTR(SAspamcSockPath);
M_CHECKFORSTR(SAspamcPort);
M_CHECKFORSTR(SAspamcHost);
+ M_CHECKFORSTR(SAspamcUser);
M_CHECKFORSTR(SAEximRunCond);
M_CHECKFORSTR(SAEximRejCond);
M_CHECKFORVAR(SAmaxbody, "%d");
@@ -914,6 +923,22 @@ int local_scan(volatile int fd, uschar **return_text)
ret=dup2(readfd[1],2);
CHECKERR(ret,"dup2 stderr",__LINE__);
+ i = 0;
+ spamc_argv[i++] = "spamc";
+ if (SAspamcUser && SAspamcUser[0])
+ {
+ expand=expand_string(SAspamcUser);
+ if (expand == NULL)
+ {
+ log_write(0, LOG_MAIN | LOG_PANIC, "SA: SAspamcUser expansion failure on %s, will run as Exim user instead.", SAspamcUser);
+ }
+ else if (expand[0] != '\0')
+ {
+ spamc_argv[i++] = "-u";
+ spamc_argv[i++] = expand;
+ }
+ }
+
/*
* I could implement the spamc protocol and talk to spamd directly
* instead of forking spamc, but considering the overhead spent
@@ -924,17 +949,30 @@ int local_scan(volatile int fd, uschar **return_text)
/* Ok, we cheat, spamc cares about how big the whole message is and
* we only know about the body size, so I'll give an extra 16K
* to account for any headers that can accompany the message */
+
+ spamc_argv[i++] = "-s";
+ spamc_argv[i++] = string_sprintf("%d", SAmaxbody+16384);
+
if(SAspamcSockPath)
{
- ret=execl(SAspamcpath, "spamc", "-s", string_sprintf("%d", SAmaxbody+16384), "-U", SAspamcSockPath, NULL);
- CHECKERR(ret,string_sprintf("exec %s", SAspamcpath),__LINE__);
+ spamc_argv[i++] = "-U";
+ spamc_argv[i++] = SAspamcSockPath;
}
else
{
- ret=execl(SAspamcpath, "spamc", "-s", string_sprintf("%d", SAmaxbody+16384), "-d", SAspamcHost, "-p", SAspamcPort, NULL);
- CHECKERR(ret,string_sprintf("exec %s", SAspamcpath),__LINE__);
+ if (SAspamcHost) {
+ spamc_argv[i++] = "-d";
+ spamc_argv[i++] = SAspamcHost;
+ }
+ if (SAspamcPort) {
+ spamc_argv[i++] = "-p";
+ spamc_argv[i++] = SAspamcPort;
+ }
}
-
+ spamc_argv[i++] = NULL;
+
+ ret=execv(SAspamcpath, spamc_argv);
+ CHECKERR(ret,string_sprintf("exec %s", SAspamcpath),__LINE__);
}
if (SAEximDebug > 8)
@@ -1045,6 +1083,11 @@ int local_scan(volatile int fd, uschar **return_text)
if (buffer[strlen(buffer)-1] == '\n')
{
buffer[strlen(buffer)-1]=0;
+ /* and any carriage return */
+ if (buffer[strlen(buffer)-1] == '\r')
+ {
+ buffer[strlen(buffer)-1]=0;
+ }
}
restart:
if (SAEximDebug > 5)
@@ -1218,7 +1261,7 @@ restart:
}
stret=write(fd, buffer, strlen(buffer));
- CHECKERR(stret,string_sprintf("SA body write to msg"),__LINE__);
+ CHECKERR(stret,string_sprintf("%s", "SA body write to msg"),__LINE__);
if (SAEximDebug > 8)
{
log_write(0, LOG_MAIN, "SA: Debug9: Wrote to msg; line %d (wrote %d)", line, ret);
@@ -1229,18 +1272,20 @@ restart:
}
}
+
if (SAEximDebug > 1)
{
log_write(0, LOG_MAIN, "SA: Debug2: body_linecount before SA: %d", body_linecount);
}
/* update global variable $body_linecount to reflect the new body size*/
- body_linecount = (line - 1);
+ if (body_linecount > 0) body_linecount = (line - 1); // Not updating if zero, indicating spool_wireformat
if (SAEximDebug > 1)
{
log_write(0, LOG_MAIN, "SA: Debug2: body_linecount after SA: %d", body_linecount);
}
+
}
fclose((FILE *)readfh);
@@ -1331,6 +1376,9 @@ restart:
if (dorej && doteergrube)
{
+ char *teergrubewaitstr;
+ teergrubewaitstr=string_sprintf(SAmsgteergrubewait, spamstatus);
+
/* By default, we'll only save temp bounces by message ID so
* that when the same message is submitted several times, we
* overwrite the same file on disk and not create a brand new
@@ -1353,20 +1401,8 @@ restart:
for (i=0;i<SAteergrubetime/10;i++)
{
- char *str;
-
- /* Unfortunately, we can't use exim's smtp_printf because it
- * doesn't return an error code if the write gets an EPIPE.
- * So, we write ourselves, but this won't work if you have a
- * TLS connection opened (that said, if you are teergrubing
- * a TLS connection, it's probably a relay host, not a
- * spammer, and in this case you should not teergrube a
- * friendly relay, so basically we should be ok).
- * If you do teergrube an SSL connection with the current
- * code, you will break it, but that's acceptable */
- str=string_sprintf(string_sprintf("451- %s\r\n",SAmsgteergrubewait), spamstatus);
- fprintf(smtp_out, str);
- ret=fflush(smtp_out);
+ smtp_printf("451-%s\r\n", FALSE, teergrubewaitstr);
+ ret=smtp_fflush();
if (ret != 0)
{
log_write(0, LOG_MAIN | LOG_REJECT, "SA: Action: teergrubed sender for %d secs until it closed the connection: %s (scanned in %d/%d secs | Message-Id: %s). %s", i*10, spamstatus, scantime, fulltime, safemesgid, mailinfo);

View File

@ -0,0 +1,24 @@
--- Local/sa-exim.conf.orig 2005-03-08 20:35:43 UTC
+++ Local/sa-exim.conf
@@ -49,11 +49,17 @@ SAspamcpath: /usr/bin/spamc
# you set it, it will override the two TCP connect options below
#SAspamcSockPath: /var/run/spamd.sock
-# SAspamcHost / SAspamcPort: TCP socket where your spamd is listening
-# Shown below are the defaults:
-SAspamcHost: 127.0.0.1
-SAspamcPort: 783
+# SAspamcHost / SAspamcPort: TCP socket where your spamd is listening.
+# Default is to let spamc use any settings in spamc.conf.
+#SAspamcHost: 127.0.0.1
+#SAspamcPort: 783
+# SAspamcUser: The username passed to spamc. Some tricks are needed to
+# decide on one user when there are many recipients. This string is of
+# course expanded. If unset or empty, spamc will use the user Exim
+# runs as. We suggest that you decide what username to use in the ACLs
+# and set an ACL variable.
+#SAspamcUser: $acl_m2
# Exim configuration string to run before running SA against the message
# This decides whether SA gets run against the message or not. This

View File

@ -0,0 +1,11 @@
--- Makefile.orig 2014-07-05 18:05:16.180788015 +0100
+++ Makefile 2014-07-05 18:05:40.464360574 +0100
@@ -53,7 +53,7 @@
# Configure-Makefile script. This does its own dependency checking because of
# the optional files.
-configure: checks build-directory
+configure: build-directory
@cd build-$(buildname); \
build=$(build) $(SHELL) ../scripts/Configure-Makefile

View File

@ -0,0 +1,13 @@
--- OS/Makefile-FreeBSD.orig 2023-04-09 09:45:04.226201000 +0200
+++ OS/Makefile-FreeBSD 2023-04-09 09:48:01.819463000 +0200
@@ -18,8 +18,8 @@
# Dynamically loaded modules need to be built with -fPIC
CFLAGS_DYNAMIC=-shared -rdynamic -fPIC
-# FreeBSD always ships with Berkeley DB
-USE_DB=yes
+# FreeBSD ships with Berkeley DB until 13.1, but ndbm is always included
+USE_NDBM=yes
# This code for building outside ports suggested by Richard Clayton
.ifdef X11BASE

View File

@ -0,0 +1,11 @@
--- exim_monitor/em_hdr.h.orig 2019-12-08 12:53:48 UTC
+++ exim_monitor/em_hdr.h
@@ -95,6 +95,8 @@ this interface so that this kind of kludge isn't neede
#endif
typedef void hctx;
+typedef unsigned long ulong;
+
#include "local_scan.h"
#include "macros.h"
#include "structs.h"

View File

@ -0,0 +1,32 @@
--- src/smtp_in.c.orig 2017-03-08 16:31:57.587957000 +0000
+++ src/smtp_in.c 2017-03-08 16:43:44.934346000 +0000
@@ -2246,6 +2246,9 @@
#ifdef USE_TCP_WRAPPERS
struct request_info tcpwrap_ri;
#endif
+#ifdef USE_TCP_WRAPPERS
+struct request_info tcpwrap_ri;
+#endif
smtp_connection_start = time(NULL);
for (smtp_ch_index = 0; smtp_ch_index < SMTP_HBUFF_SIZE; smtp_ch_index++)
@@ -2602,11 +2605,14 @@
log_write(0, LOG_MAIN|LOG_PANIC_DIE, "Expansion of \"%s\" "
"(tcp_wrappers_name) failed: %s", string_printing(tcp_wrappers_name),
expand_string_message);
-
- if (!hosts_ctl(tcp_wrappers_name,
- sender_host_name ? CS sender_host_name : STRING_UNKNOWN,
- sender_host_address ? CS sender_host_address : STRING_UNKNOWN,
- sender_ident ? CS sender_ident : STRING_UNKNOWN))
+ request_init(&tcpwrap_ri,
+ RQ_DAEMON, tcp_wrappers_name,
+ RQ_FILE, fileno(smtp_out),
+ RQ_CLIENT_NAME, (sender_host_name == NULL)? STRING_UNKNOWN : CS sender_host_name,
+ RQ_CLIENT_ADDR, (sender_host_address == NULL)? STRING_UNKNOWN : CS sender_host_address,
+ RQ_USER, (sender_ident == NULL)? STRING_UNKNOWN : CS sender_ident,
+ 0);
+ if (!hosts_access(&tcpwrap_ri))
{
if (errno == 0 || errno == ENOENT)
{

View File

@ -0,0 +1,111 @@
--- scripts/exim_install.orig 2016-12-18 14:02:28.000000000 +0000
+++ scripts/exim_install 2017-01-02 11:48:46.939703000 +0000
@@ -29,6 +29,7 @@
do_chown=yes
do_symlink=yes
+do_info=yes
while [ $# -gt 0 ] ; do
case "$1" in
@@ -51,6 +52,10 @@
do_symlink=no
;;
+ -no_info)
+ do_info=no
+ ;;
+
*)
break
;;
@@ -117,9 +122,7 @@
CONFIGURE_FILE=${DESTDIR}${CONFIGURE_FILE}
SYSTEM_ALIASES_FILE=${DESTDIR}${SYSTEM_ALIASES_FILE}
-if [ "${INFO_DIRECTORY}" != "" ] ; then
- INFO_DIRECTORY=${DESTDIR}${INFO_DIRECTORY}
-fi
+INFO_DIRECTORY=${DESTDIR}${INFO_DIRECTORY}
# Overrides of other things
case "$inst_uid" in ?*) INST_UID="$inst_uid";; esac
@@ -218,8 +221,7 @@
if [ $name = exim${EXE} ]; then
exim="./exim -bV -C /dev/null"
- version=exim-`$exim 2>/dev/null | \
- awk '/Exim version/ { OFS=""; print $3,"-",substr($4,2,length($4)-1) }'`${EXE}
+ version=exim
if [ "${version}" = "exim-${EXE}" ]; then
echo $com ""
@@ -384,9 +386,8 @@
echo $com ' ' ${CONFIGURE_FILE}
echo $com Therefore, skipping automatic installation.
-elif [ ! -f ${CONFIGURE_FILE} ]; then
- echo $com Installing default configuration in ${CONFIGURE_FILE}
- echo $com because there is no existing configuration file.
+else
+ echo $com Installing default configuration in ${CONFIGURE_FILE}.sample
if [ "${SYSTEM_ALIASES_FILE}" = "" ] ; then
SYSTEM_ALIASES_FILE=/etc/aliases
echo $com This configuration has system aliases in ${SYSTEM_ALIASES_FILE}.
@@ -396,8 +397,8 @@
${real} ${MKDIR} -p `${DIRNAME} ${CONFIGURE_FILE}`
echo sed -e '\\'
- echo " \"/SYSTEM_ALIASES_FILE/ s'SYSTEM_ALIASES_FILE'${ACTUAL_SYSTEM_ALIASES_FILE}'\"" '\\'
- echo " ../src/configure.default > \${CONFIGURE_FILE}"
+ echo " \"/SYSTEM_ALIASES_FILE/ s'SYSTEM_ALIASES_FILE'/etc/aliases'\"" '\\'
+ echo " ../src/configure.default > \${CONFIGURE_FILE}.sample"
# I can't find a way of writing this using the ${real} feature because
# it seems that the output redirection always happens, even when -n was
@@ -405,8 +406,8 @@
if [ "$real" = "" ] ; then
sed -e \
- "/SYSTEM_ALIASES_FILE/ s'SYSTEM_ALIASES_FILE'${ACTUAL_SYSTEM_ALIASES_FILE}'" \
- ../src/configure.default > ${CONFIGURE_FILE}
+ "/SYSTEM_ALIASES_FILE/ s'SYSTEM_ALIASES_FILE'/etc/aliases'" \
+ ../src/configure.default > ${CONFIGURE_FILE}.sample
else
true
fi
@@ -416,24 +417,22 @@
echo $com "*** Exim installation ${ver}failed ***"
exit 1
fi
- if [ ! -f ${SYSTEM_ALIASES_FILE} ]; then
- echo $com '****'
- echo $com Installing a dummy ${SYSTEM_ALIASES_FILE} file because you do not have
- echo $com one, and the default configuration requires it. You should
- echo $com edit ${SYSTEM_ALIASES_FILE} and at least create an alias for postmaster.
- echo $com '***'
- echo ${CP} ../src/aliases.default ${SYSTEM_ALIASES_FILE}
- ${real} ${CP} ../src/aliases.default ${SYSTEM_ALIASES_FILE}
- fi
+# if [ ! -f ${SYSTEM_ALIASES_FILE} ]; then
+# echo $com '****'
+# echo $com Installing a dummy ${SYSTEM_ALIASES_FILE} file because you do not have
+# echo $com one, and the default configuration requires it. You should
+# echo $com edit ${SYSTEM_ALIASES_FILE} and at least create an alias for postmaster.
+# echo $com '***'
+# echo ${CP} ../src/aliases.default ${SYSTEM_ALIASES_FILE}
+# ${real} ${CP} ../src/aliases.default ${SYSTEM_ALIASES_FILE}
+# fi
-else
- echo $com Configuration file ${CONFIGURE_FILE} already exists
fi
# Install info files if the directory is defined and the Texinfo
# source documentation is present.
-if [ "${INFO_DIRECTORY}" != "" -a -f ../doc/spec.texinfo ] ; then
+if [ "$do_info" != "no" -a -f ../doc/spec.texinfo ] ; then
echo $com ""
if [ ! -d "${INFO_DIRECTORY}" ] ; then
echo mkdir -p ${INFO_DIRECTORY}

View File

@ -0,0 +1,92 @@
--- src/auths/call_radius.c.orig 2020-05-30 22:35:38.000000000 +0200
+++ src/auths/call_radius.c 2020-06-01 19:54:14.402105000 +0200
@@ -113,37 +113,37 @@
#ifdef RADIUS_LIB_RADIUSCLIENT
if (rc_read_config(RADIUS_CONFIG_FILE) != 0)
- *errptr = string_sprintf("RADIUS: can't open %s", RADIUS_CONFIG_FILE);
+ *errptr = string_sprintf("%s", "RADIUS: can't open %s", RADIUS_CONFIG_FILE);
else if (rc_read_dictionary(rc_conf_str("dictionary")) != 0)
- *errptr = US"RADIUS: can't read dictionary";
+ *errptr = string_sprintf("%s", "RADIUS: can't read dictionary");
else if (!rc_avpair_add(&send, PW_USER_NAME, user, 0))
- *errptr = US"RADIUS: add user name failed";
+ *errptr = string_sprintf("%s", "RADIUS: add user name failed\n");
else if (!rc_avpair_add(&send, PW_USER_PASSWORD, CS radius_args, 0))
- *errptr = US"RADIUS: add password failed");
+ *errptr = string_sprintf("%s", "RADIUS: add password failed\n");
else if (!rc_avpair_add(&send, PW_SERVICE_TYPE, &service, 0))
- *errptr = US"RADIUS: add service type failed";
+ *errptr = string_sprintf("%s", "RADIUS: add service type failed\n");
#else /* RADIUS_LIB_RADIUSCLIENT unset => RADIUS_LIB_RADIUSCLIENT2 */
if (!(h = rc_read_config(RADIUS_CONFIG_FILE)))
- *errptr = string_sprintf("RADIUS: can't open %s", RADIUS_CONFIG_FILE);
+ *errptr = string_sprintf("%s", "RADIUS: can't open %s", RADIUS_CONFIG_FILE);
else if (rc_read_dictionary(h, rc_conf_str(h, "dictionary")) != 0)
- *errptr = US"RADIUS: can't read dictionary";
+ *errptr = string_sprintf("%s", "RADIUS: can't read dictionary");
else if (!rc_avpair_add(h, &send, PW_USER_NAME, user, Ustrlen(user), 0))
- *errptr = US"RADIUS: add user name failed";
+ *errptr = string_sprintf("%s", "RADIUS: add user name failed\n");
else if (!rc_avpair_add(h, &send, PW_USER_PASSWORD, CS radius_args,
Ustrlen(radius_args), 0))
- *errptr = US"RADIUS: add password failed";
+ *errptr = string_sprintf("%s", "RADIUS: add password failed\n");
else if (!rc_avpair_add(h, &send, PW_SERVICE_TYPE, &service, 0, 0))
- *errptr = US"RADIUS: add service type failed";
+ *errptr = string_sprintf("%s", "RADIUS: add service type failed\n");
#endif /* RADIUS_LIB_RADIUSCLIENT */
@@ -176,7 +176,7 @@
case BADRESP_RC:
default:
- *errptr = string_sprintf("RADIUS: unexpected response (%d)", result);
+ *errptr = string_sprintf("%s", "RADIUS: unexpected response (%d)", result);
return ERROR;
}
@@ -186,7 +186,7 @@
if (!(h = rad_auth_open()))
{
- *errptr = string_sprintf("RADIUS: can't initialise libradius");
+ *errptr = string_sprintf("%s", "RADIUS: can't initialise libradius");
return ERROR;
}
if (rad_config(h, RADIUS_CONFIG_FILE) != 0 ||
@@ -196,7 +196,7 @@
rad_put_int(h, RAD_SERVICE_TYPE, RAD_AUTHENTICATE_ONLY) != 0 ||
rad_put_string(h, RAD_NAS_IDENTIFIER, CS primary_hostname) != 0)
{
- *errptr = string_sprintf("RADIUS: %s", rad_strerror(h));
+ *errptr = string_sprintf("%s", "RADIUS: %s", rad_strerror(h));
result = ERROR;
}
else
@@ -211,12 +211,12 @@
break;
case -1:
- *errptr = string_sprintf("RADIUS: %s", rad_strerror(h));
+ *errptr = string_sprintf("%s", "RADIUS: %s", rad_strerror(h));
result = ERROR;
break;
default:
- *errptr = string_sprintf("RADIUS: unexpected response (%d)", result);
+ *errptr = string_sprintf("%s", "RADIUS: unexpected response (%d)", result);
result= ERROR;
break;
}

View File

@ -0,0 +1,10 @@
--- src/lookups/mysql.c.orig 2017-03-05 00:21:35.000000000 +0300
+++ src/lookups/mysql.c 2017-08-15 01:12:26.508519000 +0300
@@ -13,6 +13,7 @@
#include "lf_functions.h"
#include <mysql.h> /* The system header */
+#include <mysql_version.h>
/* Structure and anchor for caching connections. */

View File

@ -0,0 +1,146 @@
--- src/EDITME.orig 2021-09-28 10:24:46.000000000 +0200
+++ src/EDITME 2021-09-29 19:38:22.776161000 +0200
@@ -99,7 +99,7 @@
# /usr/local/sbin. The installation script will try to create this directory,
# and any superior directories, if they do not exist.
-BIN_DIRECTORY=/usr/exim/bin
+BIN_DIRECTORY=XX_PREFIX_XX/sbin
#------------------------------------------------------------------------------
@@ -115,7 +115,7 @@
# don't exist. It will also install a default runtime configuration if this
# file does not exist.
-CONFIGURE_FILE=/usr/exim/configure
+CONFIGURE_FILE=XX_CONFIG_FILE_PATH_XX
# It is possible to specify a colon-separated list of files for CONFIGURE_FILE.
# In this case, Exim will use the first of them that exists when it is run.
@@ -132,7 +132,7 @@
# deliveries. (Local deliveries run as various non-root users, typically as the
# owner of a local mailbox.) Specifying these values as root is not supported.
-EXIM_USER=
+EXIM_USER=ref:XX_EXIM_USER_XX
# If you specify EXIM_USER as a name, this is looked up at build time, and the
# uid number is built into the binary. However, you can specify that this
@@ -153,7 +153,7 @@
# for EXIM_USER (e.g. EXIM_USER=exim), you don't need to set EXIM_GROUP unless
# you want to use a group other than the default group for the given user.
-# EXIM_GROUP=
+EXIM_GROUP=ref:XX_EXIM_GROUP_XX
# Many sites define a user called "exim", with an appropriate default group,
# and use
@@ -451,6 +451,7 @@
# LDAP_LIB_TYPE=OPENLDAP2
# LDAP_LIB_TYPE=NETSCAPE
# LDAP_LIB_TYPE=SOLARIS
+LDAP_LIB_TYPE=XX_LDAP_TYPE_XX
# If you don't set any of these, Exim assumes the original University of
# Michigan (OpenLDAP 1) library.
@@ -491,9 +492,10 @@
#
# You do not need to use this for any lookup information added via pkg-config.
-# LOOKUP_INCLUDE=-I /usr/local/ldap/include -I /usr/local/mysql/include -I /usr/local/pgsql/include
-# LOOKUP_INCLUDE +=-I /usr/local/include
-# LOOKUP_LIBS=-L/usr/local/lib -lldap -llber -lmysqlclient -lpq -lgds -lsqlite3 -llmdb
+INCLUDE=-IXX_LOCALBASE_XX/include XX_DB_INCLUDES_XX XX_LMDB_INCLUDES_XX
+LOOKUP_INCLUDE=XX_MYSQL_INCLUDE_XX XX_PGSQL_INCLUDE_XX XX_LDAP_INCLUDE_XX
+LOOKUP_LIBS=XX_MYSQL_LIBS_XX XX_PGSQL_LIBS_XX XX_LDAP_LIBS_XX XX_LMDB_LIBS_XX
+DBMLIB=XX_DB_LIBS_XX
#------------------------------------------------------------------------------
@@ -633,6 +635,7 @@
# Uncomment the following line to add queuefile transport support
# EXPERIMENTAL_QUEUEFILE=yes
+# EXPERIMENTAL_DCC=yes
###############################################################################
# THESE ARE THINGS YOU MIGHT WANT TO SPECIFY #
###############################################################################
@@ -700,6 +703,7 @@
# ALT_CONFIG_PREFIX=/some/directory/
# ALT_CONFIG_PREFIX=/some/directory/exim.conf-
+ALT_CONFIG_PREFIX=XX_ALT_CONFIG_PREFIX_XX
#------------------------------------------------------------------------------
@@ -802,7 +806,7 @@
# one that is set in the headers_charset option. The default setting is
# defined by this setting:
-HEADERS_CHARSET="ISO-8859-1"
+HEADERS_CHARSET="XX_DEFAULT_CHARSET_XX"
# If you are going to make use of $header_xxx expansions in your configuration
# file, or if your users are going to use them in filter files, and the normal
@@ -898,7 +902,7 @@
# Once you have done this, "make install" will build the info files and
# install them in the directory you have defined.
-# INFO_DIRECTORY=/usr/share/info
+INFO_DIRECTORY=XX_PREFIX_XX/share/info
#------------------------------------------------------------------------------
@@ -911,7 +915,7 @@
# %s. This will be replaced by one of the strings "main", "panic", or "reject"
# to form the final file names. Some installations may want something like this:
-# LOG_FILE_PATH=/var/log/exim_%slog
+LOG_FILE_PATH=XX_LOG_FILE_PATH_XX
# which results in files with names /var/log/exim_mainlog, etc. The directory
# in which the log files are placed must exist; Exim does not try to create
@@ -993,7 +997,7 @@
# that the local_scan API is made available by the linker. You may also need
# to add -ldl to EXTRALIBS so that dlopen() is available to Exim.
-# EXPAND_DLFUNC=yes
+EXPAND_DLFUNC=yes
#------------------------------------------------------------------------------
@@ -1130,6 +1134,8 @@
#
# but of course there may need to be other things in CFLAGS and EXTRALIBS_EXIM
# as well.
+CFLAGS=XX_CFLAGS_XX XX_SPF_FLAGS_XX XX_SRS_FLAGS_XX XX_SQLITE_FLAGS_XX
+EXTRALIBS=XX_TCP_WRAPPERS_LIBS_XX XX_PAM_LIBS_XX XX_ICONV_LIBS_XX XX_SPF_LIBS_XX XX_SRS_LIBS_XX XX_RADIUS_LIBS_XX XX_SQLITE_LIBS_XX XX_DMARC_LIBS_XX XX_REDIS_LIBS_XX XX_DYNAMIC_LDFLAGS_XX XX_IDN_LIBS_XX
#
# To use a name other than exim in the tcpwrappers config file,
# e.g. if you're running multiple daemons with different access lists,
@@ -1138,7 +1144,15 @@
#
# TCP_WRAPPERS_DAEMON_NAME="exim"
+# IPv6 is coming. Exim has experimental support that has been tried out on
+# one or two OS. See the file README.IPV6 for the current status of this
+# support. Do not set this option unless you are working on IPv6 and know
+# what you are doing.
+# HAVE_IPV6=YES
+
+
+
#------------------------------------------------------------------------------
# The default action of the exim_install script (which is run by "make
# install") is to install the Exim binary with a unique name such as
@@ -1424,7 +1438,7 @@
# (process id) to a file so that it can easily be identified. The path of the
# file can be specified here. Some installations may want something like this:
-# PID_FILE_PATH=/var/lock/exim.pid
+PID_FILE_PATH=/var/run/exim.pid
# If PID_FILE_PATH is not defined, Exim writes a file in its spool directory
# using the name "exim-daemon.pid".

View File

@ -0,0 +1,42 @@
--- src/configure.default.orig Wed May 5 12:08:35 2004
+++ src/configure.default Wed May 5 15:09:40 2004
@@ -153,6 +153,8 @@
# as if it were a normal user. This isn't usually a problem, as most sites have
# an alias for root that redirects such mail to a human administrator.
+exim_user = XX_EXIM_USER_XX
+exim_group = XX_EXIM_GROUP_XX
never_users = root
@@ -412,7 +414,8 @@
allow_fail
allow_defer
data = ${lookup{$local_part}lsearch{SYSTEM_ALIASES_FILE}}
-# user = exim
+ user = XX_EXIM_USER_XX
+ group = XX_EXIM_GROUP_XX
file_transport = address_file
pipe_transport = address_pipe
@@ -454,6 +457,7 @@
file_transport = address_file
pipe_transport = address_pipe
reply_transport = address_reply
+ condition = ${if exists{$home/.forward} {yes} {no} }
# This router matches local user mailboxes. If the router fails, the error
@@ -506,8 +510,10 @@
delivery_date_add
envelope_to_add
return_path_add
-# group = mail
-# mode = 0660
+ group = XX_EXIM_GROUP_XX
+ user = $local_part
+ mode = 0660
+ no_mode_fail_narrower
# This transport is used for handling pipe deliveries generated by alias or

View File

@ -0,0 +1,20 @@
--- src/exim.h.orig 2017-02-14 19:13:41.381402389 +0200
+++ src/exim.h 2017-02-14 19:13:53.330916377 +0200
@@ -129,7 +129,6 @@
#endif
#include <sys/types.h>
-#include <sys/file.h>
#include <dirent.h>
#include <netdb.h>
#ifndef NO_POLL_H
--- src/exim_lock.c.orig 2017-02-14 19:21:09.709389008 +0200
+++ src/exim_lock.c 2017-02-14 19:21:23.994407794 +0200
@@ -27,7 +27,6 @@
#include <utime.h>
#include <sys/utsname.h>
#include <sys/stat.h>
-#include <sys/file.h>
#include <pwd.h>
/* Not all systems have flock() available. Those that do must define LOCK_SH

134
mail/exim/options Normal file
View File

@ -0,0 +1,134 @@
OPTIONS_DEFINE+= ALT_CONFIG_PREFIX \
CONTENT_SCAN \
DAEMON \
DANE \
DEBUG \
DISABLE_D_OPT \
DKIM \
SPF \
DNSSEC \
DOCS \
EMBEDDED_PERL \
EXIMON \
ICONV \
IPV6 \
LISTMATCH_RHS \
LMTP \
OCSP \
PRDR \
READLINE \
SUID \
TCP_WRAPPERS \
WISHLIST \
EVENT \
PROXY \
SOCKS \
INTERNATIONAL
OPTIONS_DEFAULT+= AUTH_CRAM_MD5 \
AUTH_DOVECOT \
AUTH_PLAINTEXT \
AUTH_SPA \
CDB \
CONTENT_SCAN \
DAEMON \
DISABLE_D_OPT \
DKIM \
DMARC \
DNSDB \
DNSSEC \
DSEARCH \
EMBEDDED_PERL \
EVENT \
ICONV \
INTERNATIONAL \
LMTP \
LSEARCH \
MAILDIR \
MAILSTORE \
MBX \
OCSP \
PAM \
PASSWD \
PRDR \
SPF \
SUID \
TLS
OPTIONS_RADIO_TLS= TLS GNUTLS
TLS_DESC= TLS support
OPTIONS_RADIO_LS= SA_EXIM
LS_DESC= Local scan patch
OPTIONS_RADIO_SRSR= SRS OLD_SRS
SRSR_DESC= Sender Rewriting Scheme
OLD_SRS_DESC= Enable Alternative Sender Rewriting Scheme
OPTIONS_RADIO= TLS LS SRSR
OPTIONS_GROUP_AUTH= AUTH_CRAM_MD5 AUTH_DOVECOT AUTH_PLAINTEXT AUTH_RADIUS AUTH_SASL AUTH_SPA AUTH_TLS SASLAUTHD PAM PASSWD
AUTH_DESC= SMTP Authorization
OPTIONS_GROUP_LOOKUP= CDB BDB DNSDB DSEARCH LSEARCH MYSQL NIS OPENLDAP PGSQL REDIS SQLITE
LOOKUP_DESC= Lookup support
OPTIONS_GROUP_STORAGE= MAILDIR MAILSTORE MBX
STORAGE_DESC= Supported storage formats
OPTIONS_GROUP_EXPERIMENTAL= CERTNAMES DCC DMARC DSN ARC LMDB QUEUEFILE
EXPERIMENTAL_DESC= Experimental options
OPTIONS_GROUP= AUTH LOOKUP STORAGE EXPERIMENTAL
ALT_CONFIG_PREFIX_DESC= Restrict the set of configuration files
ARC_DESC= Enable experimental ARC support
AUTH_CRAM_MD5_DESC= Enable CRAM-MD5 authentication mechanisms
AUTH_DOVECOT_DESC= Enable Dovecot authentication mechanisms
AUTH_PLAINTEXT_DESC= Enable plaintext authentication
AUTH_RADIUS_DESC= Enable radius (RFC 2865) authentication
AUTH_SASL_DESC= Enable use of Cyrus SASL auth library
AUTH_SPA_DESC= Enable Secure Password Authentication
AUTH_TLS_DESC= Enable TLS client certificate authentication
CERTNAMES_DESC= Check certiticates ownership
BDB_DESC= Enable Berkeley DB lookups
CDB_DESC= Enable CDB-style lookups
CONTENT_SCAN_DESC= Enable exiscan email content scanner
DAEMON_DESC= Install scripts to run as a daemon
DANE_DESC= Enable experimental DANE support
DCC_DESC= Enable DCC at ACL support via dccifd
DISABLE_D_OPT_DESC= Disable macros overrides using option -D
DKIM_DESC= Enable support for DKIM
DMARC_DESC= Enable DMARC support
DNSDB_DESC= Enable DNS-style lookups
DNSSEC_DESC= Enable DNSSEC validation
DSEARCH_DESC= Enable directory-list lookups
DSN_DESC= Enable Delivery Status Notifications
EMBEDDED_PERL_DESC= Enable embedded Perl interpreter
EVENT_DESC= Messages events support (TPDA namely)
EXIMON_DESC= Build eximon monitor (requires X libraries)
ICONV_DESC= Enable header charset conversion
INTERNATIONAL_DESC= Enable support for the transmission of UTF-8 envelope addresses
LISTMATCH_RHS_DESC= Enable pre-4.77 behaviour for match_*
LMDB_DESC= Enable LMDB lookups
LMTP_DESC= RFC2033 SMTP over command pipe transport
LSEARCH_DESC= Enable wildcarded-file lookups
MAILDIR_DESC= Enable Maildir mailbox format
MAILSTORE_DESC= Enable Mailstore mailbox format
MBX_DESC= Enable MBX mailbox format
MYSQL_DESC= Enable mysql lookups
NIS_DESC= Enable NIS-style lookups
OPENLDAP_DESC= Enable LDAP lookups
OCSP_DESC= Enable OCSP stapling
QUEUEFILE_DESC= Enable queuefile transport
PAM_DESC= Enable PAM authentication mechanisms
PASSWD_DESC= Enable /etc/passwd lookups
PGSQL_DESC= Enable postgresql lookups
PRDR_DESC= Enable Per-Recipient-Data-Response support
PROXY_DESC= Enable Experimental Proxy Protocol
READLINE_DESC= Enable readline(3) library
REDIS_DESC= Enable redis lookups
SASLAUTHD_DESC= Enable use of Cyrus SASL auth daemon
SA_EXIM_DESC= Build with Spamassassin local scan
SOCKS_DESC= Enable smtp transport via socks5 proxies
SPF_DESC= Enable Sender Policy Framework checking
SQLITE_DESC= Enable SQLite lookups
SRS_DESC= Enable Sender Rewriting Scheme
SUID_DESC= Install the exim binary suid root
TAINTWARN_DESC= Allow insecure tainted data (pre-4.93 config style, deprecated)
TCP_WRAPPERS_DESC= Enable /etc/hosts.allow access control
GNUTLS_DESC= Use GnuTLS instead of OpenSSL for TLS
WISHLIST_DESC= Include the unsupported patches

7
mail/exim/pkg-descr Normal file
View File

@ -0,0 +1,7 @@
Exim is a mail transfer agent for Unix systems connected to the Internet.
It is a monolithic MTA designed to be a command line compatible drop-in
replacement for Sendmail.
Exim is an excellent mailer for an ISP, as its control and flexibility
are very good and its requeueing and retry algorithms are very powerful.
Exim's configuration syntax is well documented.

57
mail/exim/pkg-message Normal file
View File

@ -0,0 +1,57 @@
[
{ type: install
message: <<EOM
All installations having Exim set-uid root and using 'perl_startup' are
vulnerable to a local privilege escalation. Any user who can start an
instance of Exim (and this is normally *any* user) can gain root
privileges. If you do not use 'perl_startup' you *should* be safe.
New options
-----------
We had to introduce two new configuration options:
keep_environment =
add_environment =
Both options are empty per default. That is, Exim cleans the complete
environment on startup. This affects Exim itself and any subprocesses,
as transports, that may call other programs via some alias mechanisms,
as routers (queryprogram), lookups, and so on. This may affect used
libraries (e.g. LDAP).
** THIS MAY BREAK your existing installation **
New behaviour
-------------
Now Exim changes it's working directory to / right after startup,
even before reading it's configuration. (Later Exim changes it's working
directory to $spool_directory, as usual.)
Exim only accepts an absolute configuration file path now, when using
the -C option.
EOM
}
{ type: upgrade
maximum_version: 4.80
message: <<EOM
Upgrades to Exim 4.80
=====================
Exim 4.80 contains some backward-incompatible changes.
OpenSSL default options have changed to be more secure, including
disabling of SSLv2 by default (and adding support for TLSv1.1 and
TLSv1.2 if using OpenSSL 1.0.1 or newer); GnuTLS has been updated to use
a new API and stop honouring some options starting gnutls_*; users of
LDAP can now distinguish "comma in data" from "multi-valued attribute".
There are more details, covering more changes, in README.UPDATING.
We now enable accept_8bitmime by default, as the Exim maintainers agree
with Dan Bernstein about the best way to deal with the 8BITMIME
extension.
EOM
}
]

46
mail/exim/pkg-plist Normal file
View File

@ -0,0 +1,46 @@
%%SUID%%@mode 4755
%%EXIM%%sbin/exim
%%SUID%%@mode
%%EXIM%%sbin/exim_checkaccess
%%EXIM%%sbin/exim_dbmbuild
%%EXIM%%sbin/exim_dumpdb
%%EXIM%%sbin/exim_fixdb
%%EXIM%%sbin/exim_id_update
%%EXIM%%sbin/exim_lock
%%EXIM%%sbin/exim_msgdate
%%EXIM%%sbin/exim_tidydb
%%EXIM%%sbin/exicyclog
%%EXIM%%sbin/exigrep
%%EXIM%%sbin/eximstats
%%EXIM%%sbin/exinext
%%EXIM%%sbin/exipick
%%EXIM%%sbin/exiqgrep
%%EXIM%%sbin/exiqsumm
%%EXIM%%sbin/exiwhat
%%EXIM%%share/man/man8/exim.8.gz
%%EXIMON%%sbin/eximon
%%EXIMON%%sbin/eximon.bin
%%EXIM%%%%PORTDOCS%%%%DOCSDIR%%/ACKNOWLEDGMENTS
%%EXIM%%%%PORTDOCS%%%%DOCSDIR%%/NOTICE
%%EXIM%%%%PORTDOCS%%%%DOCSDIR%%/README.UPDATING
%%EXIM%%%%PORTDOCS%%%%DOCSDIR%%/ChangeLog
%%EXIM%%%%PORTDOCS%%%%DOCSDIR%%/Exim3.upgrade
%%EXIM%%%%PORTDOCS%%%%DOCSDIR%%/Exim4.upgrade
%%EXIM%%%%PORTDOCS%%%%DOCSDIR%%/NewStuff
%%EXIM%%%%PORTDOCS%%%%DOCSDIR%%/OptionLists.txt
%%EXIM%%%%PORTDOCS%%%%DOCSDIR%%/POST-INSTALL-NOTES
%%EXIM%%%%PORTDOCS%%%%DOCSDIR%%/POST-INSTALL-NOTES.clamd
%%EXIM%%%%PORTDOCS%%%%DOCSDIR%%/README
%%EXIM%%%%PORTDOCS%%%%DOCSDIR%%/README.SIEVE
%%EXIM%%%%PORTDOCS%%%%DOCSDIR%%/dbm.discuss.txt
%%EXIM%%%%PORTDOCS%%%%DOCSDIR%%/experimental-spec.txt
%%EXIM%%%%PORTDOCS%%%%DOCSDIR%%/filter.txt
%%EXIM%%%%PORTDOCS%%%%DOCSDIR%%/spec.txt
%%EXIM%%%%PORTDOCS%%%%EXAMPLESDIR%%/convert4r3
%%EXIM%%%%PORTDOCS%%%%EXAMPLESDIR%%/convert4r4
%%EXIM%%%%PORTDOCS%%%%EXAMPLESDIR%%/transport-filter.pl
%%EXIMDAEMON%%etc/periodic/daily/150.exim-tidydb
%%EXIMDAEMON%%etc/periodic/daily/460.exim-mail-rejects
@sample %%ETCDIR%%/configure.sample
%%SA_EXIM%%@sample %%ETCDIR%%/sa-exim.conf.sample
%%EXIM%%@dir(%%EXIM_USER%%,%%EXIM_GROUP%%,) /%%LOGDIR%%