1) Update security/amavisd-new to amavisd-new-20030616-p6.

2) Incorporate changes from PR 57382:
   - add rc.subr support
   - cleanup sed variable replacement scripts
   - add pointer to Clam Antivirus to installation message
  PR 57382 was closed by mistake, I thought the contents
  have already been commited, while they were not.

PR:		59323
Submitted by:	milter@free.fr (1)
Submitted by:	Martin Matuska <martin@tradex.sk> (2)
Approved by:	MAINTAINER
This commit is contained in:
James E. Housley 2003-11-20 11:00:19 +00:00
parent bc92812ab5
commit b5f8865812
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=94452
10 changed files with 114 additions and 83 deletions

View file

@ -7,7 +7,7 @@
# Based on amavisd ports makefile.
PORTNAME= amavisd-new
PORTVERSION= 20030616.p5
PORTVERSION= 20030616.p6
CATEGORIES= security
MASTER_SITES= http://www.ijs.si/software/amavisd/
DISTNAME= ${PORTNAME}-${PORTVERSION:S/.p/-p/}
@ -35,6 +35,7 @@ RUN_DEPENDS= ${SITE_PERL}/${PERL_ARCH}/Time/HiRes.pm:${PORTSDIR}/devel/p5-Time-H
${LOCALBASE}/bin/zoo:${PORTSDIR}/archivers/zoo
USE_PERL5_RUN= yes
USE_RC_SUBR= yes
PKGINSTALL= ${WRKDIR}/INSTALL
PKGDEINSTALL= ${WRKDIR}/DEINSTALL
@ -63,23 +64,20 @@ CONFIGURE_WRKSRC= ${WRKSRC}/helper-progs
BUILD_WRKSRC= ${WRKSRC}/helper-progs
.endif
SED_SCRIPT= -e 's,%%AMAVISUSER%%,${AMAVISUSER},g' \
-e 's,%%AMAVISGROUP%%,${AMAVISGROUP},g' \
-e 's,%%AMAVISDIR%%,${AMAVISDIR},g' \
-e 's,%%AMAVISQUARANTINE%%,${AMAVISQUARANTINE},g' \
-e 's,%%DOCSDIR%%,${DOCSDIR},g' \
-e 's,%%PREFIX%%,${PREFIX},g' \
-e 's,%%RC_SUBR%%,${RC_SUBR},g'
pre-build:
for file in amavisd.sh INSTALL DEINSTALL MESSAGE; do \
${SED} -e 's,%%AMAVISUSER%%,${AMAVISUSER},g' \
-e 's,%%AMAVISGROUP%%,${AMAVISGROUP},g' \
-e 's,%%AMAVISDIR%%,${AMAVISDIR},g' \
-e 's,%%AMAVISQUARANTINE%%,${AMAVISQUARANTINE},g' \
-e 's,%%DOCSDIR%%,${DOCSDIR},g' \
-e 's,%%PREFIX%%,${PREFIX},g' \
< ${FILESDIR}/$${file}.tmpl > ${WRKDIR}/$${file}; \
for file in amavisd.sh amavis-milter.sh INSTALL DEINSTALL MESSAGE; do \
${SED} ${SED_SCRIPT} < ${FILESDIR}/$${file}.tmpl > ${WRKDIR}/$${file}; \
done
for file in amavisd.conf amavisd; do \
${SED} -e 's,%%AMAVISUSER%%,${AMAVISUSER},g' \
-e 's,%%AMAVISGROUP%%,${AMAVISGROUP},g' \
-e 's,%%AMAVISDIR%%,${AMAVISDIR},g' \
-e 's,%%AMAVISQUARANTINE%%,${AMAVISQUARANTINE},g' \
-e 's,%%PREFIX%%,${PREFIX},g' \
< ${WRKSRC}/$${file} > ${WRKDIR}/$${file}; \
${SED} ${SED_SCRIPT} < ${WRKSRC}/$${file} > ${WRKDIR}/$${file}; \
done
pre-install:
@ -89,6 +87,7 @@ do-install:
.if !defined(AMAVIS_NOMILTER)
${INSTALL_PROGRAM} ${WRKSRC}/helper-progs/amavis ${PREFIX}/sbin
${INSTALL_PROGRAM} ${WRKSRC}/helper-progs/amavis-milter ${PREFIX}/sbin
${INSTALL_SCRIPT} ${WRKDIR}/amavis-milter.sh ${PREFIX}/etc/rc.d
.endif
${INSTALL_SCRIPT} ${WRKDIR}/amavisd ${PREFIX}/sbin
${INSTALL_SCRIPT} ${WRKDIR}/amavisd.conf ${PREFIX}/etc/amavisd.conf-dist

View file

@ -1 +1 @@
MD5 (amavisd-new-20030616-p5.tar.gz) = 13c76432e957ccd302856f64526483a2
MD5 (amavisd-new-20030616-p6.tar.gz) = a611af8b952707977b9851dc8fc81640

