cvs commit: qpsmtpd/lib/Qpsmtpd SMTP.pm

[email protected] (Robert Spier)
Newsgroups perl.cvs.qpsmtpd
Message-ID <[email protected]>
cvsuser     04/09/04 21:30:21

  Modified:    .        README.plugins
               lib/Qpsmtpd SMTP.pm
  Log:
  VRFY plugin support
  
  Revision  Changes    Path
  1.10      +12 -0     qpsmtpd/README.plugins
  
  Index: README.plugins
  ===================================================================
  RCS file: /cvs/public/qpsmtpd/README.plugins,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -w -r1.9 -r1.10
  --- README.plugins	4 Sep 2004 03:38:14 -0000	1.9
  +++ README.plugins	5 Sep 2004 04:30:21 -0000	1.10
  @@ -159,6 +159,18 @@
   Returning DONE or OK will stop the next deny hook from being run.
   DECLINED will make qpsmtpd run the remaining configured deny hooks.
   
  +=head2 vrfy
  +
  +Hook for the "VRFY" command.  Defaults to returning a message telling
  +the user to just try sending the message.
  +
  +Allowed return codes:
  +
  +   OK       - Recipient Exists
  +   DENY     - Return a hard failure code
  +   DONE     - Return nothing and move on
  +   Anything Else - Return a 252
  +
   =head1 Return Values and Notes
   
   Insert stuff here about how:
  
  
  
  1.38      +23 -1     qpsmtpd/lib/Qpsmtpd/SMTP.pm
  
  Index: SMTP.pm
  ===================================================================
  RCS file: /cvs/public/qpsmtpd/lib/Qpsmtpd/SMTP.pm,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -w -r1.37 -r1.38
  --- SMTP.pm	1 Sep 2004 05:56:52 -0000	1.37
  +++ SMTP.pm	5 Sep 2004 04:30:21 -0000	1.38
  @@ -337,7 +337,29 @@
   }
   
   sub vrfy {
  -  shift->respond(252, "Just try sending a mail and we'll see how it turns out ...");
  +  my $self = shift;
  +
  +  # Note, this doesn't support the multiple ambiguous results
  +  # documented in RFC2821#3.5.1
  +  # I also don't think it provides all the proper result codes.
  +
  +  my ($rc, $msg) = $self->run_hooks("vrfy");
  +  if ($rc == DONE) {
  +    return 1;
  +  }
  +  elsif ($rc == DENY) {
  +    $self->respond(554, $msg || "Access Denied");
  +    $self->reset_transaction();
  +    return 1;
  +  }
  +  elsif ($rc == OK) {
  +    $self->respond(250, $msg || "User OK");
  +    return 1;
  +  }
  +  else { # $rc == DECLINED or anything else
  +    $self->respond(252, "Just try sending a mail and we'll see how it turns out ...");
  +    return 1;
  +  }
   }
   
   sub rset {
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.