From owner-freebsd-ports Tue Apr 23 10:40:54 2002 Delivered-To: freebsd-ports@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id CC56037B41B for ; Tue, 23 Apr 2002 10:40:01 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g3NHe1x35270; Tue, 23 Apr 2002 10:40:01 -0700 (PDT) (envelope-from gnats) Received: from utopia.leeym.com (utopia.leeym.com [61.218.64.93]) by hub.freebsd.org (Postfix) with ESMTP id 0BF8237B416 for ; Tue, 23 Apr 2002 10:39:19 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by utopia.leeym.com (Postfix) with ESMTP id AF0E83EAB9E for ; Wed, 24 Apr 2002 01:39:15 +0800 (CST) Received: by utopia.leeym.com (Postfix, from userid 1000) id 9880C3EAB9D; Wed, 24 Apr 2002 01:39:09 +0800 (CST) Message-Id: <20020423173909.9880C3EAB9D@utopia.leeym.com> Date: Wed, 24 Apr 2002 01:39:09 +0800 (CST) From: Yen-Ming Lee Reply-To: Yen-Ming Lee To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: ports/37386: update port: security/amavis-perl Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 37386 >Category: ports >Synopsis: update port: security/amavis-perl >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Tue Apr 23 10:40:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Yen-Ming Lee >Release: FreeBSD 4.5-STABLE i386 >Organization: >Environment: System: FreeBSD utopia.leeym.com 4.5-STABLE FreeBSD 4.5-STABLE #11: Sun Apr 21 05:20:51 CST 2002 root@utopia.leeym.com:/usr/obj/usr/src/sys/UTOPIA i386 >Description: make amavis-perl support postfix >How-To-Repeat: >Fix: --- amavis-perl.diff begins here --- diff -ruN --exclude CVS /usr/ports/security/amavis-perl/Makefile amavis-perl/Makefile --- /usr/ports/security/amavis-perl/Makefile Mon Oct 22 02:47:20 2001 +++ amavis-perl/Makefile Wed Apr 24 00:56:17 2002 @@ -50,6 +50,16 @@ RUN_DEPENDS= ${BUILD_DEPENDS} .endif +.if defined(WITH_POSTFIX) +MTA?= postfix +DIROWNER?= vscan:mail +CONFIGURE_ARGS+= --enable-postfix --enable-smtp \ + --with-amavis-user=postfix +BUILD_DEPENDS+= ${LOCALBASE}/sbin/postfix:${PORTSDIR}/mail/postfix \ + ${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/Net/SMTP.pm:${PORTSDIR}/net/p5-Net +RUN_DEPENDS= ${BUILD_DEPENDS} +.endif + .if !defined(MTA) MTA?= sendmail DIROWNER?= root:daemon @@ -71,9 +81,9 @@ .endif post-install: + @PKG_PREFIX=${PREFIX} ${PERL5} ${PKGINSTALL} _ POST-INSTALL @${CHOWN} ${DIROWNER} /var/log/amavis /var/spool/quarantine @${CHMOD} 0755 /var/log/amavis /var/spool/quarantine - @PKG_PREFIX=${PREFIX} ${PERL5} ${PKGINSTALL} _ POST-INSTALL @${CAT} ${PKGMESSAGE}.${MTA} .include diff -ruN --exclude CVS /usr/ports/security/amavis-perl/pkg-deinstall.postfix amavis-perl/pkg-deinstall.postfix --- /usr/ports/security/amavis-perl/pkg-deinstall.postfix Thu Jan 1 08:00:00 1970 +++ amavis-perl/pkg-deinstall.postfix Wed Apr 24 01:28:12 2002 @@ -0,0 +1,30 @@ +#!/bin/sh +# Yen-Ming Lee 20 April 2002 + +PATH="/bin:/usr/bin:/usr/sbin:${PKG_PREFIX}/sbin" +CFG=${PKG_PREFIX}/etc/postfix + +if [ "$2" != "POST-DEINSTALL" ]; then + exit 0 +fi +MAIN="${CFG}/main.cf"; +MASTER="${CFG}/master.cf"; +ALIASES=`grep ^alias_maps ${MAIN} | awk -F: '{print $NF}'`; + +echo "==> Removing amavis-perl component in ${MASTER}"; +egrep -v "vscan|amavis|localhost:10025" ${MASTER} > ${MASTER}.$$ +mv ${MASTER}.$$ ${MASTER} + +echo "==> Removing content_filter in ${MAIN}"; +grep -v ^content_filter ${MAIN} > ${MAIN}.$$ +mv ${MAIN}.$$ ${MAIN} + +echo "==> Removing alias for virusalert from ${ALIASES}"; +grep -v ^virusalert: ${ALIASES} > ${ALIASES}.$$ +mv ${ALIASES}.$$ ${ALIASES} +postalias ${ALIASES} + +echo "==> Removing user vcan"; +if pw usershow "vscan" 2>/dev/null 1>&2; then + pw userdel vscan +fi diff -ruN --exclude CVS /usr/ports/security/amavis-perl/pkg-install.postfix amavis-perl/pkg-install.postfix --- /usr/ports/security/amavis-perl/pkg-install.postfix Thu Jan 1 08:00:00 1970 +++ amavis-perl/pkg-install.postfix Wed Apr 24 01:27:44 2002 @@ -0,0 +1,50 @@ +#!/bin/sh +# Yen-Ming Lee 20 April 2002 + +PATH="/bin:/usr/bin:/usr/sbin:${PKG_PREFIX}/sbin" +CFG=${PKG_PREFIX}/etc/postfix + +if [ "$2" != "POST-INSTALL" ]; then + exit 0 +fi +MAIN="${CFG}/main.cf"; +MASTER="${CFG}/master.cf"; +ALIASES=`grep ^alias_maps ${MAIN} | awk -F: '{print $NF}'`; + +echo "===> Adding amavis-perl component to ${MASTER}" +egrep -v "vscan|amavis|localhost:10025" ${MASTER} > ${MASTER}.$$ +sed 's/^X//' >> ${MASTER}.$$ << END +Xvscan unix - n n - 10 pipe +X flags=R user=vscan:mail argv=${PKG_PREFIX}/sbin/amavis \$sender \$recipient +Xlocalhost:10025 inet n - n - - smtpd -o content_filter= +END +mv ${MASTER}.$$ ${MASTER} + +echo "===> Adding content_filter to ${MAIN}" +grep -v ^content_filter ${MAIN} > ${MAIN}.$$ +echo "content_filter = vscan" >> ${MAIN}.$$ +mv ${MAIN}.$$ ${MAIN} + +echo "===> Adding alias for virusalert to ${ALIASES}" +if [ ! -f ${ALIASES} ]; then + echo "Can't find aliases file, you have to add an alias for virusalert by yourself" +else + grep -q ^virusalert: ${ALIASES} + if [ $? != 0 ]; then + echo "virusalert: root" >> ${ALIASES} + postalias ${ALIASES} + fi +fi + +echo "===> Adding user vscan" +if ! pw usershow "vscan" 2>/dev/null 1>&2; then + if pw useradd vscan -g mail -h - \ + -s "/sbin/nologin" -d "/nonexistent" \ + -c "AMaViS-Perl"; \ + then + echo "Added user \"vscan\"." + else + echo "Adding user \"vscan\" failed..." + exit 1 + fi +fi diff -ruN --exclude CVS /usr/ports/security/amavis-perl/pkg-message.postfix amavis-perl/pkg-message.postfix --- /usr/ports/security/amavis-perl/pkg-message.postfix Thu Jan 1 08:00:00 1970 +++ amavis-perl/pkg-message.postfix Sat Apr 20 09:11:51 2002 @@ -0,0 +1,3 @@ + +Please read documentation on http://www.amavis.org/ before you start using it. + --- amavis-perl.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message