peter
User
 Junior Boarder
| Posts: 6 |   | Karma: 0
|
Patch for clamd - 2007/09/04 17:19
More and more people are starting to use clamd in MailScanner. Here's a patch for it:
| Code: | --- Vispan.conf.070904 Tue Sep 4 19:04:36 2007
+++ Vispan.conf Tue Sep 4 19:02:52 2007
@@ -171,6 +171,7 @@
# antivir from www.antivir.de, or
# clamav from www.clamav.net, or
# clamavmodule (also from www.clamav.net using the ClamAV perl module), or
+# clamd (also from www.clamav.net using the ClamAV daemon), or
# trend
#
# mailscanner for file name or file type rejections
|
| Code: | --- Mailscanner.pm.070904 Tue Sep 4 18:54:59 2007
+++ Mailscanner.pm Tue Sep 4 19:01:16 2007
@@ -63,6 +63,13 @@
WhereIs => 'clamscan',
VerFlag => '-V 2>&1',
VerString => 'ClamAV (.*)/'},
+ clamd => {
+ Name => 'ClamAV Daemon',
+ Output => 'Clamd::INFECTED::',
+ String => 'Clamd::INFECTED:: (.*) FOUND ::',
+ WhereIs => 'clamdscan',
+ VerFlag => '-V 2>&1',
+ VerString => 'ClamAV (.*)/'},
command => {
Name => 'Command',
Output => 'Infection:',
|
This last patch is for the Vispan main script. I noticed that I got double lines on the Config page like this:
Software Version Updated
clamav 0.91.2/4153 Sep 5 13:51:17
clamd 0.91.2/4162
mailscanner 4.63.7
spamassassin 3.2.3
Note that both lines pick up the correct version of the engine but only clamd has the correct signature version. That's fine but the update timestamp is on the clamav line and that's because MailScanner doesn't separate them when updating nor should it, after all it shouldn't matter how we choose to run Clam AV. So I had to look for updates to ClamAV and see if clamd was chosen and then set the latter manually to get rid of the clamav line.
| Code: | --- Vispan.070905 Wed Sep 5 05:05:59 2007
+++ Vispan Wed Sep 5 05:21:36 2007
@@ -158,6 +158,17 @@
# Check the date of the last virus definition update
if ( $Line =~ /.*autoupdate\[.* updated/i) {
($VirUpdate, $Scanner) = ($Line =~ /^(...... ..:..:..) .* (.*).auto
update\[.*updated/);
+
+ # Clamd logs updates as ClamAV
+ if (lc($Scanner) eq 'clamav') {
+ @Vengines = split(' ',Vispan::Config::Value(Scanner));
+ foreach $scantmp (@Vengines) {
+ if (lc($scantmp) eq 'clamd') {
+ $Scanner = 'clamd';
+ }
+ }
+ }
+
Vispan::Stats::AddVirDate($VirUpdate, $Scanner);
$AutoUpdateSeen = 1;
}
|
I hope it can be included in the next release.
Post edited by: peter, at: 2007/09/05 13:33
Post edited by: peter, at: 2007/09/17 17:48
|