View file

@ -2,10 +2,17 @@
*******************************************************************
To use amavisd-new, you need to install at least one virus scanner.
For example McAfee VirusScan is available as a FreeBSD port
in /usr/ports/security/vscan. If you want to use the amavis sendmail
milter interface, you need to type the following command:
in /usr/ports/security/vscan and Clam Antivirus is available
in /usr/ports/security/clamav.
touch %%AMAVISDIR%%/use.milter
Enable amavisd-new in /etc/rc.conf with the following line:
amavisd_enable="YES"
If you want to use the amavis sendmail milter interface,
you need the following additional line in /etc/rc.conf
amavis_milter_enable="YES"
A configuration template is available in %%PREFIX%%/etc
as amavisd.conf-dist. Copy it to amavisd.conf and edit it to

View file

@ -0,0 +1,34 @@
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: amavis_milter
# REQUIRE: amavisd
# BEFORE: amavisd
# KEYWORD: FreeBSD shutdown
#
# Add the following lines to /etc/rc.conf to enable amavis-milter:
#
#amavis_milter_enable="YES"
#
. %%RC_SUBR%%
name=amavis_milter
rcvar=`set_rcvar`
command=%%PREFIX%%/sbin/amavis-milter
amavis_milter_user=%%AMAVISUSER%%
required_files=%%PREFIX%%/etc/amavisd.conf
# set defaults
amavis_milter_enable=${amavis_milter_enable:-"NO"}
amavis_milter_flags=${amavis_milter_flags:-"-D -p %%AMAVISDIR%%/amavis-milter.sock"}
load_rc_config $name
run_rc_command "$1"

View file

@ -1,36 +1,42 @@
#!/bin/sh
#
# $FreeBSD: /tmp/pcvs/ports/security/amavisd-new/files/Attic/amavisd.sh.tmpl,v 1.6 2003-11-20 11:00:19 jeh Exp $
#
if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
echo "$0: Cannot determine the PREFIX" >&2
exit 1
fi
# PROVIDE: amavisd
# REQUIRE: LOGIN
# BEFORE: mail
# KEYWORD: FreeBSD shutdown
DIR=%%AMAVISDIR%%
PIDFILE=$DIR/amavisd.pid
SOCKFILES=$DIR/amavis*.sock
MILTERFLAG=$DIR/use.milter
#
# Add the following lines to /etc/rc.conf to enable amavisd:
#
#amavisd_enable="YES"
#
case "$1" in
start)
if [ -e ${PREFIX}/etc/amavisd.conf ]; then
rm -rf ${SOCKFILES}
if [ -e $MILTERFLAG ]; then
su %%AMAVISUSER%% -c "${PREFIX}/sbin/amavis-milter -D -p $DIR/amavis-milter.sock"
fi
su %%AMAVISUSER%% -c "${PREFIX}/sbin/amavisd > /dev/null 2>&1" && echo -n ' amavisd'
fi
;;
stop)
if [ -e $MILTERFLAG ]; then
killall -u %%AMAVISUSER%% amavis-milter >/dev/null 2>&1
fi
if [ -e $PIDFILE ]; then
su %%AMAVISUSER%% -c "kill `cat $PIDFILE`" && echo -n ' amavisd'
fi
;;
*)
echo "Usage: `basename $0` {start|stop}" >&2
;;
esac
. %%RC_SUBR%%
exit 0
name=amavisd
rcvar=`set_rcvar`
command=%%PREFIX%%/sbin/amavisd > /dev/null 2>&1
amavisd_user=%%AMAVISUSER%%
pidfile=%%AMAVISDIR%%/amavisd.pid
required_files=%%PREFIX%%/etc/amavisd.conf
stop_postcmd=stop_postcmd
stop_postcmd()
{
rm -f $pidfile
}
# set defaults
amavisd_enable=${amavisd_enable:-"NO"}
amavisd_flags=${amavisd_flags:-""}
load_rc_config $name
run_rc_command "$1"

View file

@ -1,15 +1,6 @@
--- amavisd.orig Mon Aug 25 18:07:56 2003
+++ amavisd Mon Aug 25 20:47:40 2003
@@ -3903,7 +3903,7 @@
/^\.lzo$/ && defined $lzop
&& return do_uncompress($part,$tempdir,"$lzop -d -c");
/^\.cpio$/ && defined $cpio && return do_cpio($part,$tempdir);
-# /^\.tar$/ && defined $cpio && return do_cpio($part,$tempdir);
+ /^\.tar$/ && defined $cpio && return do_cpio($part,$tempdir);
/^\.tar$/ && return do_tar($part,$tempdir); # fallback
/^\.zip$/ && return do_unzip($part,0,$tempdir);
/^\.rar$/ && return do_unrar($part,0,$tempdir);
@@ -6260,7 +6260,7 @@
--- amavisd.orig Mon Nov 10 01:22:13 2003
+++ amavisd Tue Nov 11 22:42:47 2003
@@ -6279,7 +6279,7 @@
my($amavisd_path) = find_program_path($0, [split(/:/, $path, -1)], 0);
$amavisd_path = $1 if $amavisd_path=~m{^([A-Za-z0-9/._=+-]+)$(?!\n)}; # untaint

