summaryrefslogtreecommitdiff
path: root/mail/antivirus-milter
diff options
context:
space:
mode:
authorDirk Meyer <dinoex@FreeBSD.org>2004-01-05 17:51:18 +0000
committerDirk Meyer <dinoex@FreeBSD.org>2004-01-05 17:51:18 +0000
commit66a65607eb7d7b3c9c8de3ae8f39e02bf59cca6d (patch)
tree35cbea76c34f450e34b2ec071fb86519f9b9021f /mail/antivirus-milter
parentUpdate to 0.1.0. (diff)
Sendmail milter wich uses Mcafee Virus Scan
The milter recives messages from sendmail, and saves them as a file in a directory. The directory name and the file name are the "$i" (queue identifier) from Sendmail, making it easier to identify them. Once the entire message has been received, the milter runs "ripmime" on the file to extract any attachments. If rupmime returns without an error then it will run "uvscan" on the diretory to scan all the files in it. If uvscan returns an error, then the milter will look for viruses output from uvscan, and reject the message reporting which viruses were found. If viruses were found then the entire directory is moved to quarantine, otherwise it is deleted. The milter also does extention checks. Certain extentions are blocked completely. In specific, extenions of .scr, .vbs, .pif, and .com are blocked. Author gave permission to distribute it with BSD-License. WWW: http://www.nmt.edu/~wcolburn/antivirus/
Notes
Notes: svn path=/head/; revision=97383
Diffstat (limited to 'mail/antivirus-milter')
-rw-r--r--mail/antivirus-milter/Makefile71
-rw-r--r--mail/antivirus-milter/distinfo1
-rw-r--r--mail/antivirus-milter/files/antivirus-milter.sh28
-rw-r--r--mail/antivirus-milter/files/antivirus.conf11
-rw-r--r--mail/antivirus-milter/files/patch-Makefile21
-rw-r--r--mail/antivirus-milter/pkg-descr20
-rw-r--r--mail/antivirus-milter/pkg-plist5
7 files changed, 157 insertions, 0 deletions
diff --git a/mail/antivirus-milter/Makefile b/mail/antivirus-milter/Makefile
new file mode 100644
index 000000000000..7dae7a4e84fa
--- /dev/null
+++ b/mail/antivirus-milter/Makefile
@@ -0,0 +1,71 @@
+# New ports collection makefile for: antivirus
+# Date created: 02.Jan 2004
+# Whom: dirk.meyer@dinoex.sub.org
+#
+# $FreeBSD$
+#
+
+PORTNAME= antivirus
+PORTVERSION= 3.30
+CATEGORIES= mail
+MASTER_SITES= http://www.nmt.edu/~wcolburn/antivirus/
+
+MAINTAINER= dinoex@FreeBSD.org
+COMMENT= Sendmail milter wich uses Mcafee Virus Scan
+
+RUN_DEPENDS= ${LOCALBASE}/bin/ripmime:${PORTSDIR}/mail/ripmime
+.if !defined(SENDMAIL_MILTER_IN_BASE)
+BUILD_DEPENDS+= ${LOCALBASE}/lib/libmilter.a:${PORTSDIR}/mail/sendmail
+.endif
+
+USE_REINPLACE= yes
+CFLAGS+= -Wall ${PTHREAD_CFLAGS:S=""==}
+LIBS+= -lmilter ${PTHREAD_LIBS}
+ANTIVIRUS_DIR?= /var/spool/antivirus
+PLIST_SUB+= ANTIVIRUS=${ANTIVIRUS_DIR}
+SED_SCRIPT= -e 's|%%ANTIVIRUS%%|${ANTIVIRUS_DIR}|g' \
+ -e 's|%%PREFIX%%|${PREFIX}|g'
+MAKE_ENV+= SENDMAILBASE="${SENDMAILBASE}" \
+ SENDMAILOBJ="${SENDMAILOBJ}" \
+ LIBS="${LIBS}"
+
+.if !defined(SENDMAIL_MILTER_IN_BASE)
+CFLAGS+= -I${LOCALBASE}/include
+LDFLAGS+= -L${LOCALBASE}/lib
+SENDMAILBASE= ${LOCALBASE}
+SENDMAILOBJ= ${LOCALBASE}
+.else
+SENDMAILBASE= /usr
+SENDMAILOBJ= /usr
+.endif
+
+.include <bsd.port.pre.mk>
+
+.if defined(SENDMAIL_WITHOUT_MILTER)
+pre-fetch:
+ @${ECHO_MSG}
+ @${ECHO_MSG} You must unset variable SENDMAIL_WITHOUT_MILTER,
+ @${ECHO_MSG} and rebuild sendmail in the ports
+ @${FALSE}
+.endif
+
+do-configure:
+ @${REINPLACE_CMD} -e 's|/etc/mail/antivirus.conf|${LOCALBASE}/etc/antivirus.conf|' \
+ ${CONFIGURE_WRKSRC}/antivirus.c
+ @${SED} ${SED_SCRIPT} ${FILESDIR}/antivirus-milter.sh \
+ > ${WRKSRC}/antivirus-milter.sh
+ @${SED} ${SED_SCRIPT} ${FILESDIR}/antivirus.conf \
+ > ${WRKSRC}/antivirus.conf
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/antivirus \
+ ${PREFIX}/libexec/antivirus
+ ${INSTALL_SCRIPT} ${WRKSRC}/antivirus-milter.sh \
+ ${PREFIX}/etc/rc.d/antivirus-milter.sh.sample
+ ${INSTALL_DATA} ${WRKSRC}/antivirus.conf ${PREFIX}/etc/antivirus.conf-dist
+ ${MKDIR} /var/antivirus/spool /var/antivirus/run /var/antivirus/quarantine
+ ${CHOWN} -R nobody:nobody /var/antivirus/
+ @${ECHO_MSG} "Add to your *.mc configfile:"
+ @${ECHO_MSG} "INPUT_MAIL_FILTER(\`antivirus', \`S=local:${ANTIVIRUS_DIR}/antivirus.sock, F=')"
+
+.include <bsd.port.post.mk>
diff --git a/mail/antivirus-milter/distinfo b/mail/antivirus-milter/distinfo
new file mode 100644
index 000000000000..291f88adca7d
--- /dev/null
+++ b/mail/antivirus-milter/distinfo
@@ -0,0 +1 @@
+MD5 (antivirus-3.30.tar.gz) = 179c39d1fd4713e5075e0d916abcdf7b
diff --git a/mail/antivirus-milter/files/antivirus-milter.sh b/mail/antivirus-milter/files/antivirus-milter.sh
new file mode 100644
index 000000000000..ae642dcdb38d
--- /dev/null
+++ b/mail/antivirus-milter/files/antivirus-milter.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+if ! test -x %%PREFIX%%/libexec/antivirus
+then
+ exit 0
+fi
+case "$1" in
+start)
+ rm -f %%ANTIVIRUS%%/antivirus.sock %%ANTIVIRUS%%/run/antivirus.pid
+ %%PREFIX%%/libexec/antivirus -p local:%%ANTIVIRUS%%/antivirus.sock &
+ echo -n ' antivirus'
+ ;;
+stop)
+ if test -r %%ANTIVIRUS%%/run/antivirus.pid
+ then
+ kill `head -1 %%ANTIVIRUS%%/run/antivirus.pid`
+ else
+ echo " antivirus: not running" 2>&1
+ fi
+ rm -f %%ANTIVIRUS%%/run/antivirus.pid
+ ;;
+*)
+ echo "Usage: ${0##*/}: { start | stop }" >&2
+ exit 64
+ ;;
+esac
diff --git a/mail/antivirus-milter/files/antivirus.conf b/mail/antivirus-milter/files/antivirus.conf
new file mode 100644
index 000000000000..e8275fcae386
--- /dev/null
+++ b/mail/antivirus-milter/files/antivirus.conf
@@ -0,0 +1,11 @@
+HOMEDIR %%ANTIVIRUS%%
+BASEDIR %%ANTIVIRUS%%/spool
+AVSCANDIR /usr/local/bin
+AVSCANNER /usr/local/bin/uvscan
+QUARANTINE %%ANTIVIRUS%%/quarantine
+UNPACKER /usr/local/bin/ripmime
+SAFEUSER nobody
+SAFEGROUP nobody
+PIDFILE %%ANTIVIRUS%%/run/antivirus.pid
+AVPRODUCT mcafee
+AVFAILACTION tempfail
diff --git a/mail/antivirus-milter/files/patch-Makefile b/mail/antivirus-milter/files/patch-Makefile
new file mode 100644
index 000000000000..3c54922e929e
--- /dev/null
+++ b/mail/antivirus-milter/files/patch-Makefile
@@ -0,0 +1,21 @@
+--- Makefile.orig Fri Jun 27 19:55:26 2003
++++ Makefile Fri Jan 2 14:21:02 2004
+@@ -1,5 +1,5 @@
+-SENDMAILBASE=/system/compile/sendmail-8.12.9
+-SENDMAILOBJ=obj.Linux.2.2.19.i686
++#SENDMAILBASE=/system/compile/sendmail-8.12.9
++#SENDMAILOBJ=obj.Linux.2.2.19.i686
+
+ INCDIRS=\
+ -I$(SENDMAILBASE)/include/libmilter/ \
+@@ -10,8 +10,8 @@
+ -L$(SENDMAILBASE)/$(SENDMAILOBJ)/libsm/
+
+ # Linux
+-LIBS=-lmilter -lpthread
+-CFLAGS=-Wall -Werror -g
++#LIBS=-lmilter -lpthread
++#CFLAGS=-Wall -Werror -g
+
+ ##
+ ## Solaris
diff --git a/mail/antivirus-milter/pkg-descr b/mail/antivirus-milter/pkg-descr
new file mode 100644
index 000000000000..d83c2be70db7
--- /dev/null
+++ b/mail/antivirus-milter/pkg-descr
@@ -0,0 +1,20 @@
+Sendmail milter wich uses Mcafee Virus Scan
+
+The milter recives messages from sendmail, and saves them as a file in
+a directory. The directory name and the file name are the "$i" (queue
+identifier) from Sendmail, making it easier to identify them. Once the
+entire message has been received, the milter runs "ripmime" on the file
+to extract any attachments. If rupmime returns without an error then it
+will run "uvscan" on the diretory to scan all the files in it. If uvscan
+returns an error, then the milter will look for viruses output from
+uvscan, and reject the message reporting which viruses were found. If
+viruses were found then the entire directory is moved to quarantine,
+otherwise it is deleted.
+
+The milter also does extention checks. Certain extentions are blocked
+completely. In specific, extenions of .scr, .vbs, .pif, and .com are
+blocked.
+
+Author gave permission to distribute it with BSD-License.
+
+WWW: http://www.nmt.edu/~wcolburn/antivirus/
diff --git a/mail/antivirus-milter/pkg-plist b/mail/antivirus-milter/pkg-plist
new file mode 100644
index 000000000000..40508fc77367
--- /dev/null
+++ b/mail/antivirus-milter/pkg-plist
@@ -0,0 +1,5 @@
+libexec/antivirus
+etc/antivirus.conf-dist
+etc/rc.d/antivirus-milter.sh.sample
+@exec mkdir -p %%ANTIVIRUS%%/spool %%ANTIVIRUS%%/run %%ANTIVIRUS%%/run/quarantine
+@exec chown -R nobody:nobody %%ANTIVIRUS%%/