lib/Mail/SpamAssassin/ArchiveIterator.pm [965:1003]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  my $stat_errn = stat($folder) ? 0 : 0+$!;
  if ($stat_errn == ENOENT) {
    # no longer there?
  }
  elsif ($stat_errn != 0) {
    warn "archive-iterator: no access to $folder: $!";
  }
  elsif (-f _) {
    push(@files, $folder);
  }
  elsif (-d _) {
    # passed a directory of mboxes
    $folder =~ s/\/\s*$//; #Remove trailing slash, if there
    if (!opendir(DIR, $folder)) {
      warn "archive-iterator: can't open '$folder' dir: $!\n";
      return;
    }
    while ($_ = readdir(DIR)) {
      next if $_ eq '.' || $_ eq '..' || !/^[^\.]\S*$/;
      # hmmm, ignores folders with spaces in the name???
      $stat_errn = stat("$folder/$_") ? 0 : 0+$!;
      if ($stat_errn == ENOENT) {
        # no longer there?
      }
      elsif ($stat_errn != 0) {
        warn "archive-iterator: no access to $folder/$_: $!";
      }
      elsif (-f _) {
	push(@files, "$folder/$_");
      }
    }
    closedir(DIR)  or die "error closing directory $folder: $!";
  }
  else {
    warn "archive-iterator: $folder is not a plain file or directory: $!";
  }

  foreach my $file (@files) {
    $self->_bump_scan_progress();
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



lib/Mail/SpamAssassin/ArchiveIterator.pm [1092:1130]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  my $stat_errn = stat($folder) ? 0 : 0+$!;
  if ($stat_errn == ENOENT) {
    # no longer there?
  }
  elsif ($stat_errn != 0) {
    warn "archive-iterator: no access to $folder: $!";
  }
  elsif (-f _) {
    push(@files, $folder);
  }
  elsif (-d _) {
    # got passed a directory full of mbx folders.
    $folder =~ s/\/\s*$//; # remove trailing slash, if there is one
    if (!opendir(DIR, $folder)) {
      warn "archive-iterator: can't open '$folder' dir: $!\n";
      return;
    }
    while ($_ = readdir(DIR)) {
      next if $_ eq '.' || $_ eq '..' || !/^[^\.]\S*$/;
      # hmmm, ignores folders with spaces in the name???
      $stat_errn = stat("$folder/$_") ? 0 : 0+$!;
      if ($stat_errn == ENOENT) {
        # no longer there?
      }
      elsif ($stat_errn != 0) {
        warn "archive-iterator: no access to $folder/$_: $!";
      }
      elsif (-f _) {
	push(@files, "$folder/$_");
      }
    }
    closedir(DIR)  or die "error closing directory $folder: $!";
  }
  else {
    warn "archive-iterator: $folder is not a plain file or directory: $!";
  }

  foreach my $file (@files) {
    $self->_bump_scan_progress();
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



