ports/146215: mail/exim: add support for Spamooborona-1024 filtering

Alexey V.Degtyarev alexey at renatasystems.org
Sat May 1 10:40:07 UTC 2010


>Number:         146215
>Category:       ports
>Synopsis:       mail/exim: add support for Spamooborona-1024 filtering
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat May 01 10:40:06 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Alexey V. Degtyarev
>Release:        FreeBSD 8.0-RELEASE amd64
>Organization:
>Environment:
System: FreeBSD renatasystems.org 8.0-RELEASE FreeBSD 8.0-RELEASE #0: Sat Nov 21 15:02:08 UTC 2009 root at mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64


	
>Description:
	
"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.
>How-To-Repeat:
	
>Fix:

	

--- exim-so1024.patch begins here ---
diff -urN exim.orig/Makefile exim/Makefile
--- exim.orig/Makefile	2009-12-03 12:07:05.000000000 +0000
+++ exim/Makefile	2010-05-01 10:06:44.000000000 +0000
@@ -27,6 +27,21 @@
 
 .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 @@
 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 @@
 		-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 @@
 .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
@@ -467,6 +495,11 @@
 	@${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
 	@(cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} configure)
@@ -524,6 +557,12 @@
 	    ${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
 
diff -urN exim.orig/Makefile.options exim/Makefile.options
--- exim.orig/Makefile.options	2009-11-25 12:29:30.000000000 +0000
+++ exim/Makefile.options	2010-05-01 09:52:06.000000000 +0000
@@ -49,6 +49,7 @@
 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 @@
 		READLINE \
 		SASLAUTHD \
 		SA_EXIM \
+		SO_1024 \
 		SPF \
 		SQLITE \
 		SRS \
diff -urN exim.orig/distinfo exim/distinfo
--- exim.orig/distinfo	2009-12-03 12:07:06.000000000 +0000
+++ exim/distinfo	2010-04-25 14:30:10.000000000 +0000
@@ -4,3 +4,6 @@
 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
diff -urN exim.orig/options exim/options
--- exim.orig/options	2009-11-25 12:29:30.000000000 +0000
+++ exim/options	2010-04-24 15:41:09.000000000 +0000
@@ -33,6 +33,7 @@
 	 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 \
diff -urN exim.orig/pkg-plist exim/pkg-plist
--- exim.orig/pkg-plist	2009-11-15 18:18:19.000000000 +0000
+++ exim/pkg-plist	2010-05-01 10:08:02.000000000 +0000
@@ -52,3 +52,4 @@
 %%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%%@unexec rmdir /var/spool/spamooborona 2> /dev/null || true
--- exim-so1024.patch ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list