Date: Wed, 26 Sep 2001 02:30:47 +0200 (CEST) From: Martin Matuska <matuska@wu-wien.ac.at> To: FreeBSD-gnats-submit@freebsd.org Subject: ports/30824: security/amavis-perl port update Message-ID: <200109260030.f8Q0UlB73699@lexx.wu-wien.ac.at>
next in thread | raw e-mail | index | archive | help
>Number: 30824 >Category: ports >Synopsis: security/amavis-perl port update >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 Sep 25 17:30:02 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Charlie & >Release: FreeBSD 4.4-STABLE i386 >Organization: WU-WIEN >Environment: System: FreeBSD lexx.wu-wien.ac.at 4.4-STABLE FreeBSD 4.4-STABLE #0: Wed Sep 19 19:13:44 CEST 2001 root@lexx.wu-wien.ac.at:/usr/src/sys/compile/LEXX i386 i386 >Description: update of amavis-perl to ver. 11, this port has not been updated for over a year >How-To-Repeat: >Fix: # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # amavis-perl # amavis-perl/files # amavis-perl/files/patch-aa # amavis-perl/pkg-comment # amavis-perl/pkg-deinstall # amavis-perl/pkg-descr # amavis-perl/Makefile # amavis-perl/pkg-message # amavis-perl/pkg-plist # amavis-perl/pkg-install # amavis-perl/distinfo # echo c - amavis-perl mkdir -p amavis-perl > /dev/null 2>&1 echo c - amavis-perl/files mkdir -p amavis-perl/files > /dev/null 2>&1 echo x - amavis-perl/files/patch-aa sed 's/^X//' >amavis-perl/files/patch-aa << 'END-of-amavis-perl/files/patch-aa' X--- configure.orig Fri Apr 6 15:16:55 2001 X+++ configure Tue Sep 25 15:35:26 2001 X@@ -2875,7 +2875,7 @@ X if test ! -f "$sendmail_cf_orig" ; then X if test -f /etc/sendmail.cf ; then X sendmail_cf_orig=/etc/sendmail.orig.cf X- elif test -f /etc/mail/sendmail.orig.cf ; then X+ elif test -f /etc/mail/sendmail.cf ; then X sendmail_cf_orig=/etc/mail/sendmail.orig.cf X else X { echo "configure: error: END-of-amavis-perl/files/patch-aa echo x - amavis-perl/pkg-comment sed 's/^X//' >amavis-perl/pkg-comment << 'END-of-amavis-perl/pkg-comment' XMail Virus Scanner (uses external antivirus) END-of-amavis-perl/pkg-comment echo x - amavis-perl/pkg-deinstall sed 's/^X//' >amavis-perl/pkg-deinstall << 'END-of-amavis-perl/pkg-deinstall' X#!/bin/sh X# $FreeBSD: ports/security/amavis-perl/pkg-deinstall,v 1.1 2001/01/07 07:38:32 will Exp $ X Xprefix=/usr/local XPATH="/bin:/usr/bin" X Xif [ "$2" != "POST-DEINSTALL" ]; then X exit 0 Xfi X Xif [ -f /etc/sendmail.cf.pre-amavis ]; then X CFG=/etc Xelif [ -f /etc/mail/sendmail.cf.pre-amavis ]; then X CFG=/etc/mail Xelse X echo "No sendmail.cf.pre-amavis found, are you sure that amavis was installed?" X exit 1 Xfi X Xrm -f ${CFG}/sendmail.cf Xrm -f ${CFG}/sendmail.orig.cf Xmv ${CFG}/sendmail.cf.pre-amavis ${CFG}/sendmail.cf Xsed /^virusalert/d ${CFG}/aliases > ${CFG}/aliases.tmp Xmv ${CFG}/aliases.tmp ${CFG}/aliases Xnewaliases Xrmdir /var/spool/mqamavis 2>/dev/null || echo "You may wish to inspect /var/spool/mqamavis directory by yourself and remove it" Xrmdir /var/spool/quarantine 2>/dev/null || echo "You may wish to inspect /var/spool/quarantine directory by yourself and remove it" Xrmdir /var/amavis 2>/dev/null || echo "You may wish to inspect /var/amavis directory by yourself and remove it" Xexit 0 END-of-amavis-perl/pkg-deinstall echo x - amavis-perl/pkg-descr sed 's/^X//' >amavis-perl/pkg-descr << 'END-of-amavis-perl/pkg-descr' XImagine a heterogene network environment with both UN*X and DOS / Windows/ XMacintosh workstations. Now think of an UN*X server that serves Windows Xand/or Macintosh workstations via a POP3 service. Would it not be nice to Xensure attachments coming via email are scanned for viruses before they reach Xa system they are able to infect? Well - that is what this package is for. XIt resides on the server that handles your incoming mails. When a mail Xarrives, instead of being delivered via procmail directly, is parsed through Xa script that extracts all attachments from the mail, unpacks (if needed) Xand scans them using a professional virus scanner program. X XThis is a perl implementation of the mailscan. X XWWW: http://www.amavis.org/ X XRoman Shterenzon <roman@xpert.com> XMartin Matuska <matuska@wu-wien.ac.at> END-of-amavis-perl/pkg-descr echo x - amavis-perl/Makefile sed 's/^X//' >amavis-perl/Makefile << 'END-of-amavis-perl/Makefile' X# New ports collection makefile for: amavis X# Date Created: 26 Sep 2001 X# Whom: Martin Matuska <matuska@wu-wien.ac.at> X# X# $FreeBSD$ X# X XPORTNAME= amavis-perl XPORTVERSION= 11 XCATEGORIES= security XMASTER_SITES= http://www.amavis.org/dist/perl/ X XMAINTAINER= matuska@wu-wien.ac.at X XBUILD_DEPENDS= ${LOCALBASE}/bin/uvscan:${PORTSDIR}/security/vscan \ X ${LOCALBASE}/bin/lha:${PORTSDIR}/archivers/lha \ X ${LOCALBASE}/bin/unarj:${PORTSDIR}/archivers/unarj \ X ${LOCALBASE}/bin/unrar:${PORTSDIR}/archivers/unrar \ X ${LOCALBASE}/bin/unzip:${PORTSDIR}/archivers/unzip \ X ${LOCALBASE}/bin/zoo:${PORTSDIR}/archivers/zoo \ X ${LOCALBASE}/bin/arc:${PORTSDIR}/archivers/arc \ X ${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/IO/AtomicFile.pm:${PORTSDIR}/devel/p5-IO-stringy \ X ${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/${PERL_ARCH}/MIME/Base64.pm:${PORTSDIR}/converters/p5-MIME-Base64 \ X ${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/MIME/Body.pm:${PORTSDIR}/mail/p5-MIME-Tools \ X ${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/Mail/Address.pm:${PORTSDIR}/mail/p5-Mail-Tools \ X ${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/${PERL_ARCH}/Compress/Zlib.pm:${PORTSDIR}/archivers/p5-Compress-Zlib \ X ${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/${PERL_ARCH}/Convert/UUlib.pm:${PORTSDIR}/converters/p5-Convert-UUlib \ X ${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/Convert/TNEF.pm:${PORTSDIR}/converters/p5-Convert-TNEF \ X ${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/Archive/Tar.pm:${PORTSDIR}/archivers/p5-Archive-Tar \ X ${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/Archive/Zip.pm:${PORTSDIR}/archivers/p5-Archive-Zip \ X ${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/${PERL_ARCH}/Unix/Syslog.pm:${PORTSDIR}/sysutils/p5-Unix-Syslog X.if !exists(/usr/bin/bzip2) XBUILD_DEPENDS+= bunzip2:${PORTSDIR}/archivers/bzip2 X.endif XRUN_DEPENDS= ${BUILD_DEPENDS} X X.include <bsd.port.pre.mk> X Xpre-fetch: X.if !defined(WARN_RECIPIENT) X @${ECHO} "" X @${ECHO} "Define WARN_RECIPIENT to warn infected e-mail" X @${ECHO} "recipients in addition to senders and administrator" X @${ECHO} "" X.endif X XGNU_CONFIGURE= yes XCONFIGURE_ARGS+= --disable-qmail --disable-postfix --disable-exim --enable-sendmail --with-virusdir=/var/spool/quarantine --enable-relay --prefix=${PREFIX} --with-amavisuser=root --enable-syslog --enable-relay X X.if defined(WARN_RECIPIENT) XCONFIGURE_ARGS+= --with-warnrecip=yes X.endif X Xdo-install: X ${INSTALL_SCRIPT} ${WRKSRC}/amavis/amavis ${PREFIX}/sbin X.if !defined(NOPORTDOCS) X ${MKDIR} ${PREFIX}/share/doc/amavis X.for i in AUTHORS BUGS COPYING ChangeLog FAQ HINTS INSTALL NEWS README README.exim README.milter README.postfix README.qmail README.scanners README.sendmail TODO doc/amavis.txt doc/amavis.m4 X ${INSTALL_DATA} ${WRKSRC}/${i} ${PREFIX}/share/doc/amavis X.endfor X.endif X Xpost-install: X @PKG_PREFIX=${PREFIX} ${PERL5} ${PKGINSTALL} _ POST-INSTALL X @${CAT} ${PKGMESSAGE} X X.include <bsd.port.post.mk> X END-of-amavis-perl/Makefile echo x - amavis-perl/pkg-message sed 's/^X//' >amavis-perl/pkg-message << 'END-of-amavis-perl/pkg-message' X XPlease read documentation on http://www.amavis.org/ before you start using it. X END-of-amavis-perl/pkg-message echo x - amavis-perl/pkg-plist sed 's/^X//' >amavis-perl/pkg-plist << 'END-of-amavis-perl/pkg-plist' Xsbin/amavis X%%PORTDOCS%%share/doc/amavis/amavis.txt X%%PORTDOCS%%share/doc/amavis/amavis.m4 X%%PORTDOCS%%share/doc/amavis/AUTHORS X%%PORTDOCS%%share/doc/amavis/BUGS X%%PORTDOCS%%share/doc/amavis/COPYING X%%PORTDOCS%%share/doc/amavis/ChangeLog X%%PORTDOCS%%share/doc/amavis/FAQ X%%PORTDOCS%%share/doc/amavis/HINTS X%%PORTDOCS%%share/doc/amavis/INSTALL X%%PORTDOCS%%share/doc/amavis/NEWS X%%PORTDOCS%%share/doc/amavis/README X%%PORTDOCS%%share/doc/amavis/README.exim X%%PORTDOCS%%share/doc/amavis/README.milter X%%PORTDOCS%%share/doc/amavis/README.postfix X%%PORTDOCS%%share/doc/amavis/README.qmail X%%PORTDOCS%%share/doc/amavis/README.scanners X%%PORTDOCS%%share/doc/amavis/README.sendmail X%%PORTDOCS%%share/doc/amavis/TODO X%%PORTDOCS%%@dirrm share/doc/amavis END-of-amavis-perl/pkg-plist echo x - amavis-perl/pkg-install sed 's/^X//' >amavis-perl/pkg-install << 'END-of-amavis-perl/pkg-install' X#!/usr/bin/perl X# Roman Shterenzon <roman@xpert.com> 27/12/2000 X# $FreeBSD: ports/security/amavis-perl/pkg-install,v 1.2 2001/05/31 12:08:54 olgeni Exp $ X Xuse strict; X X$ENV{'PATH'}='/bin:/usr/bin'; X Xmy $cfg; Xmy $result; X Xexit 0 if $ARGV[1] ne "POST-INSTALL"; X Xif ( -f '/etc/mail/sendmail.cf' ) { X $cfg='/etc/mail'; X} Xelsif ( -f '/etc/sendmail.cf' ) { X $cfg='/etc'; X} Xmy $cf="$cfg/sendmail.cf"; Xmy $new="$cfg/amavis.cf"; X Xprint "===> Adding necessary hooks to sendmail.cf file\n"; X Xopen(IN, $cf) || die "Cannot open $cf"; Xopen(OUT, ">$new") || die "Cannot create $new"; X Xmy $replace=0; X Xwhile(<IN>) { X if ( /^O QueueDirectory/ ) { X $_="O QueueDirectory=/var/spool/mqamavis\n"; X $replace++; X } X elsif ( /O StatusFile/ ) { X $_="O StatusFile=/var/log/amavis.st\n"; X $replace++; X } X elsif ( /^Mlocal/ ) { X print OUT <<'EOF'; XMamavis, P=/usr/local/sbin/amavis, F=mlsACDFMS5:/|@qhP, S=0, R=0 X T=DNS/RFC822/X-Unix, X A=amavis $f $u, X U=root:daemon X XEOF X $replace++; X } X elsif ( /\s+final\s+parsing$/ ) { X print OUT "R\$*\t\t\t\$#amavis \$:\$1\n"; X $replace++; X } X s/^(DZ.*)/$1av/; X print OUT; X} Xclose(OUT); Xclose(IN); Xdie "I couldn't patch the sendmail.cf file, its format is unknown to me\n" X unless ( $replace == 4 ); X Xprint "===> Adding alias for virusalert to the aliases file\n"; Xif ( ! -f "$cfg/aliases" ) { X print "Can't find aliases file, you have to add an alias for virusalert by yourself\n"; X} Xelse { X open (IN, "$cfg/aliases") || die "Cannot open aliases file for reading\n"; X my $found; X while(<IN>) { X $found=1, last if /^virusalert/; X } X close(IN); X unless ($found) { X open(OUT, ">>$cfg/aliases") || die "Cannot open aliases file for writing\n"; X print OUT "virusalert:\troot\n"; X close(OUT); X $result=system("newaliases"); X die "Failed to run newaliases command\n" if $result; X } X} X Xprint "===> Creating /var/spool/mqamavis directory\n"; Xif ( ! -d "/var/spool/mqamavis" ) { X mkdir "/var/spool/mqamavis",0755 || die "Can't create /var/spool/mqamavis\n"; X} Xmy $gid=getgrnam('daemon'); Xchown 0, $gid, "/var/spool/mqamavis"; X Xprint "===> Creating /var/spool/quarantine directory\n"; Xif ( ! -d "/var/spool/quarantine" ) { X mkdir "/var/spool/quarantine",0755 || die "Can't create /var/spool/quarantine\n"; X} Xchown 0, $gid, "/var/spool/quarantine"; X Xprint "===> Creating /var/amavis directory\n"; Xif ( ! -d "/var/amavis" ) { X mkdir "/var/amavis",0755 || die "Can't create /var/amavis\n"; X} Xchown 0, $gid, "/var/amavis"; X Xdie "There's already a $cf.pre-amavis, is amavis already installed?\n" X if -f "$cf.pre-amavis"; X$result=system("cp $cf $cf.pre-amavis"); Xdie "Failed to copy $cf to $cf.pre-amavis\n" if $result; Xrename "$cf", "${cfg}/sendmail.orig.cf" || X die "Unable to rename $cf to ${cfg}/sendmail.orig.cf\n"; Xrename "$new", "$cf" || die "Unable to rename $new to $cf\n"; END-of-amavis-perl/pkg-install echo x - amavis-perl/distinfo sed 's/^X//' >amavis-perl/distinfo << 'END-of-amavis-perl/distinfo' XMD5 (amavis-perl-11.tar.gz) = e19bfabb2da4aeccc8227766995442d5 END-of-amavis-perl/distinfo exit >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?200109260030.f8Q0UlB73699>