From c9779a3376e48d6f1cc739d0dbd75889a4f4611a Mon Sep 17 00:00:00 2001 From: John Peacock Date: Sat, 10 Dec 2005 21:11:04 +0000 Subject: [PATCH] * plugins/virus/clamdscan Use LOGNOTICE instead of LOGERROR when bailing early due to non-multipart message. Test clamd->ping() before scanning, and bail if it doesn't answer (with an appropriate error). Patch submitted by Dave Rolsky . git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.3x@583 958fd67b-6ff1-0310-b445-bb7760255be9 --- plugins/virus/clamdscan | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/virus/clamdscan b/plugins/virus/clamdscan index 1c35626..f4ee51f 100644 --- a/plugins/virus/clamdscan +++ b/plugins/virus/clamdscan @@ -118,7 +118,7 @@ sub hook_data_post { unless ( $content_type && $content_type =~ m!\bmultipart/.*\bboundary="?([^"]+)!i ) { - $self->log( LOGERROR, "non-multipart mail - skipping" ); + $self->log( LOGNOTICE, "non-multipart mail - skipping" ); return DECLINED; } @@ -153,7 +153,10 @@ sub hook_data_post { $clamd = Clamd->new(); # default unix domain socket } - return (DECLINED) unless $clamd->ping(); + unless ( $clamd->ping() ) { + $self->log( LOGERROR, "Cannot ping clamd server - did you provide the correct clamd port or socket?" ); + return DECLINED; + } if ( my %found = $clamd->scan($filename) ) { my $viruses = join( ",", values(%found) );