"Spamooborona 1024" software by Yandex allows to filter up to 1024

good messages per day for any mailhost. It is to note: 1024 - it is
not the total amount of messages scanned but the only good ones,
which aren't considered as spam. Once 1024 good messages get passed
through the filter, the rest of mail traffic will be passed without
considering spam or ham until the end of the day.

http://so.yandex.ru/companies/so1024.xml

The patch allows use of "Spamooborona 1024" with Exim by using
Local_scan()'s functionality provided by Yandex LLC.

PR:		ports/146215
Submitted by:	Alexey V.Degtyarev <alexey@renatasystems.org>
This commit is contained in:
Kirill Ponomarev 2010-05-05 18:08:18 +00:00
parent 93e7986449
commit ce87e07dc8
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=253773
5 changed files with 48 additions and 1 deletions

View file

@ -27,6 +27,21 @@ MAKE_JOBS_UNSAFE= yes
.include <bsd.port.pre.mk>
.if defined(WITH_SA_EXIM)
.if defined(WITH_KAS)
IGNORE= You cannot select both SA_EXIM and KAS options
.endif
.if defined(WITH_SO_1024)
IGNORE= You cannot select both SA_EXIM and SO_1024 options
.endif
.endif
.if defined(WITH_KAS)
.if defined(WITH_SO_1024)
IGNORE= You cannot select both SA_KAS and SO_1024 options
.endif
.endif
.if defined(WITH_SA_EXIM)
MASTER_SITES+= http://marc.merlins.org/linux/exim/files/:sa_exim \
SF/sa-exim/sa-exim/${SA_EXIM_VERSION}:sa_exim
@ -34,8 +49,18 @@ MASTER_SITE_SUBDIR+= sa-exim/:sa_exim
DISTFILES+= sa-exim-${SA_EXIM_VERSION}.tar.gz:sa_exim
.endif
.if defined(WITH_SO_1024)
MASTER_SITES+= ftp://ftp.renatasystems.org/pub/FreeBSD/ports/distfiles/:so_1024
DISTFILES+= spamooborona1024-src-${SO_1024_VERSION}.tar.gz:so_1024
LDFLAGS+= -lz
PLIST_SUB+= SO_1024=""
.else
PLIST_SUB+= SO_1024="@comment "
.endif
EXIM_VERSION= 4.71
SA_EXIM_VERSION=4.2
SO_1024_VERSION=3.2
.if !defined(EXIMON_ONLY)
.if defined(PKGNAMESUFFIX)
@ -101,7 +126,7 @@ SED_SCRIPT= -e 's,%%PREFIX%%,${PREFIX},g' \
-e 's,%%EXIM_GROUP%%,${EXIM_GROUP},g' \
-e 's,%%LOGDIR%%,${LOGDIR},g'
PLIST_SUB= EXIM_VERSION="${EXIM_VERSION}-${PORTREVISION}" \
PLIST_SUB+= EXIM_VERSION="${EXIM_VERSION}-${PORTREVISION}" \
EXIM_USER=${EXIM_USER} \
EXIM_GROUP=${EXIM_GROUP} \
LOGDIR="${LOGDIR}"
@ -439,6 +464,9 @@ post-extract:
.if defined(WITH_SA_EXIM)
@cd ${WRKDIR} && ${GZIP_CMD} ${EXTRACT_BEFORE_ARGS} ${_DISTDIR}/sa-exim-${SA_EXIM_VERSION}.tar.gz ${EXTRACT_AFTER_ARGS}
.endif
.if defined(WITH_SO_1024)
@cd ${WRKDIR} && ${GZIP_CMD} ${EXTRACT_BEFORE_ARGS} ${_DISTDIR}/spamooborona1024-src-${SO_1024_VERSION}.tar.gz ${EXTRACT_AFTER_ARGS}
.endif
do-configure:
@${MKDIR} ${WRKSRC}/Local
@ -466,6 +494,11 @@ do-configure:
} > ${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
.if defined(WITH_SO_1024)
@${REINPLACE_CMD} -E -e 's/^(LOCAL_SCAN_SOURCE=).*/\1Local\/local_scan_1024.c/' \
${WRKSRC}/OS/Makefile-Default
@${CP} ${WRKDIR}/local_scan_1024.c ${WRKSRC}/Local
.endif
@${REINPLACE_CMD} -E -e 's/XX_STRIPCMD_XX/${STRIP_CMD:S,/,\/,g}/' \
${WRKSRC}/OS/Makefile-FreeBSD
@ -523,6 +556,12 @@ post-install:
@[ -f ${PREFIX}/etc/exim/sa-exim.conf ] || \
${CP} ${PREFIX}/etc/exim/sa-exim.conf.default \
${PREFIX}/etc/exim/sa-exim.conf
.endif
.if defined(WITH_SO_1024)
.if !exists(/var/spool/spamooborona)
@${MKDIR} -m 750 /var/spool/spamooborona
@${CHOWN} ${EXIM_USER}:${EXIM_GROUP} /var/spool/spamooborona
.endif
.endif
@${CAT} ${PKGMESSAGE}
@${SETENV} PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL

View file

@ -49,6 +49,7 @@ PGSQL = "Link against libpq"
READLINE = "Enable readline(3) library"
SASLAUTHD = "Enable use of Cyrus SASL auth daemon"
SA_EXIM = "SA-Exim support"
SO_1024 = "Build with Spamooborona-1024 local scan"
SPF = "Enable Sender Policy Framework checking"
SQLITE = "Enable SQLite lookups"
SRS = "Enable Sender Rewriting Scheme"
@ -96,6 +97,7 @@ DISABLED_OPTIONS+= \
READLINE \
SASLAUTHD \
SA_EXIM \
SO_1024 \
SPF \
SQLITE \
SRS \

View file

@ -4,3 +4,6 @@ SIZE (exim/exim-4.71.tar.bz2) = 1560170
MD5 (exim/sa-exim-4.2.tar.gz) = ad76f73c6b3d01caa88078e3e622745a
SHA256 (exim/sa-exim-4.2.tar.gz) = 72e0a735547f18b05785e6c58a71d24623858f0f5234a5dc0e24cb453999e99a
SIZE (exim/sa-exim-4.2.tar.gz) = 66575
MD5 (exim/spamooborona1024-src-3.2.tar.gz) = f7d23edf02752633377b08b1f2c413d7
SHA256 (exim/spamooborona1024-src-3.2.tar.gz) = ab22a430f3860460045f6b213c68c89700a0cd10cbb6c7a808ece326c53787ee
SIZE (exim/spamooborona1024-src-3.2.tar.gz) = 8537

View file

@ -33,6 +33,7 @@ OPTIONS+= \
READLINE "Enable readline(3) library" off \
SASLAUTHD "Enable use of Cyrus SASL auth daemon" off \
SA_EXIM "SA-Exim support" off \
SO_1024 "Build with Spamoborona-1024 local scan" off \
SPF "Enable Sender Policy Framework checking" off \
SQLITE "Enable SQLite lookups" off \
SRS "Enable Sender Rewriting Scheme" off \

View file

@ -52,3 +52,5 @@ etc/exim/configure.default
%%SA_EXIM%%@exec [ -f %B/sa-exim.conf ] || cp %B/%f %B/sa-exim.conf
@unexec rmdir %B 2> /dev/null || true
@unexec rmdir %%LOGDIR%% 2> /dev/null || true
%%SO_1024%%@exec [ ! -d /var/spool/spamooborona ] && mkdir -m 750 /var/spool/spamooborona && chown %%EXIM_USER%%:%%EXIM_GROUP%% /var/spool/spamooborona || true
%%SO_1024%%@unexec rmdir /var/spool/spamooborona 2> /dev/null || true