Disinfection speed bogosity

Jeff A. Earickson jaearick at colby.edu
Tue Jul 25 12:07:32 UTC 2006


Julian,

I rolled this change in, and added a test for $speed > 0 in the syslog
message to cut down on useless chatter.  See the attached "diff -c"
for the changes between 4.55.8 and what I'm now running.

This works well for me; the bogus MCP and disinfection speed messages are
gone.  Thanks!

Jeff Earickson
Colby College

On Tue, 25 Jul 2006, Julian Field wrote:

> Date: Tue, 25 Jul 2006 09:30:55 +0100
> From: Julian Field <MailScanner at ecs.soton.ac.uk>
> Reply-To: MailScanner Beta-testers <mailscanner-beta at lists.mailscanner.info>
> To: MailScanner Beta-testers <mailscanner-beta at lists.mailscanner.info>
> Subject: Re: Disinfection speed bogosity
> 
> I have changed it to set it to 0 and not 1_000_000. Should make slightly more 
> sense.
> I have changed the line in both places to
> $speed = 0 if $speed > 1_000_000 || $speed <  0;
>
> Please can you put that in and try it for me?
>
> Thanks,
> Jules.
>
> On 25 Jul 2006, at 00:59, Jeff A. Earickson wrote:
>
>> Julian,
>> 
>> I cranked in the change below.  Now I'm seeing a whole lot of:
>> 
>> Spam Checks completed at 1000000 bytes per second
>> MCP Checks completed at 1000000 bytes per second
>> Virus Processing completed at 1000000 bytes per second
>> Disinfection completed at 1000000 bytes per second
>> 
>> Not everything gives 1000000 for the "completed at" syslog statements, but 
>> most of the syslog output does.  My setup is Solaris 10 (Sparc, 64 bit), 
>> with sophos and clamavmodule.
>> 
>> I don't deliver cleaned messages, and I don't use MCP, so maybe I should 
>> not be seeing the "MCP check completed" and "Disinfection completed"
>> timing syslogs at all -- they don't happen for me, right?
>> 
>> When I was looking at the code, I wondered about the differences
>> in logic in MessageBatch.pm between EndBatch (lines 102-108) and
>> StopTiming (lines 136-166).  The minimum cutoff for
>> 
>> $totaltime = 1 unless $totaltime > ???
>> 
>> is different for the two sections.  Is this really what you want?
>> 
>> Jeff Earickson
>> Colby College
>> 
>> On Mon, 24 Jul 2006, Julian Field wrote:
>> 
>>> Date: Mon, 24 Jul 2006 22:11:06 +0100
>>> From: Julian Field <MailScanner at ecs.soton.ac.uk>
>>> Reply-To: MailScanner Beta-testers 
>>> <mailscanner-beta at lists.mailscanner.info>
>>> To: MailScanner Beta-testers <mailscanner-beta at lists.mailscanner.info>
>>> Subject: Re: Disinfection speed bogosity
>>> 
>>> On Mon24 Jul 06, at 21:43, Jeff A. Earickson wrote:
>>> 
>>>> Julian,
>>>> I just noticed totally bogus disinfection speeds in my syslog for
>>>> 4.55.8 (and 4.55.7), stuff like:
>>>> Disinfection completed at 1080796982 bytes per second
>>>> Disinfection completed at -1554448642 bytes per second
>>>> Disinfection completed at -1 bytes per second
>>>> Looking at around line 162 of MessageBatch.pm, I would guess that
>>>> this routine never got the Time::HiRes retrofit since the minimum
>>>> time there seems to be one second.  Is this a bug?
>>> 
>>> Around like 158 make the code look like this: (note the 1 extra line in 
>>> the middle)
>>> 
>>> $totaltime = 1 unless $totaltime > 0; # Minimum of 1 second
>>> # speed = bytes / totaltime
>>> $speed = ($this->{totalbytes}*1.0) / ($totaltime*1.0) if $totaltime > 0;
>>> $speed = 1_000_000 if $speed > 1_000_000 or $speed < 0; # THIS IS NEW
>>> # bytespersecond = speed
>>> $command = '$this->{' . $varprefix . '_bytespersecond} = $speed;';
>>> eval $command;
>>> 
>>> 
>>>> Jeff Earickson
>>>> Colby College
>>>> -- 
>>>> MailScanner-Beta mailing list
>>>> mailscanner-beta at lists.mailscanner.info
>>>> http://lists.mailscanner.info/mailman/listinfo/mailscanner-beta
>>>> Before posting, read http://wiki.mailscanner.info/posting
>>>> Support MailScanner development - buy the book off the website!
>>> 
>>> --
>>> Julian Field
>>> www.MailScanner.info
>>> Buy the MailScanner book at www.MailScanner.info/store !
>>> PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654
>>> 
>>> 
>>> 
>>> -- 
>>> This message has been scanned for viruses and
>>> dangerous content by MailScanner, and is
>>> believed to be clean.
>>> MailScanner thanks transtec Computers for their support.
>>> 
>>> -- 
>>> MailScanner-Beta mailing list
>>> mailscanner-beta at lists.mailscanner.info
>>> http://lists.mailscanner.info/mailman/listinfo/mailscanner-beta
>>> 
>>> Before posting, read http://wiki.mailscanner.info/posting
>>> 
>>> Support MailScanner development - buy the book off the website!
>> -- 
>> MailScanner-Beta mailing list
>> mailscanner-beta at lists.mailscanner.info
>> http://lists.mailscanner.info/mailman/listinfo/mailscanner-beta
>> 
>> Before posting, read http://wiki.mailscanner.info/posting
>> 
>> Support MailScanner development - buy the book off the website!
>
> -- 
> Julian Field
> MailScanner at ecs.soton.ac.uk
>
>
>
> -- 
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
> MailScanner thanks transtec Computers for their support.
>
> -- 
> MailScanner-Beta mailing list
> mailscanner-beta at lists.mailscanner.info
> http://lists.mailscanner.info/mailman/listinfo/mailscanner-beta
>
> Before posting, read http://wiki.mailscanner.info/posting
>
> Support MailScanner development - buy the book off the website!
-------------- next part --------------
*** MessageBatch.pm.orig	Tue Jul 25 07:40:20 2006
--- MessageBatch.pm	Tue Jul 25 07:52:07 2006
***************
*** 103,108 ****
--- 103,109 ----
    $this->{totaltime} = $totaltime;
    $totaltime = 1 unless $totaltime > 0.001; # Minimum of 1 m-second
    $speed = ($totalbytes*1.0) / ($totaltime*1.0) if $totaltime > 0;