View file

@ -1,5 +1,5 @@
--- amavisd.conf.orig Wed Jun 25 17:22:46 2003
+++ amavisd.conf Wed Jun 25 17:26:42 2003
--- amavisd.conf.orig Mon Nov 10 00:07:53 2003
+++ amavisd.conf Tue Nov 11 22:48:05 2003
@@ -51,7 +51,7 @@
# $MYHOME serves as a quick default for some other configuration settings.
# More refined control is available with each individual setting further down.
@ -12,7 +12,7 @@
@@ -60,8 +60,8 @@
# Set the user and group to which the daemon will change if started as root
# (otherwise just keep the UID unchanged, and these settings have no effect):
# (otherwise just keeps the UID unchanged, and these settings have no effect):
-$daemon_user = 'vscan'; # (no default; customary: vscan or amavis)
-$daemon_group = 'sweep'; # (no default; customary: vscan or amavis)
+$daemon_user = '%%AMAVISUSER%%'; # (no default; customary: vscan or amavis)
@ -20,16 +20,16 @@
# Runtime working directory (cwd), and a place where
# temporary directories for unpacking mail are created.
@@ -271,7 +271,7 @@
@@ -274,7 +274,7 @@
# 3: server, client
# 4: decompose parts
# 5: more debug details
-$log_level = 2; # (defaults to 0)
+$log_level = 0; # (defaults to 0)
# Customizeable template for the most interesting log file entry (e.g. with
# Customizable template for the most interesting log file entry (e.g. with
# $log_level=0) (take care to properly quote Perl special characters like '\')
@@ -496,7 +496,7 @@
@@ -510,7 +510,7 @@
# or a directory (no trailing slash)
# (the default value is undef, meaning no quarantine)
#

View file

@ -1,15 +1,15 @@
--- helper-progs/config.h.in.orig Fri Mar 7 22:56:50 2003
+++ helper-progs/config.h.in Sat Mar 15 16:15:40 2003
+++ helper-progs/config.h.in Tue Nov 11 22:54:33 2003
@@ -14,10 +14,10 @@
#define X_HEADER_LINE "by-amavisd-new-via-milter"
/* Define if you have the mkdtemp function, undefine otherwise */
-#undef HAVE_MKDTEMP
+#define HAVE_MKDTEMP
/* Define if you have the mktemp function, undefine otherwise */
-#define HAVE_MKTEMP
+#undef HAVE_MKTEMP
/* Define if we have the snprintf function, undefine otherwise */
#undef HAVE_SNPRINTF

View file

@ -1,17 +1,9 @@
--- helper-progs/configure.orig Thu Dec 26 12:35:33 2002
+++ helper-progs/configure Sat Apr 19 10:54:31 2003
@@ -2041,20 +2041,3 @@
--- helper-progs/configure.orig Tue Nov 11 22:59:24 2003
+++ helper-progs/configure Tue Nov 11 23:01:31 2003
@@ -2040,12 +2040,3 @@
-if test "$AMAVISUSER" != "" ; then
- id $AMAVISUSER > /dev/null 2>&1
- if test "$?" != 0 ; then
- echo ""
- echo "Note: The Amavis user '$AMAVISUSER' does not seem to"
- echo "exist. Please create this user before continuing."
- fi
-fi
-
-if test "$SENDMAILPROG" != "no" ; then
- sendmailversion=`$SENDMAILPROG -bv -d0.1 | $AWK '/Version/ {print $2}'`

View file

@ -14,11 +14,13 @@
%%PORTDOCS%%%%DOCSDIR%%/README.performance
%%PORTDOCS%%%%DOCSDIR%%/README.policy-on-notifications
%%PORTDOCS%%%%DOCSDIR%%/README.postfix
%%PORTDOCS%%%%DOCSDIR%%/README.protocol
%%PORTDOCS%%%%DOCSDIR%%/README.sendmail
%%PORTDOCS%%%%DOCSDIR%%/README.sendmail-dual
%%PORTDOCS%%%%DOCSDIR%%/RELEASE_NOTES
%%PORTDOCS%%@dirrm %%DOCSDIR%%
etc/amavisd.conf-dist
%%AMAVIS_NOMILTER%%etc/rc.d/amavis-milter.sh
etc/rc.d/amavisd.sh
%%AMAVIS_NOMILTER%%sbin/amavis
%%AMAVIS_NOMILTER%%sbin/amavis-milter