Hi all,<br>here is possible bug in Empty() method:<br><br># Return true if all the messages in the batch are deleted!<br># Return false otherwise.<br>sub Empty {<br>  my $this = shift;<br><br>  my($id, $message);<br>  while(($id,$message) = each %{$this-&gt;{messages}}) {<br>
    return 0 unless $message-&gt;{deleted};<br>  }<br>  return 1;<br>}<br><br>Problem is that if this function does return 0, it does not reset &quot;each&quot; iterator so next loop around $this-&gt;{messages} will continue with the same position.<br>
This may manifest itself in phishing not always detected since loop in ScanBatch() in SweepContent.pm exits due to not resetting iterator.<br><br>From my point of view, more proper code would be:<br><br># Return true if all the messages in the batch are deleted!<br>
# Return false otherwise.<br>sub Empty {<br>  my $this = shift;<br>  my $res = 1;<br>  <br>  my($id, $message);<br>  while(($id,$message) = each %{$this-&gt;{messages}}) {<br>    $res = 0 unless $message-&gt;{deleted};<br>
  }<br>  return $res;<br>}<br>So iterator resets itself after completing cycle<br><br>Am I terribly wrong?<br><br>Regards<br>Timofey<br>