+   $speed = 0 if $speed > 1_000_000 || $speed <  0;
    $this->{bytespersecond} = $speed;
    if (MailScanner::Config::Value('logspeed')) {
      MailScanner::Log::InfoLog("Batch completed at %d bytes per second (%d / %d)",
***************
*** 155,167 ****
    $totaltime = 1 unless $totaltime > 0; # Minimum of 1 second
    # speed = bytes / totaltime
    $speed = ($this->{totalbytes}*1.0) / ($totaltime*1.0) if $totaltime > 0;
    # bytespersecond = speed
    $command = '$this->{' . $varprefix . '_bytespersecond} = $speed;';
    eval $command;
  
    MailScanner::Log::InfoLog("%s completed at %d bytes per second",
                              $usertext, $speed)
!     if MailScanner::Config::Value('logspeed');
  }
  
  # This must be called as a class method before new() is used
--- 156,169 ----
    $totaltime = 1 unless $totaltime > 0; # Minimum of 1 second
    # speed = bytes / totaltime
    $speed = ($this->{totalbytes}*1.0) / ($totaltime*1.0) if $totaltime > 0;
+   $speed = 0 if $speed > 1_000_000 || $speed <  0;
    # bytespersecond = speed
    $command = '$this->{' . $varprefix . '_bytespersecond} = $speed;';
    eval $command;
  
    MailScanner::Log::InfoLog("%s completed at %d bytes per second",
                              $usertext, $speed)
!     if MailScanner::Config::Value('logspeed') && $speed > 0;
  }
  
  # This must be called as a class method before new() is used


More information about the MailScanner-Beta mailing list