1 |
slords |
1.2 |
diff -Nur -x '*.orig' -x '*.rej' qpsmtpd-0.40/plugins/virus/clamav mezzanine_patched_qpsmtpd-0.40/plugins/virus/clamav |
2 |
|
|
--- qpsmtpd-0.40/plugins/virus/clamav 2007-06-14 11:57:23.000000000 -0600 |
3 |
|
|
+++ mezzanine_patched_qpsmtpd-0.40/plugins/virus/clamav 2007-06-14 17:46:23.000000000 -0600 |
4 |
slords |
1.1 |
@@ -139,6 +139,9 @@ |
5 |
|
|
elsif (/back_compat/) { |
6 |
|
|
$self->{_back_compat} = '-i --max-recursion=50'; |
7 |
|
|
} |
8 |
|
|
+ elsif (/declined_on_fail/) { |
9 |
|
|
+ $self->{_declined_on_fail} = 1; |
10 |
|
|
+ } |
11 |
|
|
else { |
12 |
|
|
$self->log(LOGERROR, "Unrecognized argument '$_' to clamav plugin"); |
13 |
|
|
return undef; |
14 |
|
|
@@ -149,6 +152,7 @@ |
15 |
|
|
$self->{_spool_dir} ||= $self->spool_dir(); |
16 |
|
|
$self->{_back_compat} ||= ''; # make sure something is set |
17 |
|
|
$self->{_clamd_conf} ||= '/etc/clamd/conf'; # make sure something is set |
18 |
|
|
+ $self->{_declined_on_fail} ||= 0; # decline the message on clamav failure |
19 |
|
|
|
20 |
|
|
unless ($self->{_spool_dir}) { |
21 |
|
|
$self->log(LOGERROR, "No spool dir configuration found"); |
22 |
|
|
@@ -202,6 +206,7 @@ |
23 |
|
|
|
24 |
|
|
if ($signal) { |
25 |
|
|
$self->log(LOGINFO, "clamscan exited with signal: $signal"); |
26 |
|
|
+ return (DENYSOFT) if (!$self->{_declined_on_fail}); |
27 |
|
|
return (DECLINED); |
28 |
|
|
} |
29 |
|
|
if ($result == 1) { |
30 |
slords |
1.2 |
@@ -215,6 +220,11 @@ |
31 |
slords |
1.1 |
} |
32 |
slords |
1.2 |
elsif ($result) { |
33 |
|
|
$self->log(LOGERROR, "ClamAV error: $cmd: $result\n"); |
34 |
|
|
+ return (DENYSOFT) if (!$self->{_declined_on_fail}); |
35 |
|
|
+ } |
36 |
slords |
1.1 |
+ else { |
37 |
|
|
+ $transaction->header->add( 'X-Virus-Checked', |
38 |
|
|
+ "Checked by ClamAV on " . $self->qp->config("me") ); |
39 |
|
|
} |
40 |
|
|
return (DECLINED); |
41 |
|
|
} |