/[smeserver]/rpms/qpsmtpd/sme7/qpsmtpd-0.40-clamav_fix.patch
ViewVC logotype

Contents of /rpms/qpsmtpd/sme7/qpsmtpd-0.40-clamav_fix.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Thu Jun 14 20:01:08 2007 UTC (17 years ago) by slords
Branch: MAIN
CVS Tags: qpsmtpd-0_40-1_0_el4_sme, qpsmtpd-0_40-1_1_el4_sme
Fixes for 0.40

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

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed