Index: head/mail/exim/Makefile =================================================================== --- head/mail/exim/Makefile (revision 377173) +++ head/mail/exim/Makefile (revision 377174) @@ -1,601 +1,602 @@ # Created by: markm@FreeBSD.org # $FreeBSD$ PORTNAME= exim PORTVERSION?= ${EXIM_VERSION} -PORTREVISION?= 0 +PORTREVISION?= 1 CATEGORIES= mail ipv6 MASTER_SITES= ${MASTER_SITE_EXIM:S/$/:exim/} MASTER_SITE_SUBDIR= exim4/:exim DISTNAME= ${PORTNAME}-${EXIM_VERSION} DISTFILES= ${DISTNAME}${EXTRACT_SUFX}:exim DIST_SUBDIR= exim EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX} MAINTAINER= vsevolod@FreeBSD.org COMMENT?= High performance MTA for Unix systems on the Internet LICENSE= GPLv2 USES= tar:bzip2 perl5 USE_PERL5= run # 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:${PORTSDIR}/security/cyrus-sasl2 BDB_USE= bdb=yes DMARC_LIB_DEPENDS= libopendmarc.so:${PORTSDIR}/mail/opendmarc EMBEDDED_PERL_USE= perl5=run,build EXIMON_USE= xorg=x11,xaw,xt GNUTLS_LIB_DEPENDS= libgnutls.so:${PORTSDIR}/security/gnutls ICONV_USES= iconv:lib,build MYSQL_USE= mysql=yes OPENLDAP_USE= openldap=yes PGSQL_USES= pgsql REDIS_LIB_DEPENDS= libhiredis.so:${PORTSDIR}/databases/hiredis SASLAUTHD_RUN_DEPENDS= ${LOCALBASE}/sbin/saslauthd:${PORTSDIR}/security/cyrus-sasl2-saslauthd SA_EXIM_RUN_DEPENDS= ${LOCALBASE}/bin/spamc:${PORTSDIR}/mail/spamassassin SPF_LIB_DEPENDS= libspf2.so:${PORTSDIR}/mail/libspf2 SQLITE_USE= sqlite=yes SQLITE_USES= pkgconfig XCLIENT_EXTRA_PATCHES= ${FILESDIR}/extra-patch-xclient +RSPAMD_EXTRA_PATCHES= ${FILESDIR}/extra-patch-rspamd .include # 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 .if ${PORT_OPTIONS:MDMARC} .if ! ${PORT_OPTIONS:MSPF} || ! ${PORT_OPTIONS:MDKIM} IGNORE= you cannot enable DMARC 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 # Use Openssl from the ports .if ${OSVERSION} < 1000000 . if ! ${PORT_OPTIONS:MGNUTLS} WITH_OPENSSL_PORT= yes . endif .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 MASTER_SITE_SUBDIR+= sa-exim/:sa_exim DISTFILES+= sa-exim-${SA_EXIM_VERSION}.tar.gz:sa_exim .endif EXIM_VERSION= 4.85 SA_EXIM_VERSION=4.2 EXIM_INSTALL_ARG+= "-no_chown" "-no_symlink" .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 -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+= libpcre.so:${PORTSDIR}/devel/pcre .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,^\# (EXPERIMENTAL_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,^\# (EXPERIMENTAL_DANE=),\1,' .endif .if ${PORT_OPTIONS:MEVENT} SEDLIST+= -e 's,^\# (EXPERIMENTAL_EVENT=),\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,^\# (EXPERIMENTAL_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} SEDLIST+= -e 's,^\# (SUPPORT_TLS=),\1,' .if ! ${PORT_OPTIONS:MGNUTLS} USE_OPENSSL= yes SEDLIST+= -e 's,^\# (TLS_LIBS=.*-lssl[[:space:]]),\1,' .else SEDLIST+= -e 's,^\# (USE_GNUTLS=),\1,' SEDLIST+= -e 's,^\# (TLS_LIBS=.*-lgnutls[[:space:]]),\1,' .endif .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_VER} && ${WITH_OPENLDAP_VER:tl} != "auto" WANT_OPENLDAP_VER= ${WITH_OPENLDAP_VER} .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 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:MMYSQL} SEDLIST+= -e 's,XX_MYSQL_LIBS_XX,-L${LOCALBASE:S/,/\\,/g}/lib/mysql -lmysqlclient,' \ -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_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+= libradiusclient-ng.so:${PORTSDIR}/net/radiusclient SEDLIST+= -e 's,XX_RADIUS_LIBS_XX,-L${LOCALBASE:S/,/\\,/g}/lib -lradiusclient-ng,' \ -e 's,^\# (RADIUS_CONFIG_FILE=).*,\1${LOCALBASE:S/,/\\,/g}/etc/radiusclient-ng/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} 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,^\# (EXPERIMENTAL_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 ${PTHREAD_LIBS:S/,/\\,/g},' \ -e 's,^\# (EXPERIMENTAL_SPF=),\1,' .else SEDLIST+= -e 's,XX_SPF_FLAGS_XX,,' \ -e 's,XX_SPF_LIBS_XX,,' .endif .if ${PORT_OPTIONS:MSRS} LIB_DEPENDS+= libsrs_alt.so:${PORTSDIR}/mail/libsrs_alt SEDLIST+= -e 's,XX_SRS_FLAGS_XX,-DEXPERIMENTAL_SRS,' \ -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 ${PORT_OPTIONS:MOLD_DEMIME} SEDLIST+= -e 's,^\# (WITH_OLD_DEMIME=),\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 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} .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/^(LOCAL_SCAN_SOURCE=).*/\1Local\/sa-exim.c/' \ ${WRKSRC}/OS/Makefile-Default @${CP} ${WRKDIR}/sa-exim-${SA_EXIM_VERSION}/sa-exim.c ${WRKSRC}/Local @{ \ ${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,' \ ${WRKDIR}/sa-exim-${SA_EXIM_VERSION}/sa-exim.conf .endif @${REINPLACE_CMD} -E -e 's/XX_STRIPCMD_XX/${STRIP_CMD:S,/,\/,g}/' \ ${WRKSRC}/OS/Makefile-FreeBSD @(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}${MAN8PREFIX}/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} ${WRKDIR}/sa-exim-${SA_EXIM_VERSION}/sa-exim.conf \ ${STAGEDIR}${PREFIX}/etc/exim/sa-exim.conf.sample .endif .endif # ! defined(EXIMON_ONLY) .include Index: head/mail/exim/files/POST-INSTALL-NOTES =================================================================== --- head/mail/exim/files/POST-INSTALL-NOTES (revision 377173) +++ head/mail/exim/files/POST-INSTALL-NOTES (revision 377174) @@ -1,53 +1,42 @@ 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 -NOTE TO OPERATORS UPGRADING FROM exim-3.xx: - -There was a big reworking of the way mail routing works for release -4.00. Previously used "directors" were abolished, and all routing is -now done by routers. Policy controls for incoming mail are now done by -Access Control Lists instead of separate options. All this means that -pre-4.00 configuration files have to be massively converted. If you -are coming from a 3.xx release, please read the document in the file -%%DOCSDIR%%/Exim4.upgrade, and allow some time to complete -the upgrade. - Additional scripts to help upgrading are installed in: %%EXAMPLESDIR%% Index: head/mail/exim/files/extra-patch-rspamd =================================================================== --- head/mail/exim/files/extra-patch-rspamd (nonexistent) +++ head/mail/exim/files/extra-patch-rspamd (revision 377174) @@ -0,0 +1,489 @@ +diff -ruN src/expand.c src/expand.c +--- src/expand.c 2015-01-16 15:21:40.000000000 +0200 ++++ src/expand.c 2015-01-16 15:21:51.000000000 +0200 +@@ -652,6 +652,7 @@ + { "sn8", vtype_filter_int, &filter_sn[8] }, + { "sn9", vtype_filter_int, &filter_sn[9] }, + #ifdef WITH_CONTENT_SCAN ++ { "spam_action", vtype_stringptr, &spam_action }, + { "spam_bar", vtype_stringptr, &spam_bar }, + { "spam_report", vtype_stringptr, &spam_report }, + { "spam_score", vtype_stringptr, &spam_score }, +diff -ruN src/globals.c src/globals.c +--- src/globals.c 2015-01-16 15:21:40.000000000 +0200 ++++ src/globals.c 2015-01-16 15:21:51.000000000 +0200 +@@ -1276,6 +1276,7 @@ + uschar *spamd_address = US"127.0.0.1 783"; + uschar *spam_bar = NULL; + uschar *spam_report = NULL; ++uschar *spam_action = NULL; + uschar *spam_score = NULL; + uschar *spam_score_int = NULL; + #endif +diff -ruN src/globals.h src/globals.h +--- src/globals.h 2015-01-16 15:21:40.000000000 +0200 ++++ src/globals.h 2015-01-16 15:21:51.000000000 +0200 +@@ -819,6 +819,7 @@ + extern uschar *spamd_address; /* address for the spamassassin daemon */ + extern uschar *spam_bar; /* the spam "bar" (textual representation of spam_score) */ + extern uschar *spam_report; /* the spamd report (multiline) */ ++extern uschar *spam_action; /* the spamd action */ + extern uschar *spam_score; /* the spam score (float) */ + extern uschar *spam_score_int; /* spam_score * 10 (int) */ + #endif +diff -ruN src/spam.c src/spam.c +--- src/spam.c 2015-01-16 15:21:40.000000000 +0200 ++++ src/spam.c 2015-01-16 15:21:51.000000000 +0200 +@@ -14,12 +14,20 @@ + uschar spam_score_buffer[16]; + uschar spam_score_int_buffer[16]; + uschar spam_bar_buffer[128]; ++uschar spam_action_buffer[32]; + uschar spam_report_buffer[32600]; + uschar prev_user_name[128] = ""; + int spam_ok = 0; + int spam_rc = 0; + uschar *prev_spamd_address_work = NULL; + ++/* push formatted line into vector */ ++static int spam_push_line(struct iovec *iov, int i, const char *fmt, ...); ++/* write io vector to the socket */ ++static int spam_write_vector(int sock, size_t size, struct iovec *iov, time_t now); ++/* poll socket to obtain write readiness */ ++static int spam_poll_socket (int sock, time_t start); ++ + int + spam(uschar **listptr) + { +@@ -31,10 +39,11 @@ + FILE *mbox_file; + int spamd_sock = -1; + uschar spamd_buffer[32600]; +- int i, j, offset, result; ++ int i, j, offset, result, is_rspamd; + uschar spamd_version[8]; ++ uschar spamd_short_result[8]; + uschar spamd_score_char; +- double spamd_threshold, spamd_score; ++ double spamd_threshold, spamd_score, spamd_reject_score; + int spamd_report_offset; + uschar *p,*q; + int override = 0; +@@ -128,8 +137,15 @@ + spamd_address_container *this_spamd = + (spamd_address_container *)store_get(sizeof(spamd_address_container)); + ++ /* Check for spamd variant */ ++ if( Ustrstr(address, "variant=rspamd") != NULL ) { ++ this_spamd->is_rspamd = 1; ++ } ++ else { ++ this_spamd->is_rspamd = 0; ++ } + /* grok spamd address and port */ +- if (sscanf(CS address, "%23s %u", this_spamd->tcp_addr, &(this_spamd->tcp_port)) != 2) ++ if (sscanf(CS address, "%23s %hu", this_spamd->tcp_addr, &(this_spamd->tcp_port)) != 2) + { + log_write(0, LOG_MAIN, + "spam acl condition: warning - invalid spamd address: '%s'", address); +@@ -174,6 +190,7 @@ + spamd_address_vector[current_server]->tcp_port, + 5 ) > -1) { + /* connection OK */ ++ is_rspamd = spamd_address_vector[current_server]->is_rspamd; + break; + }; + +@@ -210,12 +227,28 @@ + } + + server.sun_family = AF_UNIX; +- Ustrcpy(server.sun_path, spamd_address_work); ++ p = Ustrstr(spamd_address_work, "variant=rspamd"); ++ if( p != NULL ) { ++ is_rspamd = TRUE; ++ /* strip spaces */ ++ p --; ++ while (p > spamd_address_work && isspace (*p)) { ++ p --; ++ } ++ Ustrncpy(server.sun_path, spamd_address_work, p - spamd_address_work + 1); ++ /* zero terminate */ ++ server.sun_path[p - spamd_address_work + 1] = 0; ++ } ++ else { ++ is_rspamd = FALSE; ++ Ustrcpy(server.sun_path, spamd_address_work); ++ } ++ + + if (connect(spamd_sock, (struct sockaddr *) &server, sizeof(struct sockaddr_un)) < 0) { + log_write(0, LOG_MAIN|LOG_PANIC, + "malware acl condition: spamd: unable to connect to UNIX socket %s (%s)", +- spamd_address_work, strerror(errno) ); ++ server.sun_path, strerror(errno) ); + (void)fclose(mbox_file); + (void)close(spamd_sock); + return DEFER; +@@ -231,22 +264,67 @@ + return DEFER; + } + ++ (void)fcntl(spamd_sock, F_SETFL, O_NONBLOCK); + /* now we are connected to spamd on spamd_sock */ +- (void)string_format(spamd_buffer, +- sizeof(spamd_buffer), +- "REPORT SPAMC/1.2\r\nUser: %s\r\nContent-length: %ld\r\n\r\n", +- user_name, +- mbox_size); ++ if (is_rspamd) { ++ /* rspamd variant */ ++ int r, request_p = 0; ++ const char *helo; ++ struct iovec *request_v; ++ ++ request_v = store_get(sizeof(struct iovec) * (8 + recipients_count)); ++ if (request_v == NULL) { ++ (void)close(spamd_sock); ++ log_write(0, LOG_MAIN|LOG_PANIC, ++ "spam acl condition: store_get failed: %s", strerror(errno)); ++ (void)fclose(mbox_file); ++ (void)close(spamd_sock); ++ return DEFER; ++ } ++ r = 0; ++ r += spam_push_line(request_v, request_p++, "CHECK RSPAMC/1.3\r\n"); ++ r += spam_push_line(request_v, request_p++, "Content-length: %lu\r\n", mbox_size); ++ r += spam_push_line(request_v, request_p++, "Queue-Id: %s\r\n", message_id); ++ r += spam_push_line(request_v, request_p++, "From: <%s>\r\n", sender_address); ++ r += spam_push_line(request_v, request_p++, "Recipient-Number: %d\r\n", recipients_count); ++ /* copy all recipients as well */ ++ for (i = 0; i < recipients_count; i ++) ++ r += spam_push_line(request_v, request_p++, "Rcpt: <%s>\r\n", recipients_list[i].address); ++ if ((helo = expand_string(US"$sender_helo_name")) != NULL && *helo != '\0') ++ r += spam_push_line(request_v, request_p++, "Helo: %s\r\n", helo); ++ if (sender_host_address != NULL) ++ r += spam_push_line(request_v, request_p++, "IP: %s\r\n", sender_host_address); ++ r += spam_push_line(request_v, request_p++, "\r\n"); ++ if (spam_write_vector (spamd_sock, request_p, request_v, start) < 0) { ++ (void)close(spamd_sock); ++ log_write(0, LOG_MAIN|LOG_PANIC, ++ "spam acl condition: spamd (rspamd) send failed: %s", strerror(errno)); ++ (void)fclose(mbox_file); ++ (void)close(spamd_sock); ++ return DEFER; ++ } ++ } ++ else { ++ /* spamassassin variant */ ++ struct iovec req_iov; ++ (void)string_format(spamd_buffer, ++ sizeof(spamd_buffer), ++ "REPORT SPAMC/1.2\r\nUser: %s\r\nContent-length: %ld\r\n\r\n", ++ user_name, ++ mbox_size); ++ /* send our request */ ++ req_iov.iov_len = Ustrlen(spamd_buffer); ++ req_iov.iov_base = spamd_buffer; ++ if (spam_write_vector (spamd_sock, 1, &req_iov, start) < 0) { ++ (void)close(spamd_sock); ++ log_write(0, LOG_MAIN|LOG_PANIC, ++ "spam acl condition: spamd send failed: %s", strerror(errno)); ++ (void)fclose(mbox_file); ++ (void)close(spamd_sock); ++ return DEFER; ++ }; ++ } + +- /* send our request */ +- if (send(spamd_sock, spamd_buffer, Ustrlen(spamd_buffer), 0) < 0) { +- (void)close(spamd_sock); +- log_write(0, LOG_MAIN|LOG_PANIC, +- "spam acl condition: spamd send failed: %s", strerror(errno)); +- (void)fclose(mbox_file); +- (void)close(spamd_sock); +- return DEFER; +- }; + + /* now send the file */ + /* spamd sometimes accepts conections but doesn't read data off +@@ -349,60 +427,93 @@ + /* reading done */ + (void)close(spamd_sock); + +- /* dig in the spamd output and put the report in a multiline header, if requested */ +- if( sscanf(CS spamd_buffer,"SPAMD/%7s 0 EX_OK\r\nContent-length: %*u\r\n\r\n%lf/%lf\r\n%n", +- spamd_version,&spamd_score,&spamd_threshold,&spamd_report_offset) != 3 ) { +- +- /* try to fall back to pre-2.50 spamd output */ +- if( sscanf(CS spamd_buffer,"SPAMD/%7s 0 EX_OK\r\nSpam: %*s ; %lf / %lf\r\n\r\n%n", +- spamd_version,&spamd_score,&spamd_threshold,&spamd_report_offset) != 3 ) { ++ if (!is_rspamd) { ++ /* dig in the spamd output and put the report in a multiline header, if requested */ ++ if( sscanf(CS spamd_buffer,"SPAMD/%7s 0 EX_OK\r\nContent-length: %*u\r\n\r\n%lf/%lf\r\n%n", ++ spamd_version,&spamd_score,&spamd_threshold,&spamd_report_offset) != 3 ) { ++ ++ /* try to fall back to pre-2.50 spamd output */ ++ if( sscanf(CS spamd_buffer,"SPAMD/%7s 0 EX_OK\r\nSpam: %*s ; %lf / %lf\r\n\r\n%n", ++ spamd_version,&spamd_score,&spamd_threshold,&spamd_report_offset) != 3 ) { ++ log_write(0, LOG_MAIN|LOG_PANIC, ++ "spam acl condition: cannot parse spamd output"); ++ return DEFER; ++ }; ++ }; ++ ++ if( spamd_score >= spamd_threshold ) { ++ Ustrcpy(spam_action_buffer, "reject"); ++ } ++ else { ++ Ustrcpy(spam_action_buffer, "no action"); ++ } ++ } ++ else { ++ /* rspamd variant of reply */ ++ int r; ++ if( (r = sscanf(CS spamd_buffer,"RSPAMD/%7s 0 EX_OK\r\nMetric: default; %7s %lf / %lf / %lf\r\n%n", ++ spamd_version,spamd_short_result,&spamd_score,&spamd_threshold,&spamd_reject_score,&spamd_report_offset)) != 5 ) { + log_write(0, LOG_MAIN|LOG_PANIC, +- "spam acl condition: cannot parse spamd output"); ++ "spam acl condition: cannot parse spamd output: %d", r); + return DEFER; + }; +- }; ++ /* now parse action */ ++ p = &spamd_buffer[spamd_report_offset]; ++ ++ if( Ustrncmp(p, "Action: ", sizeof("Action: ") - 1) == 0 ) { ++ p += sizeof("Action: ") - 1; ++ q = &spam_action_buffer[0]; ++ while (*p && *p != '\r' && (q - spam_action_buffer) < sizeof(spam_action_buffer) - 1) { ++ *q++ = *p++; ++ } ++ *q = '\0'; ++ } ++ } + + /* Create report. Since this is a multiline string, + we must hack it into shape first */ + p = &spamd_buffer[spamd_report_offset]; + q = spam_report_buffer; + while (*p != '\0') { +- /* skip \r */ +- if (*p == '\r') { +- p++; +- continue; +- }; +- *q = *p; +- q++; +- if (*p == '\n') { +- /* add an extra space after the newline to ensure +- that it is treated as a header continuation line */ +- *q = ' '; +- q++; +- }; +- p++; ++ /* skip \r */ ++ if (*p == '\r') { ++ p++; ++ continue; ++ }; ++ *q = *p; ++ q++; ++ if (*p == '\n') { ++ /* add an extra space after the newline to ensure ++ that it is treated as a header continuation line */ ++ *q = ' '; ++ q++; ++ }; ++ p++; + }; + /* NULL-terminate */ + *q = '\0'; + q--; + /* cut off trailing leftovers */ + while (*q <= ' ') { +- *q = '\0'; +- q--; ++ *q = '\0'; ++ q--; + }; ++ ++ /* common spamd actions */ + spam_report = spam_report_buffer; ++ spam_action = spam_action_buffer; + + /* create spam bar */ + spamd_score_char = spamd_score > 0 ? '+' : '-'; + j = abs((int)(spamd_score)); + i = 0; + if( j != 0 ) { +- while((i < j) && (i <= MAX_SPAM_BAR_CHARS)) +- spam_bar_buffer[i++] = spamd_score_char; ++ while((i < j) && (i <= MAX_SPAM_BAR_CHARS)) ++ spam_bar_buffer[i++] = spamd_score_char; + } + else{ +- spam_bar_buffer[0] = '/'; +- i = 1; ++ spam_bar_buffer[0] = '/'; ++ i = 1; + } + spam_bar_buffer[i] = '\0'; + spam_bar = spam_bar_buffer; +@@ -418,12 +529,12 @@ + + /* compare threshold against score */ + if (spamd_score >= spamd_threshold) { +- /* spam as determined by user's threshold */ +- spam_rc = OK; ++ /* spam as determined by user's threshold */ ++ spam_rc = OK; + } + else { +- /* not spam */ +- spam_rc = FAIL; ++ /* not spam */ ++ spam_rc = FAIL; + }; + + /* remember expanded spamd_address if needed */ +@@ -443,4 +554,126 @@ + }; + } + ++#ifdef __GNUC__ ++static int ++spam_push_line(struct iovec *iov, const int i, const char *fmt, ...) __attribute__ ((format (printf, 3, 4))); ++#endif ++static int ++spam_push_line(struct iovec *iov, const int i, const char *fmt, ...) ++{ ++ va_list ap; ++ size_t len; ++ char buf[512]; ++ ++ va_start(ap, fmt); ++ len = vsnprintf(buf, sizeof(buf), fmt, ap); ++ va_end(ap); ++ ++ iov[i].iov_base = string_copy(US buf); ++ iov[i].iov_len = len; ++ ++ if (len >= sizeof(buf)) { ++ log_write(0, LOG_MAIN, "rspam: error, string was longer than %d", (int)sizeof(buf)); ++ return (-1); ++ } ++ ++ return 0; ++} ++ ++static int ++spam_write_vector(int sock, size_t size, struct iovec *iov, time_t start) ++{ ++ int r, i; ++ ++ for (;;) { ++ if (spam_poll_socket(sock, start) == -1) { ++ return -1; ++ } ++ r = writev(sock, iov, size); ++ if (r == -1) { ++ if (errno == EINTR) ++ continue; ++ ++ log_write(0, LOG_MAIN|LOG_PANIC, ++ "spam acl condition: %s on spamd socket", strerror(errno)); ++ return -1; ++ } ++ else { ++ /* check for partial writev */ ++ for (i = 0; i < size; i ++) { ++ if (r >= iov[i].iov_len) { ++ r -= iov[i].iov_len; ++ } ++ else { ++ /* partial iov write */ ++ iov[i].iov_base += r; ++ break; ++ } ++ if (r == 0) ++ break; ++ } ++ ++ if (i == size - 1 && r == 0) { ++ /* we have written everything */ ++ break; ++ } ++ else { ++ /* move iov to the last unreaded element */ ++ iov = &iov[i]; ++ size -= i; ++ } ++ } ++ } ++ ++ return 0; ++ ++} ++ ++static int ++spam_poll_socket (int sock, time_t start) ++{ ++#ifndef NO_POLL_H ++ struct pollfd pollfd; ++#else /* Patch posted by Erik ? for OS X */ ++ struct timeval select_tv; /* and applied by PH */ ++ fd_set select_fd; ++#endif ++ int r; ++ ++#ifndef NO_POLL_H ++ pollfd.fd = sock; ++ pollfd.events = POLLOUT; ++#endif ++ for (;;) { ++#ifndef NO_POLL_H ++ r = poll(&pollfd, 1, 1000); ++ ++/* Patch posted by Erik ? for OS X and applied by PH */ ++#else ++ select_tv.tv_sec = 1; ++ select_tv.tv_usec = 0; ++ FD_ZERO(&select_fd); ++ FD_SET(sock, &select_fd); ++ r = select(sock+1, NULL, &select_fd, NULL, &select_tv); ++#endif ++/* End Erik's patch */ ++ ++ if (r == -1 && errno == EINTR) ++ continue; ++ else if (r < 1) { ++ if (r == -1) ++ log_write(0, LOG_MAIN|LOG_PANIC, ++ "spam acl condition: %s on spamd socket", strerror(errno)); ++ else { ++ if (time(NULL) - start < SPAMD_TIMEOUT) ++ continue; ++ ++ log_write(0, LOG_MAIN|LOG_PANIC, ++ "spam acl condition: timed out writing spamd socket"); ++ } ++ } ++ return r; ++ } ++} ++ + #endif +diff -ruN src/spam.h src/spam.h +--- src/spam.h 2015-01-16 15:21:40.000000000 +0200 ++++ src/spam.h 2015-01-16 15:21:51.000000000 +0200 +@@ -22,7 +22,8 @@ + + typedef struct spamd_address_container { + uschar tcp_addr[24]; +- unsigned int tcp_port; ++ unsigned short int tcp_port; ++ unsigned is_rspamd:1; + } spamd_address_container; + + #endif Property changes on: head/mail/exim/files/extra-patch-rspamd ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/mail/exim/options =================================================================== --- head/mail/exim/options (revision 377173) +++ head/mail/exim/options (revision 377174) @@ -1,121 +1,122 @@ OPTIONS_DEFINE+= ALT_CONFIG_PREFIX \ CONTENT_SCAN \ DAEMON \ DEBUG \ DISABLE_D_OPT \ DKIM \ DNSSEC \ DOCS \ EMBEDDED_PERL \ EXIMON \ ICONV \ IPV6 \ LISTMATCH_RHS \ LMTP \ NIS \ OCSP \ OLD_DEMIME \ PRDR \ READLINE \ SUID \ TCP_WRAPPERS \ WISHLIST \ XCLIENT OPTIONS_DEFAULT+= AUTH_CRAM_MD5 \ AUTH_DOVECOT \ AUTH_PLAINTEXT \ AUTH_SPA \ CDB \ DAEMON \ DISABLE_D_OPT \ DKIM \ DNSDB \ DNSSEC \ DSEARCH \ EMBEDDED_PERL \ ICONV \ LTMP \ LSEARCH \ MAILDIR \ MAILSTORE \ MBX \ OCSP \ OLD_DEMIME \ PAM \ PASSWD \ PRDR \ 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 SRSR_DESC= Sender Rewriting Scheme OPTIONS_RADIO= TLS LS SRSR OPTIONS_GROUP_AUTH= AUTH_CRAM_MD5 AUTH_DOVECOT AUTH_PLAINTEXT AUTH_RADIUS AUTH_SASL AUTH_SPA 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 DANE DCC DMARC DSN EVENT PROXY SPF +OPTIONS_GROUP_EXPERIMENTAL= CERTNAMES DANE DCC DMARC DSN EVENT PROXY SPF RSPAMD EXPERIMENTAL_DESC= Experimental options OPTIONS_GROUP= AUTH LOOKUP STORAGE EXPERIMENTAL ALT_CONFIG_PREFIX_DESC= Restrict the set of configuration files 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 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 LISTMATCH_RHS_DESC= Enable pre-4.77 behaviour for match_* 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 OLD_DEMIME_DESC= Enable old, deprecated "demime" ACL OPENLDAP_DESC= Enable LDAP lookups OCSP_DESC= Enable OCSP stapling 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 (experimental) SASLAUTHD_DESC= Enable use of Cyrus SASL auth daemon SA_EXIM_DESC= Build with Spamassassin local scan SPF_DESC= Enable Sender Policy Framework checking +RSPAMD_DESC= Build with Rspamd support SQLITE_DESC= Enable SQLite lookups SRS_DESC= Enable Sender Rewriting Scheme SUID_DESC= Install the exim binary suid root TCP_WRAPPERS_DESC= Enable /etc/hosts.allow access control GNUTLS_DESC= Use GnuTLS instead of OpenSSL for TLS WISHLIST_DESC= Include the unsupported patches XCLIENT_DESC= Enable XCLIENT command in exim