>>>>> "Christoph" == Christoph Haas <[EMAIL PROTECTED]> writes:

    Christoph> I have added a few debug prints in the amavids-new code
    Christoph> and just copied the part to /tmp/part for further
    Christoph> analysis. This is what's probably wrong:

Ok, I have been looking at the code, in the testing/unstable version.

It is so ugly it is not funny.

There is a global variable $any_undecipherable and a local variable
$any_undecipherable in check_mail.

For every part check_mail calls:

($hold,$prot) = decompose_part

(what is $hold???)

which sets the following global:

$any_undecipherable = 0;

which in turn calls do_uncompress, registers an error, but does not
increment $any_undecipherable.

It then returns ($hold, $any_undecipherable).

The value of the *global* $any_undecipherable maps to the local
$prot. If $prot is non-zero, then the *local* $any_undecipherable is
incremented.

check_mail after uncompressing all parts, checks the value of the
*local* variable $any_undecipherable, and allows the mail if and only
if UNDECIPHERABLEs are not banned in the config file.

The problem are:

1. $any_undecipherable isn't set on file read error.

2. I am not sure how code flows from decompose_part to the call to
   file which fails. In fact, this call seems to occur first!

Anyway to cut a long story short, does this patch help? It fixes 1,
but not 2. I would like to think/pretend that solving 1 will
automagically solve 2.

--- amavisd.old 2005-05-06 10:22:45.926093480 +1000
+++ amavisd     2005-05-06 10:58:57.513961944 +1000
@@ -4024,6 +4024,7 @@
        else {
            do_log(0,"Decoding of $part ($filetype) failed, ".
                 "leaving it unpacked: $@");
+           $any_undecipherable++;
        }
        $sts = 2;
     }

The more I read this code, the more confused I get, I am going to take
a break now.
-- 
Brian May <[EMAIL PROTECTED]>


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to