cvs commit: qpsmtpd/plugins/virus uvscan

[email protected] (John Peacock) 22 Feb 2005 22:01:21 -0000
Newsgroups perl.cvs.qpsmtpd
Message-ID <[email protected]>
cvsuser     05/02/22 14:01:21

  Modified:    plugins/virus uvscan
  Log:
  Explicitely ignore non-multipart messages for virus scanning
  
  Revision  Changes    Path
  1.3       +11 -1     qpsmtpd/plugins/virus/uvscan
  
  Index: uvscan
  ===================================================================
  RCS file: /cvs/public/qpsmtpd/plugins/virus/uvscan,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- uvscan	23 Sep 2004 18:54:58 -0000	1.2
  +++ uvscan	22 Feb 2005 22:01:21 -0000	1.3
  @@ -58,9 +58,19 @@
     return (DECLINED)
       if $transaction->body_size > 250_000;
   
  +  # Ignore non-multipart emails
  +  my $content_type = $transaction->header->get('Content-Type');
  +  $content_type =~ s/\s/ /g if defined $content_type;
  +  unless ( $content_type
  +      && $content_type =~ m!\bmultipart/.*\bboundary="?([^"]+)!i )
  +  {
  +      $self->log( LOGERROR, "non-multipart mail - skipping" );
  +      return DECLINED;
  +  }
  +
     my $filename = $transaction->body_filename;
     return (DECLINED) unless $filename;
  - 
  +
     # Now do the actual scanning!
     my @cmd =($self->{"_uvscan"}->{"uvscan_location"},
   	'--mime', '--unzip', '--secure', '--noboot',