+ close ($fh) or
+ croak "Unable to close bug log filehandle: $!";
+ }
+ if (-d $self->{name}.'.d') {
+ opendir(my $d,$self->{name}.'.d') or
+ croak "Unable to open bug log spamdir '$self->{name}.d' for reading: $!";
+ for my $dir (readdir($d)) {
+ next unless $dir =~ m/([^\.].*)_(\w+)$/;
+ # .spam overrides .spam.d
+ next if exists $self->{spam}{$1};
+ # set the spam HASH to $dir so we know where this value was set from
+ $self->{spam}{$1} = $dir;
+ }
+ closedir($d) or
+ croak "Unable to close bug log spamdir: $!";