> for my $bad (@badmailfrom) {
> + my $reason = $bad;
> + $reason =~ s/^\s*(\S+)[\t\s]+//;
> + $reason = "sorry, your envelope sender is in my badmailfrom list" unless
> $reason;
> $bad =~ s/^\s*(\S+).*/$1/;
You're using 2 almost identical RE's here where you could use one.
And I'm not quite sure why we're allowing leading/trailing whitespace
in this file.
my $reason;
($bad,$reason) = split /\s/,$bad,2;
or if you really want to use a RE:
($bad,$reason) = $bad =~ /^\s*(\S+)\s*(\S+)?/
or something like that.