/[smeserver]/rpms/qpsmtpd/sme8/0002-added-ClamAV-version-to-the-X-Virus-Checked-header.patch
ViewVC logotype

Contents of /rpms/qpsmtpd/sme8/0002-added-ClamAV-version-to-the-X-Virus-Checked-header.patch

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


Revision 1.1 - (show annotations) (download)
Sun Nov 14 20:50:20 2010 UTC (13 years, 11 months ago) by slords
Branch: MAIN
CVS Tags: qpsmtpd-0_84-3_el5_sme, qpsmtpd-0_84-6_el5_sme, qpsmtpd-0_84-2_el5_sme, qpsmtpd-0_84-5_el5_sme, qpsmtpd-0_84-8_el5_sme, qpsmtpd-0_84-9_el5_sme, qpsmtpd-0_84-4_el5_sme, qpsmtpd-0_84-7_el5_sme, HEAD
* Sun Nov 14 2010 <slords@mail.com> 0.84-2.sme
- Sync with upstream git repo.
- Fix require_resolvable_fromhost doesn't work [SME: 6369]
- Fix TLS security defaults [SME: 6366]
- Fix fatal errors when mail has no headers [SME: 6345]

1 From 68ecedd1ac05ce6f26d6292b1a859020f5b6c62d Mon Sep 17 00:00:00 2001
2 From: Matt Simerson <matt@tnpi.net>
3 Date: Sun, 2 May 2010 01:48:05 -0400
4 Subject: added ClamAV version to the X-Virus-Checked header
5
6 Signed-off-by: Robert <rspier@pobox.com>
7 ---
8 plugins/virus/clamdscan | 8 ++++++--
9 1 files changed, 6 insertions(+), 2 deletions(-)
10
11 diff --git a/plugins/virus/clamdscan b/plugins/virus/clamdscan
12 index a7884e7..cf6c2a2 100644
13 --- a/plugins/virus/clamdscan
14 +++ b/plugins/virus/clamdscan
15 @@ -1,5 +1,4 @@
16 #!/usr/bin/perl -w
17 -# $Id$
18
19 =head1 NAME
20
21 @@ -111,6 +110,7 @@ use warnings;
22 sub register {
23 my ( $self, $qp, @args ) = @_;
24
25 + $self->log(LOGERROR, "Bad parameters for the clamdscan plugin") if @_ % 2;
26 %{ $self->{"_clamd"} } = @args;
27
28 # Set some sensible defaults
29 @@ -198,6 +198,9 @@ sub hook_data_post {
30 return DECLINED;
31 }
32
33 + my @clamd_version = split(/\//, $clamd->version);
34 + $self->{"_clamd"}->{'version'} = $clamd_version[0] || 'ClamAV';
35 +
36 my ( $path, $found ) = eval { $clamd->scan_path( $filename ) };
37 if ($@) {
38 $self->log( LOGERROR, "Error scanning mail: $@" );
39 @@ -218,11 +221,12 @@ sub hook_data_post {
40 }
41 }
42 else {
43 + $transaction->header->add( 'X-Virus-Found', 'No' );
44 $self->log( LOGINFO, "ClamAV scan reports clean");
45 }
46
47 $transaction->header->add( 'X-Virus-Checked',
48 - "Checked by ClamAV on " . $self->qp->config("me") );
49 + "Checked by $self->{'_clamd'}->{'version'} on " . $self->qp->config("me") );
50
51 return (DECLINED);
52 }
53 --
54 1.7.2.2
55

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