Jason S wrote:
> [EMAIL PROTECTED] wrote:
> > I found out about a special problem. We got mail with a zip
> > attachment. Some of the files are shrunken. unzip returns
> > with exitcode 81. qmail-scanner checks only for exitcode 82
> > (=password protected and wrong password.) The mail is not
> > delivered. I'm not the big perl guru. Propably my code would
> > be very ugly. Could somebody please write some lines to
> > handle exitcode 81 and scan the not shrunken files?

> >a peek at q-s 1.15 shows check for 81 and 82:
> >if ( ($zip_status > 0) && ($zip_status !~ /^(1|2|3|51|81|82)<$/).... 
> <what version are you running?
> 
> 1.13 has it as well.

Jason-
looking a bit further at 1.15 code...it seems that while the exit codes above
are checked, the output string specific to "shrink" files is not:

   if (/^\s+skipping:\s(.*)\s+(encrypted|incorrect password)/) {

so...I'm guessing that a new section is needed? e.g.

      if (/^\s+skipping:\s(.*)\s+.*shrink/) {
        $shrink_files++;
        #grab these shrink filenames for reports anyway.
        $zfile=$1;
        $zfile=~s/^.*\///g;
        $zfile=~s/(^\s+|\s+$)//g;

        #$file_desc .= "$zfile:$zsize\t";  
      }

along with complimentary change to:
    if ($zip_status > 0 
       && ($zip_status !~ /^(1|2|3|51|81|82)$/ 
       && !$shrink_files
       && !$passwd_protected_zip)
       ) {
        &tempfail("u_f: cannot close unzip (error code:
$zip_status,$passwd_protected_zip) - $!");
    }

2 cents...

PS-
why is the line:
   #$file_desc .= "$zfile:$zsize\t";  
commented out in the while (<ZIPPED>) block? This prevents those files from
being included in the debug log.


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Qmail-scanner-general mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/qmail-scanner-general

Reply via email to