From f932907ab2339e5affa9208236980a642e9d552f Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Wed, 20 Jul 2005 13:39:35 +0000 Subject: [PATCH] A qmail-queue replacement to filter mail traffic and more. It supports: * Antivirus executing * body filtering * subject filtering * attachment blocking * quarantine * white/black list * single line logging for qmail and many features. PR: ports/83590 Submitted by: Ozkan KIRIK Approved by: flz (mentor) --- mail/Makefile | 1 + mail/qsheff/Makefile | 66 +++++++++++++++++++++++++++++ mail/qsheff/distinfo | 2 + mail/qsheff/files/patch-Makefile.in | 11 +++++ mail/qsheff/files/pkg-message.in | 9 ++++ mail/qsheff/pkg-descr | 19 +++++++++ mail/qsheff/pkg-plist | 24 +++++++++++ 7 files changed, 132 insertions(+) create mode 100644 mail/qsheff/Makefile create mode 100644 mail/qsheff/distinfo create mode 100644 mail/qsheff/files/patch-Makefile.in create mode 100644 mail/qsheff/files/pkg-message.in create mode 100644 mail/qsheff/pkg-descr create mode 100644 mail/qsheff/pkg-plist diff --git a/mail/Makefile b/mail/Makefile index e763b5a34dd4..fa3f044bdc37 100644 --- a/mail/Makefile +++ b/mail/Makefile @@ -421,6 +421,7 @@ SUBDIR += qpopper SUBDIR += qscan SUBDIR += qsf + SUBDIR += qsheff SUBDIR += qtools SUBDIR += queue-fix SUBDIR += queue-repair diff --git a/mail/qsheff/Makefile b/mail/qsheff/Makefile new file mode 100644 index 000000000000..3598bf70b9da --- /dev/null +++ b/mail/qsheff/Makefile @@ -0,0 +1,66 @@ +# New ports collection makefile for: qsheff +# Date created: 14 Jul 2005 +# Whom: Ozkan KIRIK +# +# $FreeBSD$ +# + +PORTNAME= qsheff +PORTVERSION= 1.0.r1 +CATEGORIES= mail +MASTER_SITES= http://www.enderunix.org/qsheff/ +DISTNAME= ${PORTNAME}-1.0-r1 + +MAINTAINER= ozkan@enderunix.org +COMMENT= A qmail-queue replacement to filter mail traffic + +RUN_DEPENDS= ${QMAIL_DIR}/bin/qmail-queue:${PORTSDIR}/mail/qmail \ + ${LOCALBASE}/bin/ripmime:${PORTSDIR}/mail/ripmime + +USE_REINPLACE= YES +GNU_CONFIGURE= YES +CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL} + +PORTDOCS= spamass-qsheff.en.html README COPYING AUTHORS ChangeLog \ + INSTALL UPGRADE THANKS TODO + +SUB_FILES= pkg-message + +OPTIONS= CLAMAV "Integrate with Clam AntiVirus" on + +.if exists(${LOCALBASE}/qmail/bin/qmail-queue) +QMAIL_DIR?= ${LOCALBASE}/qmail +.else +QMAIL_DIR?= /var/qmail +.endif + +PREFIX?= ${QMAIL_DIR} + +CONFIGURE_ARGS+= --with-qmaildir=${QMAIL_DIR} + +.include + +.if !defined(WITHOUT_CLAMAV) +RUN_DEPENDS+= ${LOCALBASE}/bin/clamdscan:${PORTSDIR}/security/clamav +.endif +.if !defined(WITHOUT_FPROT) & defined(WITHOUT_CLAMAV) +RUN_DEPENDS+= ${LOCALBASE}/bin/f-prot:${PORTSDIR}/security/f-prot +.endif + +post-patch: +.if defined(NOPORTDOCS) + @${REINPLACE_CMD} -e 's|\(install-data-am: \)install-qsheffdocDATA|\1|g' \ + -e 's| contribute$$||g' \ + ${WRKSRC}/Makefile.in +.endif + +post-build: +.if defined(WITHOUT_CLAMAV) + @${REINPLACE_CMD} -e 's|enable_virus_prog = 1|enable_virus_prog = 0|g' \ + ${WRKSRC}/etc/qsheff.conf-default +.endif + +post-install: + @${CAT} ${PKGMESSAGE} + +.include diff --git a/mail/qsheff/distinfo b/mail/qsheff/distinfo new file mode 100644 index 000000000000..ac892b790952 --- /dev/null +++ b/mail/qsheff/distinfo @@ -0,0 +1,2 @@ +MD5 (qsheff-1.0-r1.tar.gz) = fa9e21cbf2a9014beb05d8a7e55a46d8 +SIZE (qsheff-1.0-r1.tar.gz) = 105460 diff --git a/mail/qsheff/files/patch-Makefile.in b/mail/qsheff/files/patch-Makefile.in new file mode 100644 index 000000000000..3e4ca5eea996 --- /dev/null +++ b/mail/qsheff/files/patch-Makefile.in @@ -0,0 +1,11 @@ +--- Makefile.in.orig Wed Jul 20 08:33:16 2005 ++++ Makefile.in Wed Jul 20 08:33:21 2005 +@@ -734,8 +734,6 @@ + mkdir -p /var/tmp/qsheffq + touch /var/log/qsheff.log + chmod 755 /var/tmp/qsheffq /var/spool/qsheffq +- if [ -x @QMAILDIR@/bin/qmail-queue ]; then cp -pf @QMAILDIR@/bin/qmail-queue @QMAILDIR@/bin/qmail-queue.orig; rm -f @QMAILDIR@/bin/qmail-queue; fi +- ln -s @QMAILDIR@/bin/qmail-qsheff @QMAILDIR@/bin/qmail-queue + # Tell versions [3.59,3.63) of GNU make to not export all variables. + # Otherwise a system limit (for SysV at least) may be exceeded. + .NOEXPORT: diff --git a/mail/qsheff/files/pkg-message.in b/mail/qsheff/files/pkg-message.in new file mode 100644 index 000000000000..74978012fa0f --- /dev/null +++ b/mail/qsheff/files/pkg-message.in @@ -0,0 +1,9 @@ + +ATTENTION: + +To start to use qmail-qsheff you need to overwrite qmail-queue program. +Make a backup before do it. + +> cp %%PREFIX%%/bin/qmail-queue %%PREFIX%%/bin/qmail-queue.orig +> cp %%PREFIX%%/bin/qmail-qsheff %%PREFIX%%/bin/qmail-queue + diff --git a/mail/qsheff/pkg-descr b/mail/qsheff/pkg-descr new file mode 100644 index 000000000000..ec8855432ce9 --- /dev/null +++ b/mail/qsheff/pkg-descr @@ -0,0 +1,19 @@ +A qmail-queue replacement to filter mail traffic and more. +It supports: + * Antivirus executing + * body filtering + * subject filtering + * attachment blocking + * quarantine + * white/black list + * single line logging for qmail and many features. + +Project Page: +WWW: http://www.enderunix.org/qsheff + +Author: + +Baris SIMSEK +simsek@enderunix.org +EnderUNIX SDT @ Turkey +http://www.enderunix.org/simsek/ diff --git a/mail/qsheff/pkg-plist b/mail/qsheff/pkg-plist new file mode 100644 index 000000000000..cbf605cee1ae --- /dev/null +++ b/mail/qsheff/pkg-plist @@ -0,0 +1,24 @@ +@comment $FreeBSD$ +bin/qsheff +@unexec if cmp -s %D/etc/qsheff/qsheff.attach %D/etc/qsheff/qsheff.attach-default; then rm -f %D/etc/qsheff/qsheff.attach; fi +etc/qsheff/qsheff.attach-default +@exec [ -f %B/qsheff.attach ] || cp %B/%f %B/qsheff.attach +@unexec if cmp -s %D/etc/qsheff/qsheff.conf %D/etc/qsheff/qsheff.conf-default; then rm -f %D/etc/qsheff/qsheff.conf; fi +etc/qsheff/qsheff.conf-default +@unexec if cmp -s %D/etc/qsheff/qsheff.rules %D/etc/qsheff/qsheff.rules-default; then rm -f %D/etc/qsheff/qsheff.rules; fi +etc/qsheff/qsheff.rules-default +@exec [ -f %B/qsheff.rules ] || cp %B/%f %B/qsheff.attach +@unexec if cmp -s %D/etc/qsheff/qsheff.wblist %D/etc/qsheff/qsheff.wblist-default; then rm -f %D/etc/qsheff/qsheff.wblist; fi +etc/qsheff/qsheff.wblist-default +@exec [ -f %B/qsheff.wblist ] || cp %B/%f %B/qsheff.attach +%%DATADIR%%/developer.notes +%%DATADIR%%/eicar.com.txt +%%DATADIR%%/sample-OK.msg +%%DATADIR%%/sample-SPAM.msg +%%DATADIR%%/sample-VIRUS.msg +%%DATADIR%%/uninstall.sh +@unexec rmdir %D/etc/qsheff 2>/dev/null || true +@dirrm %%DATADIR%% +@unexec echo "ATTENTION:" +@unexec echo "1) Remember to restore your qmail-queue program on %%PREFIX%%/bin" +@unexec echo "2) Quarantina directory (/var/spool/qsheffq) not removed. You can remove it manually."