From blaz@medinet.si  Wed Aug 11 15:44:53 2004
Return-Path: <blaz@medinet.si>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 5D36416A4CF
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 11 Aug 2004 15:44:53 +0000 (GMT)
Received: from out-1.mail.amis.net (out-1.mail.amis.net [212.18.32.4])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 2266643D39
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 11 Aug 2004 15:44:52 +0000 (GMT)
	(envelope-from blaz@medinet.si)
Received: from localhost (in-3.mail.amis.net [212.18.32.22])
	by out-1.mail.amis.net (Postfix) with ESMTP id D113F5B43D3
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 11 Aug 2004 17:44:50 +0200 (CEST)
Received: from in-3.mail.amis.net ([127.0.0.1])
 by localhost (in-3.mail.amis.net [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 63015-03 for <FreeBSD-gnats-submit@freebsd.org>;
 Wed, 11 Aug 2004 17:44:45 +0200 (CEST)
Received: from piranha.amis.net (piranha.amis.net [212.18.32.3])
	by in-3.mail.amis.net (Postfix) with ESMTP id 4EA63FB992
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 11 Aug 2004 17:44:45 +0200 (CEST)
Received: from titanic.medinet.si (titanic.medinet.si [212.18.42.5])
	by piranha.amis.net (Postfix) with ESMTP id 3A1EFFDFD
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 11 Aug 2004 17:44:45 +0200 (CEST)
Received: by titanic.medinet.si (Postfix, from userid 1000)
	id 238125547B; Wed, 11 Aug 2004 17:44:45 +0200 (CEST)
Message-Id: <20040811154445.238125547B@titanic.medinet.si>
Date: Wed, 11 Aug 2004 17:44:45 +0200 (CEST)
From: Blaz Zupan <blaz@medinet.si>
Reply-To: Blaz Zupan <blaz@medinet.si>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: MAINTAINER UPDATE: amavisd-new port update 
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         70306
>Category:       ports
>Synopsis:       MAINTAINER UPDATE: amavisd-new port update
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Wed Aug 11 15:50:31 GMT 2004
>Closed-Date:    Wed Aug 11 22:46:23 GMT 2004
>Last-Modified:  Wed Aug 11 22:46:23 GMT 2004
>Originator:     Blaz Zupan
>Release:        FreeBSD 4.10-RELEASE i386
>Organization:
>Environment:
System: FreeBSD titanic.medinet.si 4.10-RELEASE FreeBSD 4.10-RELEASE #1: Sun Jun 27 16:39:26 CEST 2004 root@bigbrother.amis.net:/usr/obj/usr/src/sys/TITANIC i386


	
>Description:
Attached patch contains the following fixes:

- Don't pretend we support anything older than perl 5.8.2. Support for
  5.00503 was severly broken and amavisd-new author officially only supports
  5.8.2 and up. As an added bonus, this simplifies the makefile very much.
- Install a usable amavisd.conf if none exists
- On installation, remove amavisd.conf if it is equal to default one
- On installation, create /var/amavis/tmp, because the new amavisd.conf
  uses this directory to store temporary files
- Remove address extension options from the example configuration file.
  Neither sendmail nor postfix support address extensions on FreeBSD
  by default.

>How-To-Repeat:
	
>Fix:

diff -urN amavisd-new.orig/Makefile amavisd-new/Makefile
--- amavisd-new.orig/Makefile	Sun Jul 18 12:05:50 2004
+++ amavisd-new/Makefile	Wed Aug 11 16:36:17 2004
@@ -8,6 +8,7 @@
 
 PORTNAME=	amavisd-new
 PORTVERSION=	20040701
+PORTREVISION=	1
 CATEGORIES=	security
 MASTER_SITES=	http://www.ijs.si/software/amavisd/ \
 		http://mirrors.catpipe.net/amavisd-new/ \
@@ -94,19 +95,11 @@
 .endif
 
 pre-build:
-.if ${PERL_LEVEL} < 500802
-# add warning to greeting message when running perl older than 5.8.2
-	${SED} -e 's,%%PERLVERSION%%,${PERL_VERSION},g' < ${FILESDIR}/perlwarning.tmpl > ${WRKDIR}/MESSAGE
-.endif
-.if ${PERL_LEVEL} < 500600
-# remove taint checks when running under perl 5.00503
-	${SED} -e 's,^\#\!/usr/bin/perl -T,\#\!/usr/bin/perl,' < ${WRKSRC}/amavisd > ${WRKDIR}/amavisd
-.endif
 	for f in amavisd.sh amavis-milter.sh INSTALL DEINSTALL MESSAGE; do \
-		${SED} ${SED_SCRIPT} < ${FILESDIR}/$${f}.tmpl >> ${WRKDIR}/$${f}; \
+		${SED} ${SED_SCRIPT} < ${FILESDIR}/$${f}.tmpl > ${WRKDIR}/$${f}; \
 	done
 	for f in amavisd.conf amavisd.conf-sample amavisd; do \
-		${SED} ${SED_SCRIPT} < ${WRKSRC}/$${f} >> ${WRKDIR}/$${f}; \
+		${SED} ${SED_SCRIPT} < ${WRKSRC}/$${f} > ${WRKDIR}/$${f}; \
 	done
 
 pre-install:
@@ -120,6 +113,9 @@
 .endif
 	${INSTALL_SCRIPT} ${WRKDIR}/amavisd ${PREFIX}/sbin
 	${INSTALL_SCRIPT} ${WRKDIR}/amavisd.conf ${PREFIX}/etc/amavisd.conf-dist
+.if !exists(${PREFIX}/etc/amavisd.conf)
+	${INSTALL_SCRIPT} ${WRKDIR}/amavisd.conf ${PREFIX}/etc
+.endif
 	${INSTALL_SCRIPT} ${WRKDIR}/amavisd.conf-sample ${PREFIX}/etc/amavisd.conf-sample
 	${INSTALL_SCRIPT} ${WRKSRC}/amavisd.conf-default ${PREFIX}/etc/amavisd.conf-default
 	${INSTALL_SCRIPT} ${WRKDIR}/amavisd.sh ${PREFIX}/etc/rc.d
@@ -133,13 +129,8 @@
 	@${CAT} ${PKGMESSAGE}
 .endif
 
-.if ${PERL_LEVEL} < 500800
-RUN_DEPENDS+=	${SITE_PERL}/${PERL_ARCH}/Digest/MD5.pm:${PORTSDIR}/security/p5-Digest-MD5 \
-		${SITE_PERL}/${PERL_ARCH}/Time/HiRes.pm:${PORTSDIR}/devel/p5-Time-HiRes
-.endif
-
-.if ${PERL_LEVEL} < 500600
-RUN_DEPENDS+=	${SITE_PERL}/${PERL_ARCH}/IO/Socket/UNIX.pm:${PORTSDIR}/devel/p5-IO
+.if ${PERL_LEVEL} < 500802
+IGNORE=         "requires perl 5.8.2 or higher"
 .endif
 
 .include <bsd.port.post.mk>
diff -urN amavisd-new.orig/files/INSTALL.tmpl amavisd-new/files/INSTALL.tmpl
--- amavisd-new.orig/files/INSTALL.tmpl	Sun Jul 18 12:05:50 2004
+++ amavisd-new/files/INSTALL.tmpl	Wed Aug 11 16:18:48 2004
@@ -43,6 +43,8 @@
     echo "Created \"${DIR}\" directory."
     /usr/bin/install -o ${USER} -g ${GROUP} -m 750 -d ${DIR}/db
     echo "Created \"${DIR}/db\" directory."
+    /usr/bin/install -o ${USER} -g ${GROUP} -m 750 -d ${DIR}/tmp
+    echo "Created \"${DIR}/tmp\" directory."
     /usr/bin/install -o ${USER} -g ${GROUP} -m 750 -d ${QUARANTINE}
     echo "Created \"${QUARANTINE}\" directory."    
 fi
diff -urN amavisd-new.orig/files/MESSAGE.tmpl amavisd-new/files/MESSAGE.tmpl
--- amavisd-new.orig/files/MESSAGE.tmpl	Sun Jul 18 12:05:50 2004
+++ amavisd-new/files/MESSAGE.tmpl	Wed Aug 11 16:37:52 2004
@@ -20,7 +20,6 @@
 
  Configuration templates are available in %%PREFIX%%/etc
  as amavisd.conf-dist, amavisd.conf-sample and amavisd.conf-default.
- Copy any of them to amavisd.conf and edit the file to suit your
- needs. Documentation is available in %%DOCSDIR%%.
+ Documentation is available in %%DOCSDIR%%.
 *******************************************************************
 
diff -urN amavisd-new.orig/files/patch-amavisd.conf amavisd-new/files/patch-amavisd.conf
--- amavisd-new.orig/files/patch-amavisd.conf	Sun Jul 18 12:05:50 2004
+++ amavisd-new/files/patch-amavisd.conf	Wed Aug 11 16:23:37 2004
@@ -1,5 +1,5 @@
 --- amavisd.conf.orig	Thu Jul  1 22:04:36 2004
-+++ amavisd.conf	Sun Jul  4 11:32:17 2004
++++ amavisd.conf	Wed Aug 11 16:23:13 2004
 @@ -9,7 +9,7 @@
  # MUST BE SET (no useful default):
  
@@ -29,3 +29,18 @@
  # $daemon_chroot_dir = $MYHOME;  # (default is undef, meaning: do not chroot)
  
  $inet_socket_port = 10024;   # accept SMTP on this local TCP port(s) (Postfix)
+@@ -50,10 +50,10 @@
+ $mailfrom_notify_admin     = "virusalert\@$mydomain";
+ $mailfrom_notify_recip     = "virusalert\@$mydomain";
+ $mailfrom_notify_spamadmin = "spam.police\@$mydomain";
+-@addr_extension_virus_maps      = ('virus');
+-@addr_extension_spam_maps       = ('spam');
+-@addr_extension_banned_maps     = ('banned');
+-@addr_extension_bad_header_maps = ('badh');
++#@addr_extension_virus_maps      = ('virus');
++#@addr_extension_spam_maps       = ('spam');
++#@addr_extension_banned_maps     = ('banned');
++#@addr_extension_bad_header_maps = ('badh');
+ 
+ $path = '/usr/local/sbin:/usr/local/bin:/usr/sbin:/sbin:/usr/bin:/bin';
+ $file   = 'file';   # file(1) utility; use 3.41 or later to avoid vulnerability
diff -urN amavisd-new.orig/files/perlwarning.tmpl amavisd-new/files/perlwarning.tmpl
--- amavisd-new.orig/files/perlwarning.tmpl	Sun Jul 18 12:05:50 2004
+++ amavisd-new/files/perlwarning.tmpl	Thu Jan  1 01:00:00 1970
@@ -1,10 +0,0 @@
-
-*******************************************************************
- WARNING: You appear to be running perl version %%PERLVERSION%%.
-
- amavisd-new has been tested and is guaranteed to run only with
- perl 5.8.2 and above. There are numerous problems with amavisd-new
- when running under previous perl versions, including perl crashes,
- taint bugs and others.  You are strongly advised to upgrade your
- perl by using the /usr/ports/lang/perl5.8 port.
-*******************************************************************
diff -urN amavisd-new.orig/pkg-plist amavisd-new/pkg-plist
--- amavisd-new.orig/pkg-plist	Sun Jul 18 12:05:50 2004
+++ amavisd-new/pkg-plist	Wed Aug 11 16:31:31 2004
@@ -23,7 +23,9 @@
 %%PORTDOCS%%%%DOCSDIR%%/RELEASE_NOTES
 %%PORTDOCS%%@dirrm %%DOCSDIR%%
 etc/amavisd.conf-default
+@unexec if cmp -s %D/etc/amavisd.conf %D/etc/amavisd.conf-dist; then rm -f %D/etc/amavisd.conf; fi
 etc/amavisd.conf-dist
+@exec [ ! -f %B/amavisd.conf ] && cp %B/%f %B/amavisd.conf
 etc/amavisd.conf-sample
 %%AMAVIS_NOMILTER%%etc/rc.d/amavis-milter.sh
 etc/rc.d/amavisd.sh
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: sem 
State-Changed-When: Wed Aug 11 22:46:15 GMT 2004 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=70306 
>Unformatted:
