Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Apr 2002 01:39:09 +0800 (CST)
From:      Yen-Ming Lee <leeym@utopia.leeym.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/37386: update port: security/amavis-perl
Message-ID:  <20020423173909.9880C3EAB9D@utopia.leeym.com>

next in thread | raw e-mail | index | archive | help

>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 <bsd.port.mk>
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 <leeym@leeym.com> 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 <leeym@leeym.com> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020423173909.9880C3EAB9D>