[svn:qpsmtpd] rev 383 - in trunk: . plugins/virus

[email protected] 4 Mar 2005 16:04:59 -0000
Newsgroups perl.cvs.qpsmtpd
Message-ID <[email protected]>
Author: jpeacock
Date: Fri Mar  4 08:04:59 2005
New Revision: 383

Modified:
   trunk/   (props changed)
   trunk/plugins/virus/clamdscan
Log:
1

Modified: trunk/plugins/virus/clamdscan
==============================================================================
--- trunk/plugins/virus/clamdscan	(original)
+++ trunk/plugins/virus/clamdscan	Fri Mar  4 08:04:59 2005
@@ -55,7 +55,7 @@
 =item B<clamd_port>
 
 If present, must be the TCP port where the clamd service is running,
-typically 3310; default disabled.
+typically 3310; default disabled.  If present, overrides the clamd_socket.
 
 =item B<deny_viruses>
 
@@ -138,8 +138,14 @@
 
     my $clamd;
 
-    if (    $self->{"_clamd"}->{"clamd_port"}
-        and $self->{"_clamd"}->{"clamd_port"} =~ /(\d+)/ )
+    if (
+        (
+                $self->{"_clamd"}->{"clamd_port"}
+            and $self->{"_clamd"}->{"clamd_port"} =~ /(\d+)/
+        )
+        or (    $self->{"_clamd"}->{"clamd_socket"}
+            and $self->{"_clamd"}->{"clamd_socket"} =~ /([\w\/.]+)/ )
+      )
     {
         my $port = $1;
         $clamd = Clamd->new( port => $port );
@@ -152,7 +158,7 @@
 
     if ( my %found = $clamd->scan($filename) ) {
         my $viruses = join( ",", values(%found) );
-	$self->log( LOGERROR, "One or more virus(es) found: $viruses" );
+        $self->log( LOGERROR, "One or more virus(es) found: $viruses" );
 
         if ( lc( $self->{"_clamd"}->{"deny_viruses"} ) eq "yes" ) {
             return ( DENY,