Author: robert
Date: Fri Nov 16 23:55:32 2007
New Revision: 815
Modified:
trunk/plugins/virus/clamdscan
Log:
Option to clamdscan to scan all messages, even if there are no attachments
Modified: trunk/plugins/virus/clamdscan
==============================================================================
--- trunk/plugins/virus/clamdscan (original)
+++ trunk/plugins/virus/clamdscan Fri Nov 16 23:55:32 2007
@@ -67,6 +67,10 @@
The maximum size, in kilobytes, of messages to scan; defaults to 128k.
+=item B<scan_all>
+
+Scan all messages, even if there are no attachments
+
=back
=head1 REQUIREMENTS
@@ -101,6 +105,7 @@
$self->{"_clamd"}->{"clamd_socket"} ||= "/tmp/clamd";
$self->{"_clamd"}->{"deny_viruses"} ||= "yes";
$self->{"_clamd"}->{"max_size"} ||= 128;
+ $self->{"_clamd"}->{"scan_all"} ||= 0;
}
sub hook_data_post {
@@ -115,7 +120,8 @@
# Ignore non-multipart emails
my $content_type = $transaction->header->get('Content-Type');
$content_type =~ s/\s/ /g if defined $content_type;
- unless ( $content_type
+ unless ( $self->{"_clamd"}-{"scan_all"}
+ || $content_type
&& $content_type =~ m!\bmultipart/.*\bboundary="?([^"]+)!i )
{
$self->log( LOGNOTICE, "non-multipart mail - skipping" );