aboutsummaryrefslogtreecommitdiffstats
path: root/mail/qscan
diff options
context:
space:
mode:
authorale <ale@FreeBSD.org>2004-04-08 23:13:39 +0800
committerale <ale@FreeBSD.org>2004-04-08 23:13:39 +0800
commit0d043aaf342ee7cfbf22988317c4de33374909f6 (patch)
treee127bcf17cbcec85747fe4a858260c3856b50f8e /mail/qscan
parent695e01f871d8c8c586f998bfdcd68b50b4046ef8 (diff)
downloadfreebsd-ports-graphics-0d043aaf342ee7cfbf22988317c4de33374909f6.tar.gz
freebsd-ports-graphics-0d043aaf342ee7cfbf22988317c4de33374909f6.tar.zst
freebsd-ports-graphics-0d043aaf342ee7cfbf22988317c4de33374909f6.zip
Add qscan 1.5, a mail filter for Qmail that scans messages with ClamAV.
Diffstat (limited to 'mail/qscan')
-rw-r--r--mail/qscan/Makefile55
-rw-r--r--mail/qscan/distinfo2
-rw-r--r--mail/qscan/files/patch-src::qscan.c34
-rw-r--r--mail/qscan/files/patch-src::qscan.h13
-rw-r--r--mail/qscan/pkg-descr15
-rw-r--r--mail/qscan/pkg-plist9
6 files changed, 128 insertions, 0 deletions
diff --git a/mail/qscan/Makefile b/mail/qscan/Makefile
new file mode 100644
index 00000000000..0cbcabf95c0
--- /dev/null
+++ b/mail/qscan/Makefile
@@ -0,0 +1,55 @@
+# New ports collection makefile for: qscan
+# Date created: 8 Apr 2004
+# Whom: Alex Dupre <ale@FreeBSD.org>
+#
+# $FreeBSD$
+#
+
+PORTNAME= qscan
+PORTVERSION= 1.5
+CATEGORIES= mail security
+MASTER_SITES= ftp://ftp.c9x.org/qscan/
+
+MAINTAINER= ale@FreeBSD.org
+COMMENT= A mail filter for Qmail that scans messages with ClamAV
+
+RUN_DEPENDS= ${QMAIL_QUEUE}:${PORTSDIR}/mail/qmail \
+ clamdscan:${PORTSDIR}/security/clamav \
+ ripmime:${PORTSDIR}/mail/ripmime
+
+GNU_CONFIGURE= yes
+USE_REINPLACE= yes
+
+.include <bsd.port.pre.mk>
+
+.if exists(${LOCALBASE}/qmail/bin/qmail-queue)
+QMAIL_DIR?= ${LOCALBASE}/qmail
+.else
+QMAIL_DIR?= /var/qmail
+.endif
+QMAIL_QUEUE= ${QMAIL_DIR}/bin/qmail-queue
+QSCAN_VAR?= ${QMAIL_DIR}/${PORTNAME}
+PLIST_SUB+= QSCAN_VAR="${QSCAN_VAR}" \
+ QMAIL_QUEUE="${QMAIL_QUEUE}"
+
+# default 10
+.if defined(WITH_CONCURRENCY)
+CONFIGURE_ARGS+=--with-concurrency=${WITH_CONCURRENCY}
+.endif
+
+CONFIGURE_ENV+= SWEEP="${LOCALBASE}/bin/clamdscan" \
+ RIPMIME="${LOCALBASE}/bin/ripmime" \
+ QMAIL_QUEUE="${QMAIL_QUEUE}-old"
+
+post-patch:
+ @${REINPLACE_CMD} -e "s|/var/qmail/qscan|${QSCAN_VAR}|" ${WRKSRC}/src/qscan.h
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/src/${PORTNAME} ${PREFIX}/bin
+ ${MKDIR} ${QSCAN_VAR}
+ ${CHMOD} 750 ${QSCAN_VAR}
+ ${CHOWN} qmaild:clamav ${QSCAN_VAR}
+ ${LN} -f ${QMAIL_QUEUE} ${QMAIL_QUEUE}-old
+ ${LN} -sf ${PREFIX}/bin/${PORTNAME} ${QMAIL_QUEUE}
+
+.include <bsd.port.post.mk>
diff --git a/mail/qscan/distinfo b/mail/qscan/distinfo
new file mode 100644
index 00000000000..9b5d13bd7fa
--- /dev/null
+++ b/mail/qscan/distinfo
@@ -0,0 +1,2 @@
+MD5 (qscan-1.5.tar.gz) = 8750d629143a525a6f09f9a93024f799
+SIZE (qscan-1.5.tar.gz) = 87783
diff --git a/mail/qscan/files/patch-src::qscan.c b/mail/qscan/files/patch-src::qscan.c
new file mode 100644
index 00000000000..081a7bdff6e
--- /dev/null
+++ b/mail/qscan/files/patch-src::qscan.c
@@ -0,0 +1,34 @@
+--- src/qscan.c.orig Fri Oct 4 20:44:37 2002
++++ src/qscan.c Thu Apr 8 16:47:28 2004
+@@ -326,8 +326,8 @@
+ wait_everybody_and_die(99);
+ }
+ while (fgets(line, (int) sizeof line, avfp) != NULL) {
+- if (strncmp(SWEEP_VIRUS_PREFIX, line,
+- sizeof SWEEP_VIRUS_PREFIX - (size_t) 1U) == 0) {
++ register char *virus;
++ if ((virus = strstr(line, SWEEP_VIRUS_PREFIX)) != NULL) {
+ register char *crlf;
+
+ if (ret < INT_MAX) {
+@@ -340,8 +340,9 @@
+ (crlf = strrchr(line, '\r')) != NULL) {
+ *crlf = 0;
+ }
+- *foundvirus = strdup(line +
+- sizeof SWEEP_VIRUS_PREFIX - (size_t) 1U);
++ *virus = 0;
++ virus = strrchr(line, ' ');
++ *foundvirus = strdup(++virus);
+ }
+ }
+ if (fclose(avfp) != 0) {
+@@ -479,7 +480,7 @@
+ perror_log("unable to create the destdir name");
+ return -1;
+ }
+- if (mkdir(ripmime_destdir, (mode_t) 0700) != 0) {
++ if (mkdir(ripmime_destdir, (mode_t) 0750) != 0) {
+ if (chdir(ripmime_destdir) != 0) {
+ perror_log("unable to create/access ripmime_destdir");
+ return -1;
diff --git a/mail/qscan/files/patch-src::qscan.h b/mail/qscan/files/patch-src::qscan.h
new file mode 100644
index 00000000000..e2ff1b78cb8
--- /dev/null
+++ b/mail/qscan/files/patch-src::qscan.h
@@ -0,0 +1,13 @@
+--- src/qscan.h.orig Thu Apr 8 14:31:31 2004
++++ src/qscan.h Thu Apr 8 14:32:18 2004
+@@ -178,8 +178,8 @@
+ #define QSCAN_TIMEOUT 3000
+ #define RIPMIME_DESTDIR_BASE "/var/qmail/qscan"
+ #define RIPMIME_ARGS "-i", "-", "-d"
+-#define SWEEP_ARGS "-all", "-rec", "-ss", "-zip", "-arj", "-rar", "-cab", "-tnef"
+-#define SWEEP_VIRUS_PREFIX ">>> "
++#define SWEEP_ARGS "--disable-summary", "--stdout"
++#define SWEEP_VIRUS_PREFIX " FOUND"
+ #define SWEEP_TIMEOUT 250
+ #define SWEEP_NICE 15
+ #define MSG_BUFSIZE 8192
diff --git a/mail/qscan/pkg-descr b/mail/qscan/pkg-descr
new file mode 100644
index 00000000000..003fd01424a
--- /dev/null
+++ b/mail/qscan/pkg-descr
@@ -0,0 +1,15 @@
+The Qmail virus scanner (QScan) is a mail filter for Qmail that scans
+incoming messages using the Clam Antivirus engine, immediately rejecting
+infected content.
+
+It is designed to be minimalistic, yet extremely fast and secure, and uses
+multiple pipes instead of the traditional temporary files and privilege
+separation.
+
+Originally developed for the Sophos Antivirus, this port is patched to
+work in conjunction with the ClamAV daemon.
+
+WWW: http://www.jedi.claranet.fr/
+
+- Alex Dupre
+ale@FreeBSD.org
diff --git a/mail/qscan/pkg-plist b/mail/qscan/pkg-plist
new file mode 100644
index 00000000000..ce06f807771
--- /dev/null
+++ b/mail/qscan/pkg-plist
@@ -0,0 +1,9 @@
+bin/qscan
+@exec mkdir -p %%QSCAN_VAR%%
+@exec chmod 750 %%QSCAN_VAR%%
+@exec chown qmaild:clamav %%QSCAN_VAR%%
+@exec ln -f %%QMAIL_QUEUE%% %%QMAIL_QUEUE%%-old
+@exec ln -sf %D/bin/qscan %%QMAIL_QUEUE%%
+@unexec ln -f %%QMAIL_QUEUE%%-old %%QMAIL_QUEUE%%
+@unexec rm -f %%QMAIL_QUEUE%%-old
+@unexec echo "You may safely remove %%QSCAN_VAR%% if you don't want to use qscan anymore."