From 9b705f03fe784c91d9256aa4574b3af3f507633f Mon Sep 17 00:00:00 2001 From: vanilla Date: Fri, 30 Jul 2004 00:35:57 +0000 Subject: Add clamsmtp 0.4, an ClamAV anti-virus SMTP Filter. PR: ports/69739 Submitted by: Cheng-Lung Sung --- security/Makefile | 1 + security/clamsmtp/Makefile | 43 +++++++++++++++++++++++++++++++ security/clamsmtp/distinfo | 2 ++ security/clamsmtp/files/clamsmtpd.sh.tmpl | 36 ++++++++++++++++++++++++++ security/clamsmtp/pkg-descr | 12 +++++++++ security/clamsmtp/pkg-message | 17 ++++++++++++ security/clamsmtp/pkg-plist | 4 +++ 7 files changed, 115 insertions(+) create mode 100644 security/clamsmtp/Makefile create mode 100644 security/clamsmtp/distinfo create mode 100644 security/clamsmtp/files/clamsmtpd.sh.tmpl create mode 100644 security/clamsmtp/pkg-descr create mode 100644 security/clamsmtp/pkg-message create mode 100644 security/clamsmtp/pkg-plist (limited to 'security') diff --git a/security/Makefile b/security/Makefile index 58e4a8a..4a8004c 100644 --- a/security/Makefile +++ b/security/Makefile @@ -44,6 +44,7 @@ SUBDIR += cksfv SUBDIR += clamav SUBDIR += clamav-devel + SUBDIR += clamsmtp SUBDIR += cmd5checkpw SUBDIR += cops SUBDIR += cp2fwb diff --git a/security/clamsmtp/Makefile b/security/clamsmtp/Makefile new file mode 100644 index 0000000..ede8f28 --- /dev/null +++ b/security/clamsmtp/Makefile @@ -0,0 +1,43 @@ +# New ports collection makefile for: clamsmtp +# Date created: 2004-07-29 +# Whom: Cheng-Lung Sung +# +# $FreeBSD$ +# + +PORTNAME= clamsmtp +PORTVERSION= 0.4 +CATEGORIES= security +MASTER_SITES= http://memberwebs.com/nielsen/software/clamsmtp/ + +MAINTAINER= clsung@dragon2.net +COMMENT= An ClamAV anti-virus SMTP Filter + +RUN_DEPENDS= clamd:${PORTSDIR}/security/clamav + +HAS_CONFIGURE= yes +USE_GMAKE= yes +USE_REINPLACE= yes +USE_RC_SUBR= yes +RC_SCRIPTS_SUB= PREFIX=${PREFIX} RC_SUBR=${RC_SUBR} CLAMAV_USER=${CLAMAV_USER} \ + CLAMAV_PID_DIR=${CLAMAV_PID_DIR} CLAMAV_GROUP=${CLAMAV_GROUP} \ + CLAMAV_CLAMD_SOCKET=${CLAMAV_CLAMD_SOCKET} +STARTUP_FILE= ${PREFIX}/etc/rc.d/clamsmtpd.sh + +CLAMAV_USER?= clamav +CLAMAV_GROUP?= clamav +CLAMAV_PID_DIR?= /var/run/clamav +CLAMAV_CLAMD_SOCKET?= /var/run/clamav/clamd + +MAN8= clamsmtpd.8 + +post-patch: + @${REINPLACE_CMD} -e 's,10025,10026,g' ${WRKSRC}/src/clamsmtpd.c ${WRKSRC}/src/clamsmtpd.8 + +post-install: + @${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \ + ${FILESDIR}/clamsmtpd.sh.tmpl > ${STARTUP_FILE} + @${CHMOD} 755 ${STARTUP_FILE} + @${CAT} ${PKGMESSAGE} + +.include diff --git a/security/clamsmtp/distinfo b/security/clamsmtp/distinfo new file mode 100644 index 0000000..8da9a8a --- /dev/null +++ b/security/clamsmtp/distinfo @@ -0,0 +1,2 @@ +MD5 (clamsmtp-0.4.tar.gz) = 08b62494096f66d854eaab9df646e9c3 +SIZE (clamsmtp-0.4.tar.gz) = 119005 diff --git a/security/clamsmtp/files/clamsmtpd.sh.tmpl b/security/clamsmtp/files/clamsmtpd.sh.tmpl new file mode 100644 index 0000000..3f0c146 --- /dev/null +++ b/security/clamsmtp/files/clamsmtpd.sh.tmpl @@ -0,0 +1,36 @@ +#!/bin/sh +# +# $FreeBSD$ +# +# PROVIDE: clamsmtpd +# REQUIRE: DAEMON +# KEYWORD: FreeBSD +# +# Add the fellowing line to /etc/rc.conf to enable clamsmtpd: +# +# clamsmtpd_enable="YES" +# + +. %%RC_SUBR%% + +name=clamsmtpd +rcvar=`set_rcvar` + +command=%%PREFIX%%/sbin/${name} +sig_stop=-KILL + +load_rc_config ${name} + +clamsmtpd_enable=${clamsmtpd_enable-"NO"} +clamsmtpd_smtp=${clamsmtpd_smtp-"mysmtp.com:25"} +clamsmtpd_pid=${clamsmtpd_pid-"%%CLAMAV_PID_DIR%%/clamsmtpd.pid"} +clamsmtpd_socket=${clamsmtpd_socket-"%%CLAMAV_CLAMD_SOCKET%%"} +clamsmtpd_user=${clamsmtpd_user-"%%CLAMAV_USER%%"} +clamsmtpd_group=${clamsmtpd_group-"%%CLAMAV_GROUP%%"} +clamsmtpd_tmpdir=${clamsmtpd_tmpdir-"/var/tmp"} + +command_args="-c ${clamsmtpd_socket} -D ${clamsmtpd_tmpdir} -p ${clamsmtpd_pid} ${clamsmtpd_smtp}" + +pidfile=${clamsmtpd_pid} + +run_rc_command "$1" diff --git a/security/clamsmtp/pkg-descr b/security/clamsmtp/pkg-descr new file mode 100644 index 0000000..ab6aea2 --- /dev/null +++ b/security/clamsmtp/pkg-descr @@ -0,0 +1,12 @@ +ClamSMTP is an SMTP filter that allows you to check for viruses using +the ClamAV anti-virus software. It accepts SMTP connections and forwards +the SMTP commands and responses to another SMTP server. The 'DATA' email +body is intercepted and scanned before forwarding. + +ClamSMTP aims to be lightweight, reliable, and simple rather than have a +myriad of options. It's written in C without major dependencies. If you +need more options then you could use something big like AMaViS which is +written in PERL and can do almost anything. + +Author: Nielsen +WWW: http://memberwebs.com/nielsen/software/clamsmtp/ diff --git a/security/clamsmtp/pkg-message b/security/clamsmtp/pkg-message new file mode 100644 index 0000000..94e0853 --- /dev/null +++ b/security/clamsmtp/pkg-message @@ -0,0 +1,17 @@ +Remember to modify /etc/rc.conf, change entry + +clamsmtpd_smtp="mysmtp.com:25" + +to your smtp server setting, and set + +clamsmtpd_enable="YES" + +to enable clamsmtpd. + +To work with postfix, put following lines in Postfix' main.cf: + +content_filter = scan:127.0.0.1:10026 +receive_override_options = no_address_mappings + +And modify master.cf to active it. See also +http://memberwebs.com/nielsen/software/clamsmtp/postfix.html diff --git a/security/clamsmtp/pkg-plist b/security/clamsmtp/pkg-plist new file mode 100644 index 0000000..fc0f503 --- /dev/null +++ b/security/clamsmtp/pkg-plist @@ -0,0 +1,4 @@ +@comment $FreeBSD$ +@unexec [ ! -f %%CLAMAV_PID_DIR%%/clamsmtpd.pid ] || %%PREFIX%%/etc/rc.d/clamsmtpd.sh stop || true +sbin/clamsmtpd +etc/rc.d/clamsmtpd.sh -- cgit v1.1