[Mimedefang] sophos virus tempfail
Christian Hilgers
listen-ch at muc.zae-bayern.de
Mon Mar 31 10:29:00 EST 2003
Hi,
I'm using mimedefang version 2.31 with sophos. I'm getting errors while receiving password protected files.
Problem running virus scanner: code=2, category=swerr, action=tempfail
I think it is a known problem but I could not find a fix in the mailinglist. I tried to solve the problem.
It is a quick and dirty hack but it works well for me.
Here is my solution:
/etc/mail/mimedefang-filter
# Virus scan
if ($FoundVirus) {
my($code, $category, $action);
$VirusScannerMessages = "";
($code, $category, $action) = entity_contains_virus($entity);
# If you are more paranoid, change to: if ($action eq "quarantine") {
if (($category eq "virus") and ($action ne "novirusscan")) {
md_log('virus',$VirusName, $RelayAddr);
# Bounce the mail!
# action_bounce("Virus $VirusName found in mail - rejected");
# But quarantine the part for examination later. Comment
# the next line out if you don't want to bother.
return action_quarantine($entity, "A known virus was discovered and deleted.\nVirus-scanner messages follow:\n$VirusScannerMessages\n\n");
# return; # In action_quarantine verwendet damit Mail an Admin geht
}
if ($action eq "novirusscan") {
md_log('novirusscan',$VirusName, $RelayAddr);
return action_quarantine($entity, "The Virus-Mailscanner could not check your mail\nbecause at least on file ist password protected.\nVirus-scanner messages follow:\n$VirusScannerMessages\n\n");
}
if ($action eq "tempfail") {
action_tempfail("Problem running virus-scanner");
md_syslog('warning', "Problem running virus scanner: code=$code, category=$category, action=$action");
}
}
----
/usr/local/bin/mimedefang.pl
sub interpret_sweep_code ($) {
# Based on info from Nicholas Brealey
my($code) = @_;
# OK
return ($code, 'ok', 'ok') if ($code == 0);
# Interrupted
return ($code, 'interrupted', 'tempfail') if ($code == 1);
# Error
# return ($code, 'swerr', 'tempfail') if ($code == 2);
#File password protected?
if ($code == 2) {
if ($CurrentVirusScannerMessage =~m/Password /) {
return (3, 'virus', 'novirusscan');
} else {
return ($code, 'swerr', 'tempfail');
}
}
More information about the MIMEDefang
mailing list