ports/75717: New port: fast spam/antivirus scanner for qmail written in C

Anton Karpov toxa at unixforge.org
Sat Jan 15 20:10:27 UTC 2005


The following reply was made to PR ports/75717; it has been noted by GNATS.

From: Anton Karpov <toxa at unixforge.org>
To: freebsd-gnats-submit at FreeBSD.org
Cc: sem at freebsd.org
Subject: Re: ports/75717: New port: fast spam/antivirus scanner for qmail written in C
Date: Sat, 15 Jan 2005 23:07:49 +0300

 --GvXjxJ+pjyke8COw
 Content-Type: text/plain; charset=koi8-r
 Content-Disposition: inline
 
 Fixed (I hope)
 now attach is 8bit encoded
 
 -- 
 Anton A. Karpov
 
 PGP key:  http://www.toxahost.ru/pgp/pubkey.asc
 
 --GvXjxJ+pjyke8COw
 Content-Type: application/x-shar
 Content-Disposition: attachment; filename="simscan.shar"
 Content-Transfer-Encoding: 8bit
 
 # 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:
 #
 #	simscan
 #	simscan/Makefile
 #	simscan/distinfo
 #	simscan/pkg-install
 #	simscan/pkg-message
 #	simscan/pkg-plist
 #	simscan/pkg-descr
 #
 echo c - simscan
 mkdir -p simscan > /dev/null 2>&1
 echo x - simscan/Makefile
 sed 's/^X//' >simscan/Makefile << 'END-of-simscan/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
 XGNU_CONFIGURE=	yes
 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}
 XSIMSCAN_USER?=	simscan
 XQMAIL_QUEUE=	${QMAIL_DIR}/bin/qmail-queue
 XPLIST_SUB=	QMAIL_DIR=${QMAIL_DIR} \
 X		SIMSCAN_DIR=${PORTNAME} \
 X		SIMSCAN_USER=${SIMSCAN_USER}
 X
 XOPTIONS=	CLAMAV "Support for ClamAV Virus Scanning" on \
 X		RIPMIME "Ripmime Processing (if Clamav ScanMail disabled)" 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 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-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(WITHOUT_RIPMIME)
 XCONFIGURE_ARGS+=--disable-ripmime
 X.else
 XBUILD_DEPENDS+=	ripmime:${PORTSDIR}/mail/ripmime
 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
 X.if (${SIMSCAN_USER} != "simscan")
 XCONFIGURE_ARGS+=--enable-user=${SIMSCAN_USER}
 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	@PKG_PREFIX=${PREFIX} ${SH} ${PKGDIR}/pkg-install ${SIMSCAN_USER}
 X	@${ECHO_MSG} ""
 X	@${ECHO_MSG} "=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~="
 X	@${ECHO_MSG} "You may also use the following build options:"
 X	@${ECHO_MSG} ""
 X	@${ECHO_MSG} "SIMSCAN_USER		User for simscan. Default is simscan"
 X	@${ECHO_MSG} "QMAIL_DIR		Base qmail directory. Default is /var/qmail"
 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 /var/qmail/bin/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 only above this hit level"
 X	@${ECHO_MSG} "			Default is 10.0. Useful without PASSTHRU option"
 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-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-simscan/Makefile
 echo x - simscan/distinfo
 sed 's/^X//' >simscan/distinfo << 'END-of-simscan/distinfo'
 XMD5 (simscan-1.0.8.tar.gz) = b34c4a5505dc4fcf1667eaf7911410d3
 XSIZE (simscan-1.0.8.tar.gz) = 144240
 END-of-simscan/distinfo
 echo x - simscan/pkg-install
 sed 's/^X//' >simscan/pkg-install << 'END-of-simscan/pkg-install'
 X#!/bin/sh
 X#
 X
 X[ $# -ne 1 ] && exit 1
 X
 XSIMSCAN_USER=$1
 XGROUP=${SIMSCAN_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 "${SIMSCAN_USER}" 2>/dev/null 1>&2; then
 X	if pw useradd ${SIMSCAN_USER} -u ${UID} -g ${GROUP} -h - \
 X		-s "/sbin/nologin" -d "/nonexistent" \
 X		-c "Simscan user"; \
 X	then
 X		echo "Added user \"${SIMSCAN_USER}\"."
 X	else
 X		echo "Adding user \"${SIMSCAN_USER}\" failed..."
 X		exit 1
 X	fi
 Xfi
 Xexit 0
 END-of-simscan/pkg-install
 echo x - simscan/pkg-message
 sed 's/^X//' >simscan/pkg-message << 'END-of-simscan/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. 
 XAdditional documentation can be found here: 
 Xhttp://qmailwiki.inter7.com/index.php?title=Simscan
 X
 X=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
 X
 END-of-simscan/pkg-message
 echo x - simscan/pkg-plist
 sed 's/^X//' >simscan/pkg-plist << 'END-of-simscan/pkg-plist'
 X at cwd %%QMAIL_DIR%%
 Xbin/simscan
 Xbin/simscanmk
 X at unexec echo ""
 X at unexec echo "If you're not updating this port, you can delete %%QMAIL_DIR%%/%%SIMSCAN_DIR%% directory"
 X at unexec echo "And type 'pw userdel %%SIMSCAN_USER%%' as well."
 X at unexec echo ""
 END-of-simscan/pkg-plist
 echo x - simscan/pkg-descr
 sed 's/^X//' >simscan/pkg-descr << 'END-of-simscan/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-simscan/pkg-descr
 exit
 
 
 --GvXjxJ+pjyke8COw--



More information about the freebsd-ports-bugs mailing list