Philon,
Sorry for a late reply.
> I'm having some difficulties while trying to release an virus-mail
> from the quarantine.
>
> Probably I only doing the command wrong, but this is what I do:
> # cd /var/amavis/quarantine/virus
> # amavisd-release virus-20070725T112345-21754-01
> 450 4.5.0 Failure: SQL quarantine code not enabled ... line 320
> the weird thing is, I'm not using SQL.
The amavisd-release has a simpleminded logic for guessing a quarantine type.
> amavisd.conf:
> $virus_quarantine_method = 'local:virus/virus-%i-%n';
Your argument to amavisd-release should be exactly as show in the log,
so in this particular case it seems it needs to be:
$ amavisd-release virus/virus-20070725T112345-21754-01
> so I checked amavisd source, the error occours at line 13027. The release
> switch at 13022 only goes to the error in 13027, when $quar_type is Q. Now
> why is it Q?
>
> $quar_type is being set on line 10290. There I read:
> $quar_type = /^smtp:/ ? 'M' : /^lmtp:/ ? 'L' :
> /^bsmtp:/ ? 'B' : /^sql:/ ? 'Q' :
> /^local:/ ? ($mbxname=~/\@/ ? 'M' :
> $mbxname=~/\.gz\z/ ? 'Z' : 'F') : '?'
> for (lc($quarantine_method));
>
> so I should get F for local, so it can release the mail from local file.
>
> Bug, trick? What to do?
> I'm using amavisd-new-2.5.2 from FreeBSD ports collection with perl-5.8.8.
I think you were looking at the wrong place.
The code in question is in amavisd-release :
sub release_file($$$@) {
my($sock,$mail_file,$secret_id,@alt_recips) = @_;
my($fn_path,$fn_prefix,$mail_id,$fn_suffix); local($1,$2,$3,$4);
if ($mail_file =~ m{^ ([^/].*/)? ([A-Z0-9][A-Z0-9._-]*[_-])?
([A-Z0-9][A-Z0-9_+-]{10}[A-Z0-9]) (\.gz)? \z}xsi) {
($fn_path,$fn_prefix,$mail_id,$fn_suffix) = ($1,$2,$3,$4);
} elsif ($mail_file =~ m{^ ([^/].*/)? () ([A-Za-z0-9$._=+-]+?) (\.gz)?\z}xs){
($fn_path,$fn_prefix,$mail_id,$fn_suffix) = ($1,$2,$3,$4); # old style
} else {
usage("Invalid quarantine ID: $mail_file");
}
my($quar_type) =
$fn_suffix eq '.gz' ? 'Z'
: $fn_path eq '' && $mail_id eq $mail_file ? 'Q' : 'F';
my($request_type) = $0 =~ /\brequeue\z/i ? 'requeue' : 'release';
my(@query) = (
"request=$request_type",
"quar_type=$quar_type",
"mail_id=$mail_id",
);
Mark
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
AMaViS-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/amavis-user
AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/howto/