amavisd-release(2.6.5) and banned files ?

Mark Martinec Mark.Martinec+amavis at ijs.si
Fri May 6 20:16:43 CEST 2011


Jarno,

> I may have found a possible bug with amavisd-release (v.2.6.5)
> and banned files:
[...]
> # /var/spool/amavis/virusmails/banned-ncBYAoKPgaHx
>
> Now if I try to release the banned message (with amavisd-release from 2.6.5)
> # amavisd-release banned-ncBYAoKPgaHx
> 450 4.5.0 Failure: File /var/spool/amavis/virusmails/ncBYAoKPgaHx does not
>   exist at (eval 96) line 385, <GEN19> line 3.
> 
> (amavisd-release(2.6.5) seems to send the banned filename as ncBYAoKPgaHx).
> Dumping the @query that amavisd-release sends:
> $VAR1 = 'request=release';
> $VAR2 = 'mail_id=ncBYAoKPgaHx';
> 
> If I use amavisd-release from amavisd-new-2.6.3
> everything works OK:
> # ./amavisd-release-263 banned-ncBYAoKPgaHx
> 250 2.0.0 from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 459FA1983
> And the query is:
> $VAR1 = 'request=release';
> $VAR2 = 'quar_type=F';
> $VAR3 = 'mail_id=ncBYAoKPgaHx';
> $VAR4 = 'mail_file=banned-ncBYAoKPgaHx';
> 
> Is this a bug in amavisd-release or is there something wrong with
> my config etc. ?

Thanks for the concise problem report!

The problem is in the amavisd-release, not sending a 'mail_file'
attribute when a quarantine type is not known and the determination
of a quarantine type is left over to amavisd.

The problem occurs if a quarantine id does not end in ".gz"
_and_ the quarantine is file based (not SQL),
_and_ the quarantine is kept at one level of a directory (no subdirectories,
i.e. $quarantine_subdir_levels = 0).

I believe the following patch to amavisd-release (as distributed by 2.6.5)
fixes the issue:

--- amavisd-release.orig	2011-03-31 19:56:42.970618929 +0200
+++ amavisd-release	2011-05-06 20:04:44.026358669 +0200
@@ -166,3 +166,3 @@
   push(@query, "secret_id=$secret_id")    if $secret_id ne '';
-  push(@query, "mail_file=$mail_file")    if $quar_type =~ /^[FZB]\z/;
+  push(@query, "mail_file=$mail_file");  # ignored with an SQL quarantine
   push(@query, "partition_tag=$part_tag") if $part_tag ne '';


Mark


More information about the amavis-users mailing list