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

Anton Karpov toxa at unixforge.org
Tue Jan 11 21:40:25 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, toxa at unixforge.org
Cc:  
Subject: Re: ports/75717: New port: fast spam/antivirus scanner for qmail written in C
Date: Wed, 12 Jan 2005 00:31:14 +0300

 --HcAYCG3uE/tztfnV
 Content-Type: text/plain; charset=koi8-r
 Content-Disposition: inline
 
 Due to the fact this PR is still open, I suggest to forget about this
 "beta version" and review modified port instead. Now it is quite qood I
 think, all simscan features now supported (except trophie scanner, I'm
 in doubt what is it and if it exists in ports tree), configuration is
 also quite flexible. So please review THIS port instead of the first one.
 
 Cheers.
 
 --HcAYCG3uE/tztfnV
 Content-Type: application/x-shar
 Content-Disposition: attachment; filename="simscan.shar"
 Content-Transfer-Encoding: quoted-printable
 
 # This is a shell archive.  Save it in a file, remove anything before=0A# t=
 his line, and then unpack it by entering "sh file".  Note, it may=0A# creat=
 e directories; files and directories will be owned by you and=0A# have defa=
 ult permissions.=0A#=0A# This archive contains:=0A#=0A#	simscan=0A#	simscan=
 /Makefile=0A#	simscan/distinfo=0A#	simscan/pkg-install=0A#	simscan/pkg-mess=
 age=0A#	simscan/pkg-plist=0A#	simscan/pkg-descr=0A#=0Aecho c - simscan=0Amk=
 dir -p simscan > /dev/null 2>&1=0Aecho x - simscan/Makefile=0Ased 's/^X//' =
 >simscan/Makefile << 'END-of-simscan/Makefile'=0AX# New ports collection ma=
 kefile for:	simscan=0AX# Date created:        2005-01-01=0AX# Whom:        =
         Anton Karpov <toxa at unixforge.org>=0AX#=0AX# $FreeBSD$=0AX#=0AX=0AXP=
 ORTNAME=3D	simscan=0AXPORTVERSION=3D	1.0.8=0AXCATEGORIES=3D	mail security=
 =0AXMASTER_SITES=3D	http://www.inter7.com/simscan/=0AXMASTER_SITE_SUBDIR=3D=
 	${PORTNAME}=0AXDISTNAME=3D	${PORTNAME}-${PORTVERSION:S/.r/rc/}=0AX=0AXMAIN=
 TAINER=3D	toxa at unixforge.org=0AXCOMMENT=3D	Fast Content/Anti-virus Scanner =
 for qmail Written in C=0AX=0AXBUILD_DEPENDS=3D	${QMAIL_QUEUE}:${PORTSDIR}/m=
 ail/qmail=0AX=0AXGNU_CONFIGURE=3D	yes=0AX=0AX# A normal qmail installation =
 puts everything into /var/qmail/.=0AX# Must match your qmail installation=
 =0AXQMAIL_DIR?=3D	/var/qmail=0AXWORKDIR?=3D	${QMAIL_DIR}/${PORTNAME}=0AXSIM=
 SCAN_USER?=3D	simscan=0AXQMAIL_QUEUE=3D	${QMAIL_DIR}/bin/qmail-queue=0AXPLI=
 ST_SUB=3D	QMAIL_DIR=3D${QMAIL_DIR} \=0AX		SIMSCAN_DIR=3D${PORTNAME} \=0AX		=
 SIMSCAN_USER=3D${SIMSCAN_USER}=0AX=0AXOPTIONS=3D	CLAMAV "Support for ClamAV=
  Virus Scanning" on \=0AX		RIPMIME "Ripmime Processing (if Clamav ScanMail =
 disabled)" on \=0AX		SPAMD "Support for SpamAssassin Spam Filtering" off \=
 =0AX		USER "Turn On Per User SpamAssassin (required SPAMD)" off \=0AX		DOMA=
 IN "Turn On Per Domain Based Checking" off \=0AX		ATTACH "Turn On Attachmen=
 t Scanning (required CLAMAV)" off \=0AX		DROPMSG "Drop Message in Case of V=
 irus Found" off \=0AX		PASSTHRU "Pass Spam Thru, Do Not Reject (required SP=
 AMD)" off \=0AX		HEADERS "Add a Received Line With Versions of Scanners" of=
 f \=0AX		PORTDOCS "Readme/ChangeLog/Tips for further reading" on=0AX=0AX.in=
 clude <bsd.port.pre.mk>=0AX=0AXCONFIGURE_ARGS=3D--enable-clamavdb-path=3D/v=
 ar/db/clamav \=0AX		--enable-qmaildir=3D${QMAIL_DIR} \=0AX	  	--enable-spam=
 c-user=3Dn \=0AX		--enable-workdir=3D${WORKDIR}=0AX=0AX.if defined(WITHOUT_=
 CLAMAV)=0AXCONFIGURE_ARGS+=3D-enable-clamav=3Dn=0AX.else=0AXBUILD_DEPENDS+=
 =3D	clamdscan:${PORTSDIR}/security/clamav=0AX.endif=0AX=0AX.if defined(WITH=
 OUT_RIPMIME)=0AXCONFIGURE_ARGS+=3D--disable-ripmime=0AX.else=0AXBUILD_DEPEN=
 DS+=3D	ripmime:${PORTSDIR}/mail/ripmime=0AX.endif=0AX=0AX.if defined(WITH_S=
 PAMD)=0AXBUILD_DEPENDS+=3D	spamassassin:${PORTSDIR}/mail/p5-Mail-SpamAssass=
 in=0AXCONFIGURE_ARGS+=3D--enable-spam=3Dy=0AXCONFIGURE_ARGS+=3D--enable-spa=
 massassin-path=3D${LOCALBASE}/bin/spamassassin=0AX.endif=0AX=0AX.if defined=
 (WITH_USER)=0AXCONFIGURE_ARGS+=3D--enable-spamc-user=3Dy=0AX.endif=0AX=0AX.=
 if defined(WITH_DOMAIN)=0AXCONFIGURE_ARGS+=3D--enable-per-domain=3Dy=0AX.en=
 dif=0AX=0AX.if defined(WITH_ATTACH)=0AXCONFIGURE_ARGS+=3D--enable-attach=3D=
 y=0AX.endif=0AX=0AX.if defined(WITH_DROPMSG)=0AXCONFIGURE_ARGS+=3D--enable-=
 dropmsg=3Dy=0AX.endif=0AX=0AX.if defined(WITH_PASSTHRU)=0AXCONFIGURE_ARGS+=
 =3D--enable-spam-passthru=3Dy=0AX.endif=0AX=0AX.if defined(WITH_HEADERS)=0A=
 XCONFIGURE_ARGS+=3D--enable-received=3Dy=0AXCONFIGURE_ARGS+=3D--enable-sigt=
 ool-path=3D${LOCALBASE}/bin/sigtool=0AX.endif=0AX=0AX.if defined(SPAM_HITS)=
 =0AXCONFIGURE_ARGS+=3D--enable-spam-hits=3D${SPAM_HITS}=0AX.endif=0AX=0AX.i=
 f defined(QUARANTINE_DIR)=0AXCONFIGURE_ARGS+=3D--enable-quarantinedir=3D${Q=
 UARANTINE_DIR}=0AX.endif=0AX=0AX.if defined(SPAMC_ARGS)=0AXCONFIGURE_ARGS+=
 =3D--enable-spamc-args=3D${SPAMC_ARGS}=0AX.endif=0AX=0AX.if defined(QMAIL_Q=
 UEUE)=0AXCONFIGURE_ARGS+=3D--enable-qmail-queue=3D${QMAIL_QUEUE}=0AX.endif=
 =0AX=0AX.if (${SIMSCAN_USER} !=3D "simscan")=0AXCONFIGURE_ARGS+=3D--enable-=
 user=3D${SIMSCAN_USER}=0AX.endif=0AX=0AXPORTDOCS=3D	AUTHORS ChangeLog READM=
 E TODO=0AX=0AXif ! ${TEST} -f ${QMAIL_QUEUE}; then \=0AX	${ECHO_MSG} "Unabl=
 e to found qmail-queue binary trying '${QMAIL_QUEUE}'.";  \=0AX	${ECHO_MSG}=
  "Please set QMAIL_DIR to your qmail installation directory !"; \=0AX	exit =
 1; \=0AXfi=0AX=0AXpre-configure:=0AX	@PKG_PREFIX=3D${PREFIX} ${SH} ${PKGDIR=
 }/pkg-install ${SIMSCAN_USER}=0AX	@${ECHO_MSG} ""=0AX	@${ECHO_MSG} "=3D~=3D=
 ~=3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D~=
 =3D~=3D~=3D~=3D"=0AX	@${ECHO_MSG} "You may also use the following build opt=
 ions:"=0AX	@${ECHO_MSG} ""=0AX	@${ECHO_MSG} "SIMSCAN_USER		User for simscan=
 =2E Default is simscan"=0AX	@${ECHO_MSG} "QMAIL_DIR		Base qmail directory. =
 Default is /var/qmail"=0AX	@${ECHO_MSG} "QMAIL_QUEUE		Define full path and =
 name of the qmail-queue program"=0AX	@${ECHO_MSG} "			Incoming mail is pass=
 ed to this program after being"=0AX	@${ECHO_MSG} "			scanned by SimScan. De=
 fault is /var/qmail/bin/qmail-queue"=0AX	@${ECHO_MSG} "SPAMC_ARGS		Define t=
 he arguments to pass to spamc."=0AX	@${ECHO_MSG} "			Be sure to place quote=
 s around the options you define"=0AX	@${ECHO_MSG} "SPAM_HITS		Reject spam o=
 nly above this hit level"=0AX	@${ECHO_MSG} "			Default is 10.0. Useful with=
 out PASSTHRU option"=0AX	@${ECHO_MSG} "QUARANTINE_DIR		Directory to keep sp=
 am and/or infected emails"=0AX	@${ECHO_MSG} "			Default is disabled"=0AX	@$=
 {ECHO_MSG} "=3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D=
 ~=3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D"=0AX	@${ECHO_MSG} ""=0AX=0AXdo-install:=0A=
 X	${INSTALL} -o ${SIMSCAN_USER} -g qmail -m 4711 ${WRKSRC}/simscan ${QMAIL_=
 DIR}/bin=0AX	${INSTALL} -g qmail ${WRKSRC}/simscanmk ${QMAIL_DIR}/bin=0AX	@=
 ${STRIP_CMD} ${QMAIL_DIR}/bin/simscan=0AX	@${STRIP_CMD} ${QMAIL_DIR}/bin/si=
 mscanmk=0AX	@${MKDIR} ${{QMAIL_DIR}/${PORTNAME}=0AX.if defined(WITH_PORTDOC=
 S)=0AX	@${MKDIR} ${DOCSDIR}=0AX.for i in ${PORTDOCS}=0AX	@${INSTALL_DATA} $=
 {WRKSRC}/${i} ${DOCSDIR}=0AX.endfor=0AX.endif=0AX	@${CAT} ${PKGMESSAGE}=0AX=
 =0AX.include <bsd.port.post.mk>=0AEND-of-simscan/Makefile=0Aecho x - simsca=
 n/distinfo=0Ased 's/^X//' >simscan/distinfo << 'END-of-simscan/distinfo'=0A=
 XMD5 (simscan-1.0.8.tar.gz) =3D b34c4a5505dc4fcf1667eaf7911410d3=0AXSIZE (s=
 imscan-1.0.8.tar.gz) =3D 144240=0AEND-of-simscan/distinfo=0Aecho x - simsca=
 n/pkg-install=0Ased 's/^X//' >simscan/pkg-install << 'END-of-simscan/pkg-in=
 stall'=0AX#!/bin/sh=0AX#=0AX=0AX[ $# -ne 1 ] && exit 1=0AX=0AXSIMSCAN_USER=
 =3D$1=0AXGROUP=3D${SIMSCAN_USER}=0AXUID=3D99=0AXGID=3D99=0AX=0AXif ! pw gro=
 upshow "${GROUP}" 2>/dev/null 1>&2; then=0AX	if pw groupadd ${GROUP} -g ${G=
 ID}; then=0AX		echo "Added group \"${GROUP}\"."=0AX	else=0AX		echo "Adding =
 group \"${GROUP}\" failed..."=0AX		exit 1=0AX	fi=0AXfi=0AX=0AXif ! pw users=
 how "${SIMSCAN_USER}" 2>/dev/null 1>&2; then=0AX	if pw useradd ${SIMSCAN_US=
 ER} -u ${UID} -g ${GROUP} -h - \=0AX		-s "/sbin/nologin" -d "/nonexistent" =
 \=0AX		-c "Simscan user"; \=0AX	then=0AX		echo "Added user \"${SIMSCAN_USER=
 }\"."=0AX	else=0AX		echo "Adding user \"${SIMSCAN_USER}\" failed..."=0AX		e=
 xit 1=0AX	fi=0AXfi=0AXexit 0=0AEND-of-simscan/pkg-install=0Aecho x - simsca=
 n/pkg-message=0Ased 's/^X//' >simscan/pkg-message << 'END-of-simscan/pkg-me=
 ssage'=0AX=0AX=3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D~=
 =3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D=0AXNOTES:=0AX=0AX* You have=
  to configure your anti-virus and anti-spam products!=0AX=0AX* You have to =
 modify your qmail startup files to call simscan.=0AXIn most cases, you just=
  need to edit /var/qmail/tcp.smtp in=0AXorder to call simscan instead of qm=
 ail-queue, by setting up=0AXQMAILQUEUE variable. For example:=0AX=0AX127.0.=
 0.1:allow,RELAYCLIENT=3D""=0AX192.168.0.:allow,RELAYCLIENT=3D"",QMAILQUEUE=
 =3D"/var/qmail/bin/simscan"=0AX:allow,QMAILQUEUE=3D"/var/qmail/bin/simscan"=
 =0AX=0AX* Don't forget to rebuild tcp.smtp.cdb from new tcp.smtp using tcpr=
 ules!=0AX=0AX* Also, read documentation about how to configure =0AXattachme=
 nt blocking and per domain processing. =0AXAdditional documentation can be =
 found here: =0AXhttp://qmailwiki.inter7.com/index.php?title=3DSimscan=0AX=
 =0AX=3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D=
 ~=3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D~=3D=0AX=0AEND-of-simscan/pkg-message=0Aech=
 o x - simscan/pkg-plist=0Ased 's/^X//' >simscan/pkg-plist << 'END-of-simsca=
 n/pkg-plist'=0AX at cwd %%QMAIL_DIR%%=0AXbin/simscan=0AXbin/simscanmk=0AX at unex=
 ec echo ""=0AX at unexec echo "If you're not updating this port, you can delet=
 e %%QMAIL_DIR%%/%%SIMSCAN_DIR%% directory"=0AX at unexec echo "And type 'pw us=
 erdel %%SIMSCAN_USER%%' as well."=0AX at unexec echo ""=0AEND-of-simscan/pkg-p=
 list=0Aecho x - simscan/pkg-descr=0Ased 's/^X//' >simscan/pkg-descr << 'END=
 -of-simscan/pkg-descr'=0AXSimscan is a simple program that enables qmail-sm=
 tpd to reject =0AXviruses, spam and block attachments during the SMTP conve=
 rsation =0AXso the email never makes it into your computers. It is complete=
 ly =0AXopen source and uses other open source components. =0AXVery efficien=
 t and written in C.=0AX=0AXWWW:	http://www.inter7.com/?page=3Dsimscan=0AEND=
 -of-simscan/pkg-descr=0Aexit=0A=0A
 --HcAYCG3uE/tztfnV--



More information about the freebsd-ports-bugs mailing list