diff --git a/plugins/helo b/plugins/helo index 06bc320..134372c 100644 --- a/plugins/helo +++ b/plugins/helo @@ -307,7 +307,9 @@ sub is_in_badhelo { $host = lc $host; foreach my $bad ($self->qp->config('badhelo')) { if ($bad =~ /[\{\}\[\]\(\)\^\$\|\*\+\?\\\!]/) { # it's a regexp - return $self->is_regex_match($host, $bad); + if ($self->is_regex_match($host, $bad)) { + return $error, "in badhelo"; + } } if ($host eq lc $bad) { return $error, "in badhelo"; diff --git a/t/plugin_tests/helo b/t/plugin_tests/helo index 5e6f4ca..f144ab3 100644 --- a/t/plugin_tests/helo +++ b/t/plugin_tests/helo @@ -56,11 +56,11 @@ sub test_invalid_localhost { foreach my $ip ( undef, '', '192.0.99.5' ) { $self->qp->connection->remote_ip(undef); ($err, $why) = $self->invalid_localhost('localhost' ); - ok(!$err, "host: localhost, invalid remote ip"); + ok($err, "host: localhost, remote ip ($ip)"); $self->qp->connection->remote_ip(undef); ($err, $why) = $self->invalid_localhost('not-localhost'); - ok($err, "host: not-localhost, invalid remote ip"); + ok(! $err, "host: not-localhost, remote ip ($ip)"); } foreach my $ip (qw/ ::1 127.0.0.1 / ) {