ports/75717: New port: fast spam/antivirus scanner for qmail written in C
Anton Karpov
toxa at unixforge.org
Sun Jan 2 04:20:15 UTC 2005
>Number: 75717
>Category: ports
>Synopsis: New port: fast spam/antivirus scanner for qmail written in C
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: maintainer-update
>Submitter-Id: current-users
>Arrival-Date: Sun Jan 02 04:20:14 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator: Anton Karpov
>Release: FreeBSD 5.3-STABLE i386
>Organization:
>Environment:
System: FreeBSD mercury.ank-pki.ru 5.3-STABLE FreeBSD 5.3-STABLE #0: Fri Nov 19 21:34:12 MSK 2004 root at mercury.ank-pki.ru:/usr/obj/usr/src/sys/MERCURY i386
>Description:
Currently, there are too few good spam/anti-virus scanners for qmail in ports. Simscan
is a good, simple, and fast qmail scanner, which works with SpamAssassin/ClamAV, written
in C.
This is the new port, works fine for me, but I suppose some improvements in future.
Hope it will be useful for a lot of people searching for fast and simple "glue" to integrate
qmail with spamassassin/clamav
>How-To-Repeat:
>Fix:
New port shar file attached
--- simscan begins here ---
# This is a shell archive. Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file". Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
# .
# ./files
# ./Makefile
# ./distinfo
# ./pkg-install
# ./pkg-message
# ./pkg-plist
# ./pkg-descr
#
echo c - .
mkdir -p . > /dev/null 2>&1
echo c - ./files
mkdir -p ./files > /dev/null 2>&1
echo x - ./Makefile
sed 's/^X//' >./Makefile << 'END-of-./Makefile'
X# New ports collection makefile for: simscan
X# Date created: 2005-01-01
X# Whom: Anton Karpov <toxa at unixforge.org>
X#
X# $FreeBSD$
X#
X
XPORTNAME= simscan
XPORTVERSION= 1.0.8
XCATEGORIES= mail security
XMASTER_SITES= http://www.inter7.com/simscan/
XMASTER_SITE_SUBDIR= ${PORTNAME}
XDISTNAME= ${PORTNAME}-${PORTVERSION:S/.r/rc/}
X
XMAINTAINER= toxa at unixforge.org
XCOMMENT= Fast Content/Anti-virus Scanner for qmail Written in C
X
XBUILD_DEPENDS= ${QMAIL_QUEUE}:${PORTSDIR}/mail/qmail \
X ripmime:${PORTSDIR}/mail/ripmime \
X
X# A normal qmail installation puts everything into /var/qmail/.
X# Must match your qmail installation
XQMAIL_DIR?= /var/qmail
XWORKDIR?= ${QMAIL_DIR}/${PORTNAME}
X#PREFIX= ${QMAIL_DIR}
XQMAIL_QUEUE= ${QMAIL_DIR}/bin/qmail-queue
XSIMSCAN_USER= simscan
X
XOPTIONS= CLAMAV "Support for ClamAV Virus Scanning" on \
X SPAMD "Support for SpamAssassin Spam Filtering" off \
X USER "Turn On Per User SpamAssassin (required SPAMD)" off \
X DOMAIN "Turn On Per Domain Based Checking" off \
X ATTACH "Turn On Attachment Scanning (required CLAMAV)" off \
X DROPMSG "Drop Message in Case of Virus/Spam Found" off \
X PASSTHRU "Pass Spam Thru, Do Not Reject (required SPAMD)" off \
X HEADERS "Add a Received Line With Versions of Scanners" off \
X PORTDOCS "Readme/ChangeLog/Tips for further reading" on
X
X.include <bsd.port.pre.mk>
X
XCONFIGURE_ARGS=--enable-ripmime \
X --enable-clamavdb-path=/var/db/clamav \
X --enable-qmaildir=${QMAIL_DIR} \
X --enable-spamc-user=n \
X --enable-workdir=${WORKDIR}
X
X.if defined(WITHOUT_CLAMAV)
XCONFIGURE_ARGS+=-enable-clamav=n
X.else
XBUILD_DEPENDS+= clamdscan:${PORTSDIR}/security/clamav
X.endif
X
X.if defined(WITH_SPAMD)
XBUILD_DEPENDS+= spamassassin:${PORTSDIR}/mail/p5-Mail-SpamAssassin
XCONFIGURE_ARGS+=--enable-spam=y
XCONFIGURE_ARGS+=--enable-spamassassin-path=${LOCALBASE}/bin/spamassassin
X.endif
X
X.if defined(WITH_USER)
XCONFIGURE_ARGS+=--enable-spamc-user=y
X.endif
X
X.if defined(WITH_DOMAIN)
XCONFIGURE_ARGS+=--enable-per-domain=y
X.endif
X
X.if defined(WITH_ATTACH)
XCONFIGURE_ARGS+=--enable-attach=y
X.endif
X
X.if defined(WITH_DROPMSG)
XCONFIGURE_ARGS+=--enable-dropmsg=y
X.endif
X
X.if defined(WITH_PASSTHRU)
XCONFIGURE_ARGS+=--enable-spam-passthru=y
X.endif
X
X.if defined(WITH_HEADERS)
XCONFIGURE_ARGS+=--enable-received=y
XCONFIGURE_ARGS+=--enable-sigtool-path=${LOCALBASE}/bin/sigtool
X.endif
X
X.if defined(SPAM_HITS)
XCONFIGURE_ARGS+=--enable-spam-hits=${SPAM_HITS}
X.endif
X
X.if defined(QUARANTINE_DIR)
XCONFIGURE_ARGS+=--enable-quarantinedir=${QUARANTINE_DIR}
X.endif
X
X.if defined(SPAMC_ARGS)
XCONFIGURE_ARGS+=--enable-spamc-args=${SPAMC_ARGS}
X.endif
X
X.if defined(QMAIL_QUEUE)
XCONFIGURE_ARGS+=--enable-qmail-queue=${QMAIL_QUEUE}
X.endif
X
XPORTDOCS= AUTHORS ChangeLog README TODO
X
Xif ! ${TEST} -f ${QMAIL_QUEUE}; then \
X ${ECHO_MSG} "Unable to found qmail-queue binary trying '${QMAIL_QUEUE}'."; \
X ${ECHO_MSG} "Please set QMAIL_DIR to your qmail installation directory !"; \
X exit 1; \
Xfi
X
Xpre-configure:
X @${ECHO_MSG} ""
X @${ECHO_MSG} "=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~="
X @${ECHO_MSG} "You may also use the following build options:"
X @${ECHO_MSG} ""
X @${ECHO_MSG} "QMAIL_DIR Base qmail directory. Default is ${QMAIL_DIR}"
X @${ECHO_MSG} "QMAIL_QUEUE Define full path and name of the qmail-queue program"
X @${ECHO_MSG} " Incoming mail is passed to this program after being"
X @${ECHO_MSG} " scanned by SimScan. Default is ${QMAIL_QUEUE}"
X @${ECHO_MSG} "SPAMC_ARGS Define the arguments to pass to spamc."
X @${ECHO_MSG} " Be sure to place quotes around the options you define"
X @${ECHO_MSG} "SPAM_HITS Reject spam above this hit level"
X @${ECHO_MSG} " Default is 10.0. Remember about spamassassin configiuration"
X @${ECHO_MSG} "QUARANTINE_DIR Directory to keep spam and/or infected emails"
X @${ECHO_MSG} " Default is disabled"
X @${ECHO_MSG} "=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~="
X @${ECHO_MSG} ""
X
Xdo-build:
X @(cd ${WRKSRC} && ${WRKSRC}/${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS} && ${MAKE})
X
Xdo-install:
X @PKG_PREFIX=${PREFIX} ${SH} ${PKGDIR}/pkg-install ${PKGNAME} PRE-INSTALL
X ${INSTALL} -o ${SIMSCAN_USER} -g qmail -m 4711 ${WRKSRC}/simscan ${QMAIL_DIR}/bin
X ${INSTALL} -g qmail ${WRKSRC}/simscanmk ${QMAIL_DIR}/bin
X @${STRIP_CMD} ${QMAIL_DIR}/bin/simscan
X @${STRIP_CMD} ${QMAIL_DIR}/bin/simscanmk
X @${MKDIR} ${{QMAIL_DIR}/${PORTNAME}
X.if defined(WITH_PORTDOCS)
X @${MKDIR} ${DOCSDIR}
X.for i in ${PORTDOCS}
X @${INSTALL_DATA} ${WRKSRC}/${i} ${DOCSDIR}
X.endfor
X.endif
X @${CAT} ${PKGMESSAGE}
X
X.include <bsd.port.post.mk>
END-of-./Makefile
echo x - ./distinfo
sed 's/^X//' >./distinfo << 'END-of-./distinfo'
XMD5 (simscan-1.0.8.tar.gz) = b34c4a5505dc4fcf1667eaf7911410d3
XSIZE (simscan-1.0.8.tar.gz) = 144240
END-of-./distinfo
echo x - ./pkg-install
sed 's/^X//' >./pkg-install << 'END-of-./pkg-install'
X#!/bin/sh
X#
X
XUSER=simscan
XGROUP=${USER}
XUID=99
XGID=99
X
Xif ! pw groupshow "${GROUP}" 2>/dev/null 1>&2; then
X if pw groupadd ${GROUP} -g ${GID}; then
X echo "Added group \"${GROUP}\"."
X else
X echo "Adding group \"${GROUP}\" failed..."
X exit 1
X fi
Xfi
X
Xif ! pw usershow "${USER}" 2>/dev/null 1>&2; then
X if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \
X -s "/sbin/nologin" -d "/nonexistent" \
X -c "World Wide Web Owner"; \
X then
X echo "Added user \"${USER}\"."
X else
X echo "Adding user \"${USER}\" failed..."
X exit 1
X fi
Xfi
Xexit 0
END-of-./pkg-install
echo x - ./pkg-message
sed 's/^X//' >./pkg-message << 'END-of-./pkg-message'
X
X=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
XNOTES:
X
X* You have to configure your anti-virus and anti-spam products!
X
X* You have to modify your qmail startup files to call simscan.
XIn most cases, you just need to edit /var/qmail/tcp.smtp in
Xorder to call simscan instead of qmail-queue, by setting up
XQMAILQUEUE variable. For example:
X
X127.0.0.1:allow,RELAYCLIENT=""
X192.168.0.:allow,RELAYCLIENT="",QMAILQUEUE="/var/qmail/bin/simscan"
X:allow,QMAILQUEUE="/var/qmail/bin/simscan"
X
X* Don't forget to rebuild tcp.smtp.cdb from new tcp.smtp using tcprules!
X
X* Also, read documentation about how to configure
Xattachment blocking and per domain processing.
X=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
X
END-of-./pkg-message
echo x - ./pkg-plist
sed 's/^X//' >./pkg-plist << 'END-of-./pkg-plist'
X at unexec echo ""
X at unexec echo "If you're not updating this port, you can delete simscan directory"
X at unexec echo "And type 'pw userdel simscan && pw groupdel simscan' as well."
X at unexec echo ""
END-of-./pkg-plist
echo x - ./pkg-descr
sed 's/^X//' >./pkg-descr << 'END-of-./pkg-descr'
XSimscan is a simple program that enables qmail-smtpd to reject
Xviruses, spam and block attachments during the SMTP conversation
Xso the email never makes it into your computers. It is completely
Xopen source and uses other open source components.
XVery efficient and written in C.
X
XWWW: http://www.inter7.com/?page=simscan
END-of-./pkg-descr
exit
--- simscan ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list