simplified logic
---
 plugins/check_spamhelo |   13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/plugins/check_spamhelo b/plugins/check_spamhelo
index 3b60a0a..22f7c62 100644
--- a/plugins/check_spamhelo
+++ b/plugins/check_spamhelo
@@ -1,4 +1,5 @@
 #!perl -w
+
 =head1 NAME
 
 check_spamhelo - Check a HELO message delivered from a connecting host.
@@ -17,13 +18,19 @@ per line.
 
 =cut
 
+use strict;
+use warnings;
+
+use Qpsmtpd::Constants;
+
 sub hook_helo {
   my ($self, $transaction, $host) = @_;
-  ($host = lc $host) or return DECLINED;
+
+  return DECLINED if ! $host;
   
   for my $bad ($self->qp->config('badhelo')) {
-    if ($host eq lc $bad) {
-      $self->log(LOGDEBUG, "Denying HELO from host claiming to be $bad");
+    if ( lc $host eq lc $bad) {
+      $self->log(LOGINFO, "fail: HELO from host claiming to be $host");
       return (DENY_DISCONNECT, "Sorry, I don't believe that you are $host.");
     }
   }
-- 
1.7.9.6

Reply via email to