aboutsummaryrefslogtreecommitdiff
path: root/mail/simscan
diff options
context:
space:
mode:
authorRoman Bogorodskiy <novel@FreeBSD.org>2005-04-03 16:04:21 +0000
committerRoman Bogorodskiy <novel@FreeBSD.org>2005-04-03 16:04:21 +0000
commit3ada00cdc32a4fce947f69aab0bfc008fa67d03f (patch)
tree70e514671a0139b6e6cc2748ad13ff015352d2c1 /mail/simscan
parent2f8c610bcdcfdea80dc9578fa7f828f76eebeffe (diff)
downloadports-3ada00cdc32a4fce947f69aab0bfc008fa67d03f.tar.gz
ports-3ada00cdc32a4fce947f69aab0bfc008fa67d03f.zip
Notes
Diffstat (limited to 'mail/simscan')
-rw-r--r--mail/simscan/Makefile144
-rw-r--r--mail/simscan/distinfo2
-rw-r--r--mail/simscan/pkg-deinstall13
-rw-r--r--mail/simscan/pkg-descr7
-rw-r--r--mail/simscan/pkg-install49
-rw-r--r--mail/simscan/pkg-message23
-rw-r--r--mail/simscan/pkg-plist7
-rw-r--r--mail/simscan/scripts/configure36
8 files changed, 281 insertions, 0 deletions
diff --git a/mail/simscan/Makefile b/mail/simscan/Makefile
new file mode 100644
index 000000000000..bdf26c52224d
--- /dev/null
+++ b/mail/simscan/Makefile
@@ -0,0 +1,144 @@
+# New ports collection makefile for: simscan
+# Date created: 1 Apr 2005
+# Whom: Anton Karpov <toxa@toxahost.ru>
+#
+# $FreeBSD$
+#
+
+PORTNAME= simscan
+PORTVERSION= 1.1
+CATEGORIES= mail security
+MASTER_SITES= http://www.inter7.com/simscan/
+MASTER_SITE_SUBDIR= ${PORTNAME}
+DISTNAME= ${PORTNAME}-${PORTVERSION:S/.r/rc/}
+
+MAINTAINER= toxa@toxahost.ru
+COMMENT= Fast Content/Anti-virus Scanner for qmail Written in C
+
+BUILD_DEPENDS= ${QMAIL_QUEUE}:${PORTSDIR}/mail/qmail
+
+GNU_CONFIGURE= yes
+
+# A normal qmail installation puts everything into /var/qmail/.
+# Must match your qmail installation
+QMAIL_DIR?= /var/qmail
+WORKDIR?= ${QMAIL_DIR}/${PORTNAME}
+QMAIL_QUEUE= ${QMAIL_DIR}/bin/qmail-queue
+PLIST_SUB= QMAIL_DIR=${QMAIL_DIR} \
+ SIMSCAN_DIR=${PORTNAME}
+
+OPTIONS= CLAMAV "Support for ClamAV Virus Scanning" on \
+ RIPMIME "Ripmime Processing (if Clamav ScanMail disabled)" on \
+ SPAMD "Support for SpamAssassin Spam Filtering" off \
+ USER "Turn On Per User SpamAssassin (required SPAMD)" off \
+ DOMAIN "Turn On Per Domain Based Checking" off \
+ ATTACH "Turn On Attachment Scanning (required CLAMAV)" off \
+ DROPMSG "Drop Message in Case of Virus Found" off \
+ PASSTHRU "Pass Spam Thru, Do Not Reject (required SPAMD)" off \
+ HEADERS "Add a Received Line With Versions of Scanners" off
+
+.include <bsd.port.pre.mk>
+
+CONFIGURE_ARGS=--enable-clamavdb-path=/var/db/clamav \
+ --enable-qmaildir=${QMAIL_DIR} \
+ --enable-spamc-user=n \
+ --enable-workdir=${WORKDIR}
+
+.if defined(WITHOUT_CLAMAV)
+CONFIGURE_ARGS+=-enable-clamav=n
+.else
+BUILD_DEPENDS+= clamdscan:${PORTSDIR}/security/clamav
+.endif
+
+.if defined(WITHOUT_RIPMIME)
+CONFIGURE_ARGS+=--disable-ripmime
+.else
+BUILD_DEPENDS+= ripmime:${PORTSDIR}/mail/ripmime
+.endif
+
+.if defined(WITH_SPAMD)
+BUILD_DEPENDS+= spamassassin:${PORTSDIR}/mail/p5-Mail-SpamAssassin
+CONFIGURE_ARGS+=--enable-spam=y
+CONFIGURE_ARGS+=--enable-spamassassin-path=${LOCALBASE}/bin/spamassassin
+.endif
+
+.if defined(WITH_USER)
+CONFIGURE_ARGS+=--enable-spamc-user=y
+.endif
+
+.if defined(WITH_DOMAIN)
+CONFIGURE_ARGS+=--enable-per-domain=y
+.endif
+
+.if defined(WITH_ATTACH)
+CONFIGURE_ARGS+=--enable-attach=y
+.endif
+
+.if defined(WITH_DROPMSG)
+CONFIGURE_ARGS+=--enable-dropmsg=y
+.endif
+
+.if defined(WITH_PASSTHRU)
+CONFIGURE_ARGS+=--enable-spam-passthru=y
+.endif
+
+.if defined(WITH_HEADERS)
+CONFIGURE_ARGS+=--enable-received=y
+CONFIGURE_ARGS+=--enable-sigtool-path=${LOCALBASE}/bin/sigtool
+.endif
+
+.if defined(SPAM_HITS)
+CONFIGURE_ARGS+=--enable-spam-hits=${SPAM_HITS}
+.endif
+
+.if defined(QUARANTINE_DIR)
+CONFIGURE_ARGS+=--enable-quarantinedir=${QUARANTINE_DIR}
+.endif
+
+.if defined(SPAMC_ARGS)
+CONFIGURE_ARGS+=--enable-spamc-args=${SPAMC_ARGS}
+.endif
+
+.if defined(QMAIL_QUEUE)
+CONFIGURE_ARGS+=--enable-qmail-queue=${QMAIL_QUEUE}
+.endif
+
+PORTDOCS= AUTHORS ChangeLog README TODO
+
+if ! ${TEST} -f ${QMAIL_QUEUE}; then \
+ ${ECHO_MSG} "Unable to found qmail-queue binary trying '${QMAIL_QUEUE}'."; \
+ ${ECHO_MSG} "Please set QMAIL_DIR to your qmail installation directory !"; \
+ exit 1; \
+fi
+
+pre-configure:
+ @${ECHO_MSG} ""
+ @${ECHO_MSG} "=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~="
+ @${ECHO_MSG} "You may also use the following build options:"
+ @${ECHO_MSG} ""
+ @${ECHO_MSG} "QMAIL_DIR Base qmail directory. Default is /var/qmail"
+ @${ECHO_MSG} "WORKDIR Directory to unpack emails. Default is /var/qmail/simscan"
+ @${ECHO_MSG} "QMAIL_QUEUE Define full path and name of the qmail-queue program"
+ @${ECHO_MSG} " Incoming mail is passed to this program after being"
+ @${ECHO_MSG} " scanned by SimScan. Default is /var/qmail/bin/qmail-queue"
+ @${ECHO_MSG} "SPAMC_ARGS Define the arguments to pass to spamc."
+ @${ECHO_MSG} " Be sure to place quotes around the options you define"
+ @${ECHO_MSG} "SPAM_HITS Reject spam only above this hit level"
+ @${ECHO_MSG} " Default is 10.0. Useful without PASSTHRU option"
+ @${ECHO_MSG} "QUARANTINE_DIR Directory to keep spam and/or infected emails"
+ @${ECHO_MSG} " Default is disabled"
+ @${ECHO_MSG} "=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~="
+ @${ECHO_MSG} ""
+
+post-install:
+ @${CHMOD} 04711 ${QMAIL_DIR}/bin/simscan
+ @${CHOWN} simscan:simscan ${QMAIL_DIR}/bin/simscan ${QMAIL_DIR}/bin/simscanmk
+.if !defined(NOPORTDOCS)
+ @${MKDIR} ${DOCSDIR}
+.for i in ${PORTDOCS}
+ @${INSTALL_DATA} ${WRKSRC}/${i} ${DOCSDIR}
+.endfor
+.endif
+ @${CAT} ${PKGMESSAGE}
+
+.include <bsd.port.post.mk>
diff --git a/mail/simscan/distinfo b/mail/simscan/distinfo
new file mode 100644
index 000000000000..e17a3c3f9e3b
--- /dev/null
+++ b/mail/simscan/distinfo
@@ -0,0 +1,2 @@
+MD5 (simscan-1.1.tar.gz) = 2ba25145dc0c1b6159f26f3f4c03d3c6
+SIZE (simscan-1.1.tar.gz) = 130114
diff --git a/mail/simscan/pkg-deinstall b/mail/simscan/pkg-deinstall
new file mode 100644
index 000000000000..c83e30aca59d
--- /dev/null
+++ b/mail/simscan/pkg-deinstall
@@ -0,0 +1,13 @@
+#!/bin/sh
+#
+# $FreeBSD$
+
+USER=simscan
+GROUP=${USER}
+
+if [ x$2 != xDEINSTALL ]; then
+ exit
+fi
+
+pw groupdel -n ${GROUP} || true
+pw userdel -n ${GROUP} || true
diff --git a/mail/simscan/pkg-descr b/mail/simscan/pkg-descr
new file mode 100644
index 000000000000..6a65232b0a09
--- /dev/null
+++ b/mail/simscan/pkg-descr
@@ -0,0 +1,7 @@
+Simscan is a simple program that enables qmail-smtpd to reject
+viruses, spam and block attachments during the SMTP conversation
+so the email never makes it into your computers. It is completely
+open source and uses other open source components.
+Very efficient and written in C.
+
+WWW: http://www.inter7.com/?page=simscan
diff --git a/mail/simscan/pkg-install b/mail/simscan/pkg-install
new file mode 100644
index 000000000000..43b739839251
--- /dev/null
+++ b/mail/simscan/pkg-install
@@ -0,0 +1,49 @@
+#!/bin/sh
+#
+# $FreeBSD$
+
+USER=simscan
+GROUP=${USER}
+UID=74
+GID=${UID}
+SIMDIR=/var/qmail/simscan
+
+if [ "$2" = "PRE-INSTALL" ]; then
+
+echo adding simscan user
+
+ if pw group show "${GROUP}" 2>/dev/null; then
+ echo "You already have a group \"${GROUP}\", so I will use it."
+ else
+ if pw groupadd ${GROUP} -g ${GID}; then
+ echo "Added group \"${GROUP}\"."
+ else
+ echo "Adding group \"${GROUP}\" failed..."
+ exit 1
+ fi
+ fi
+
+
+ if pw user show "${USER}" 2>/dev/null; then
+ echo "You already have a user \"${USER}\", so I will use it."
+ else
+ if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \
+ -d /nonexistent -s /sbin/nologin -c "Simscan User"
+ then
+ echo "Added user \"${USER}\"."
+ else
+ echo "Adding user \"${USER}\" failed..."
+ exit 1
+ fi
+ fi
+
+elif [ "$2" = "POST-INSTALL" ]; then
+
+ if [ ! -d "$SIMDIR" ]; then
+ /bin/mkdir -p "$SIMDIR" || exit 1
+ /usr/sbin/chown "$USER:$GROUP" "$SIMDIR" || exit 1
+ /bin/chmod 0750 "$SIMDIR" || exit 1
+ fi
+fi
+
+exit 0
diff --git a/mail/simscan/pkg-message b/mail/simscan/pkg-message
new file mode 100644
index 000000000000..490fa0eb6677
--- /dev/null
+++ b/mail/simscan/pkg-message
@@ -0,0 +1,23 @@
+
+=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
+NOTES:
+
+* You have to configure your anti-virus and anti-spam products!
+
+* You have to modify your qmail startup files to call simscan.
+In most cases, you just need to edit /var/qmail/tcp.smtp in
+order to call simscan instead of qmail-queue, by setting up
+QMAILQUEUE variable. For example:
+
+127.0.0.1:allow,RELAYCLIENT=""
+192.168.0.:allow,RELAYCLIENT="",QMAILQUEUE="/var/qmail/bin/simscan"
+:allow,QMAILQUEUE="/var/qmail/bin/simscan"
+
+* Don't forget to rebuild tcp.smtp.cdb from new tcp.smtp using tcprules!
+
+* Also, read documentation about how to configure
+attachment blocking and per domain processing.
+Additional documentation can be found here:
+http://qmailwiki.inter7.com/index.php?title=Simscan
+
+=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
diff --git a/mail/simscan/pkg-plist b/mail/simscan/pkg-plist
new file mode 100644
index 000000000000..38fa642f64cf
--- /dev/null
+++ b/mail/simscan/pkg-plist
@@ -0,0 +1,7 @@
+@cwd %%QMAIL_DIR%%
+bin/simscanmk
+bin/simscan
+@unexec rmdir %%QMAIL_DIR%%/%%SIMSCAN_DIR%% || true
+@unexec echo ""
+@unexec echo "If you're not updating this port, you can delete %%QMAIL_DIR%%/%%SIMSCAN_DIR%% directory"
+@unexec echo ""
diff --git a/mail/simscan/scripts/configure b/mail/simscan/scripts/configure
new file mode 100644
index 000000000000..d502120cd0b5
--- /dev/null
+++ b/mail/simscan/scripts/configure
@@ -0,0 +1,36 @@
+#!/bin/sh
+#
+# $FreeBSD$
+
+USER=simscan
+GROUP=${USER}
+UID=74
+GID=${UID}
+
+echo adding simscan user
+
+
+ if pw group show "${GROUP}" 2>/dev/null; then
+ echo "You already have a group \"${GROUP}\", so I will use it."
+ else
+ if pw groupadd ${GROUP} -g ${GID}; then
+ echo "Added group \"${GROUP}\"."
+ else
+ echo "Adding group \"${GROUP}\" failed..."
+ exit 1
+ fi
+ fi
+
+
+ if pw user show "${USER}" 2>/dev/null; then
+ echo "You already have a user \"${USER}\", so I will use it."
+ else
+ if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \
+ -d /nonexistent -s /sbin/nologin -c "Simscan User"
+ then
+ echo "Added user \"${USER}\"."
+ else
+ echo "Adding user \"${USER}\" failed..."
+ exit 1
+ fi
+ fi