From 9da2fc73436af79157511840a7b9212bdf7778d1 Mon Sep 17 00:00:00 2001 From: John Peacock Date: Tue, 22 Feb 2005 22:01:21 +0000 Subject: [PATCH] Explicitely ignore non-multipart messages for virus scanning git-svn-id: https://svn.perl.org/qpsmtpd/trunk@370 958fd67b-6ff1-0310-b445-bb7760255be9 --- plugins/virus/uvscan | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/plugins/virus/uvscan b/plugins/virus/uvscan index c579810..71c5144 100644 --- a/plugins/virus/uvscan +++ b/plugins/virus/uvscan @@ -58,9 +58,19 @@ sub uvscan { 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',