Subject: pkg/24350: security/amavis-perl bug (using clamd) and postfix support
To: None <gnats-bugs@gnats.NetBSD.org>
From: Markus W Kilbinger <kilbi@rad.rwth-aachen.de>
List: netbsd-bugs
Date: 02/08/2004 00:00:51
>Number:         24350
>Category:       pkg
>Synopsis:       amavis-perl needs some mods to work with clamd and postfix
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Feb 07 23:01:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     
>Release:        NetBSD 1.6ZI
>Organization:
>Environment:
System: NetBSD mogli 1.6ZI NetBSD 1.6ZI (MOGLI) #19: Fri Feb 6 18:22:28 MET 2004 root@lwle5:/usr/src/sys/arch/i386/compile/MOGLI i386
Architecture: i386
Machine: i386
>Description:
To get amavis-perl work with clamd and post fix I needed the following
mods/pathes (see 'Fix'). One seems to be a bug in amavis-perl. The
others seem to be mods required for NetBSD ond postfix.
>How-To-Repeat:
Try to install/use amavis-perl package iwth postfix and clamd
>Fix:
(Sorry for the strange diffs; only had my patched installed pkg as reference...)

work.../amavisd-0.1/amavis/av/clamavd:

  	  if ($output =~ /FOUND$/) {      # no errors, a virus was found
  	      $scanner_errors = 0;
  	      @virusname = ($output =~ /: (.+) FOUND/g);
  -           return 1;  # 'true' indicates virus found and stops further checking
  +           do_virus($output);
  	  } elsif ($output =~ /OK$/) {            # no errors, no viruses
  	      $scanner_errors = 0;
  	  } elsif ($output =~ /ERROR$/) {

Otherwise no virus is found at all... ;-)

work.../amavisd-0.1/amavis/amavisd.in:

   # If IGNORE leaves zombies behind on your system,
   # switch the comments between the two lines below
  -# $SIG{CHLD} = \&deadbabe;
  -$SIG{CHLD} = 'IGNORE';
  +$SIG{CHLD} = \&deadbabe;
  +# $SIG{CHLD} = 'IGNORE';
   
   # may need to do more - eg. if logging changes, close/reopen syslog/log file
   # rethink - handler should be simple

Otherwise tons of proc zobies accumulate...

Makefile:

  Index: Makefile
  ===================================================================
  RCS file: /cvsroot/pkgsrc/security/amavis-perl/Makefile,v
  retrieving revision 1.12
  diff -u -r1.12 Makefile
  --- Makefile    2003/07/17 22:52:50     1.12
  +++ Makefile    2004/02/07 22:55:58
  @@ -64,6 +64,8 @@
   CONFIGURE_ARGS+=--enable-milter
   CONFIGURE_ARGS+=--with-milter-libs=${PREFIX}/lib
   CONFIGURE_ARGS+=--with-milter-includes=${PREFIX}/include
  +.elseif defined(USE_POSTFIX) && ${USE_POSTFIX} == "YES"
  +CONFIGURE_ARGS+=--enable-postfix
   .else
   CONFIGURE_ARGS+=--enable-smtp --with-smtp-port=${SMTPPORT}
   .endif

To get postfix specific code into generated amavisd (on demand)...
>Release-Note:
>Audit-Trail:
>Unformatted: