cvs commit: qpsmtpd/lib/Qpsmtpd SMTP.pm TcpServer.pm

[email protected] (Ask Bjoern Hansen)
Newsgroups perl.cvs.qpsmtpd
Message-ID <[email protected]>
cvsuser     03/04/15 10:01:43

  Modified:    .        CREDITS Changes
               config   plugins
               lib/Qpsmtpd SMTP.pm TcpServer.pm
  Log:
    check_earlytalker plugin.  Deny the connection if the client talks
    before we show our SMTP banner.  (From Devin Carraway)
  
    Patch Qpsmtpd::SMTP to allow connect plugins to give DENY and
    DENYSOFT return codes.  Based on patch from Devin Carraway.
  
  Revision  Changes    Path
  1.8       +1 -0      qpsmtpd/CREDITS
  
  Index: CREDITS
  ===================================================================
  RCS file: /cvs/public/qpsmtpd/CREDITS,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -w -r1.7 -r1.8
  --- CREDITS	18 Mar 2003 09:46:18 -0000	1.7
  +++ CREDITS	15 Apr 2003 17:01:42 -0000	1.8
  @@ -5,6 +5,7 @@
   Devin Carraway <[email protected]>: Patch to not accept half mails if
   the connection gets dropped at the wrong moment.  Support and enable
   taint checking. MAIL FROM host dns check configurable.  HELO hook.
  +initial earlytalker plugin.
   
   Andrew Pam <[email protected]>: fixing the maximum message size
   (databytes) stuff.
  
  
  
  1.37      +6 -0      qpsmtpd/Changes
  
  Index: Changes
  ===================================================================
  RCS file: /cvs/public/qpsmtpd/Changes,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -w -r1.36 -r1.37
  --- Changes	25 Mar 2003 12:50:07 -0000	1.36
  +++ Changes	15 Apr 2003 17:01:43 -0000	1.37
  @@ -1,5 +1,11 @@
   0.26-dev
   
  +  check_earlytalker plugin.  Deny the connection if the client talks
  +  before we show our SMTP banner.  (From Devin Carraway)
  +
  +  Patch Qpsmtpd::SMTP to allow connect plugins to give DENY and
  +  DENYSOFT return codes.  Based on patch from Devin Carraway.
  +
     Support morercpthosts.cdb
   
     config now takes an extra "type" parameter.  If it's "map" then a
  
  
  
  1.7       +3 -0      qpsmtpd/config/plugins
  
  Index: plugins
  ===================================================================
  RCS file: /cvs/public/qpsmtpd/config/plugins,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -w -r1.6 -r1.7
  --- plugins	18 Mar 2003 09:47:09 -0000	1.6
  +++ plugins	15 Apr 2003 17:01:43 -0000	1.7
  @@ -7,7 +7,10 @@
   #   http_config http://localhost/~smtpd/config/  http://www.example.com/smtp.pl?config=
   
   quit_fortune
  +
  +#check_earlytalker
   require_resolvable_fromhost
  +
   rhsbl
   dnsbl
   check_badmailfrom
  
  
  
  1.10      +13 -1     qpsmtpd/lib/Qpsmtpd/SMTP.pm
  
  Index: SMTP.pm
  ===================================================================
  RCS file: /cvs/public/qpsmtpd/lib/Qpsmtpd/SMTP.pm,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -w -r1.9 -r1.10
  --- SMTP.pm	18 Mar 2003 09:43:22 -0000	1.9
  +++ SMTP.pm	15 Apr 2003 17:01:43 -0000	1.10
  @@ -73,9 +73,21 @@
       # this should maybe be called something else than "connect", see
       # lib/Qpsmtpd/TcpServer.pm for more confusion.
       my ($rc, $msg) = $self->run_hooks("connect");
  -    if ($rc != DONE) {
  +    if ($rc == DENY) {
  +      $self->respond(550, ($msg || 'Connection from you denied, bye bye.'));
  +      return $rc;
  +    }
  +    elsif ($rc == DENYSOFT) {
  +      $self->respond(450, ($msg || 'Connection from you temporarily denied, bye bye.'));
  +      return $rc;
  +    }
  +    elsif ($rc == DONE) {
  +      return $rc;
  +    }
  +    elsif ($rc != DONE) {
         $self->respond(220, $self->config('me') ." ESMTP qpsmtpd "
   		     . $self->version ." ready; send us your mail, but not your spam.");
  +      return DONE;
       }
   }
   
  
  
  
  1.6       +4 -1      qpsmtpd/lib/Qpsmtpd/TcpServer.pm
  
  Index: TcpServer.pm
  ===================================================================
  RCS file: /cvs/public/qpsmtpd/lib/Qpsmtpd/TcpServer.pm,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -w -r1.5 -r1.6
  --- TcpServer.pm	24 Sep 2002 10:56:35 -0000	1.5
  +++ TcpServer.pm	15 Apr 2003 17:01:43 -0000	1.6
  @@ -1,5 +1,7 @@
   package Qpsmtpd::TcpServer;
   use Qpsmtpd::SMTP;
  +use Qpsmtpd::Constants;
  +
   @ISA = qw(Qpsmtpd::SMTP);
   use strict;
   
  @@ -25,7 +27,8 @@
       # should be somewhere in Qpsmtpd.pm and not here...
       $self->load_plugins;
   
  -    $self->start_conversation;
  +    my $rc = $self->start_conversation;
  +    return if $rc != DONE;
   
       # this should really be the loop and read_input should just get one line; I think
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.