1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-23 00:43:28 +00:00

Add qscan 1.5, a mail filter for Qmail that scans messages with ClamAV.

This commit is contained in:
Alex Dupre 2004-04-08 15:13:39 +00:00
parent 22ad20d360
commit 6eac6a85e1
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=106496
7 changed files with 129 additions and 0 deletions

View File

@ -320,6 +320,7 @@
SUBDIR += qmailadmin-devel
SUBDIR += qmailanalog
SUBDIR += qpopper
SUBDIR += qscan
SUBDIR += qsf
SUBDIR += qtools
SUBDIR += queue-repair

55
mail/qscan/Makefile Normal file
View File

@ -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>

2
mail/qscan/distinfo Normal file
View File

@ -0,0 +1,2 @@
MD5 (qscan-1.5.tar.gz) = 8750d629143a525a6f09f9a93024f799
SIZE (qscan-1.5.tar.gz) = 87783

View File

@ -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;

View File

@ -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

15
mail/qscan/pkg-descr Normal file
View File

@ -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

9
mail/qscan/pkg-plist Normal file
View File

@ -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."