cvsuser     03/06/24 00:42:38

  Modified:    lib/Qpsmtpd Constants.pm SMTP.pm
  Log:
  Added DISCARD option to DATA (body) checks
  Added documentation to Constants.pm
  
  Revision  Changes    Path
  1.3       +41 -4     qpsmtpd/lib/Qpsmtpd/Constants.pm
  
  Index: Constants.pm
  ===================================================================
  RCS file: /cvs/public/qpsmtpd/lib/Qpsmtpd/Constants.pm,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -w -r1.2 -r1.3
  --- Constants.pm      8 Sep 2002 13:52:12 -0000       1.2
  +++ Constants.pm      24 Jun 2003 07:42:38 -0000      1.3
  @@ -2,7 +2,7 @@
   use strict;
   require Exporter;
   
  -my (@common) = qw(OK DECLINED DONE DENY DENYSOFT TRACE);
  +my (@common) = qw(OK DECLINED DONE DENY DENYSOFT TRACE DISCARD);
   
   use vars qw($VERSION @ISA @EXPORT);
   @ISA    = qw(Exporter);
  @@ -15,6 +15,7 @@
   use constant DENYSOFT => 902;
   use constant DECLINED => 909;
   use constant DONE     => 910;
  +use constant DISCARD  => 920;
   
   
   1;
  @@ -22,9 +23,45 @@
   
   =head1 NAME
   
  -Qpsmtpd::Constants - Constants should be defined here
  +Qpsmtpd::Constants - Constants for plugins to use
   
  -=head1 SYNOPSIS
  +=head1 CONSTANTS
   
  -Not sure if we are going to use this...
  +Constants available:
   
  +=over 4
  +
  +=item C<OK>
  +
  +Return this only from the queue phase to indicate the mail was queued
  +successfully.
  +
  +=item C<DENY>
  +
  +Returning this from a hook causes a 5xx error (hard failure) to be
  +returned to the connecting client.
  +
  +=item C<DENYSOFT>
  +
  +Returning this from a hook causes a 4xx error (temporary failure - try
  +again later) to be returned to the connecting client.
  +
  +=item C<DECLINED>
  +
  +Returning this from a hook implies success, but tells qpsmtpd to go
  +on to the next plugin.
  +
  +=item C<DONE>
  +
  +Returning this from a hook implies success, but tells qpsmtpd to
  +skip any remaining plugins for this phase.
  +
  +=item C<DISCARD>
  +
  +This can only be returned for the DATA phase. It tells qpsmtpd to
  +return 250 to the client implying delivery success, but silently
  +drops the email.
  +
  +=back
  +
  +=cut
  
  
  
  1.14      +3 -0      qpsmtpd/lib/Qpsmtpd/SMTP.pm
  
  Index: SMTP.pm
  ===================================================================
  RCS file: /cvs/public/qpsmtpd/lib/Qpsmtpd/SMTP.pm,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -w -r1.13 -r1.14
  --- SMTP.pm   21 Apr 2003 09:42:01 -0000      1.13
  +++ SMTP.pm   24 Jun 2003 07:42:38 -0000      1.14
  @@ -403,6 +403,9 @@
     elsif ($rc == DENYSOFT) {
       $self->respond(452, $msg || "Message denied temporarily");
     } 
  +  elsif ($rc == DISCARD) {
  +    $self->respond(250, $msg || "Message quietly discarded");
  +  }
     else {
       $self->queue($self->transaction);    
     }
  
  
  

Reply via email to