VRFY plugin support

git-svn-id: https://svn.perl.org/qpsmtpd/trunk@298 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
Robert Spier 2004-09-05 04:30:21 +00:00
parent b6c5ffed1b
commit ee1017a1a4
2 changed files with 35 additions and 1 deletions

View File

@ -159,6 +159,18 @@ hook returned.
Returning DONE or OK will stop the next deny hook from being run. Returning DONE or OK will stop the next deny hook from being run.
DECLINED will make qpsmtpd run the remaining configured deny hooks. 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 =head1 Return Values and Notes
Insert stuff here about how: Insert stuff here about how:

View File

@ -337,7 +337,29 @@ sub noop {
} }
sub vrfy { 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 { sub rset {