The unrecognized_command hook now understands the DENY_DISCONNECT return
and the DENY return is deprecated. git-svn-id: https://svn.perl.org/qpsmtpd/trunk@473 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
parent
d48cd2e37e
commit
4f0c4d94a1
7
Changes
7
Changes
@ -2,6 +2,8 @@
|
||||
|
||||
qpsmtpd-forkserver: --listen-address may now be given more than once, to
|
||||
request listening on multiple local addresses (Devin Carraway)
|
||||
(also: no more signal problems making qpsmtpd-forkserver crash/loop
|
||||
when forking).
|
||||
|
||||
qpsmtpd-forkserver: add an option for writing a PID file (pjh)
|
||||
|
||||
@ -12,6 +14,11 @@
|
||||
when disconncting with a temporary failure, return 421 rather than
|
||||
450 or 451. (Peter J. Holzer)
|
||||
|
||||
The unrecognized_command hook now understands the DENY_DISCONNECT return
|
||||
and the DENY return is deprecated.
|
||||
|
||||
Updated documentation
|
||||
|
||||
|
||||
0.30 - 2005/07/05
|
||||
|
||||
|
@ -189,7 +189,7 @@ Works like the "connect" hook.
|
||||
|
||||
Called when we get a command that isn't recognized.
|
||||
|
||||
DENY - Return 521 and disconnect the client
|
||||
DENY_DISCONNECT - Return 521 and disconnect the client
|
||||
DONE - Qpsmtpd won't do anything; the plugin responded
|
||||
Anything else - Return '500 Unrecognized command'
|
||||
|
||||
|
@ -52,7 +52,9 @@ sub dispatch {
|
||||
|
||||
if ($cmd !~ /^(\w{1,12})$/ or !exists $self->{_commands}->{$1}) {
|
||||
my ($rc, $msg) = $self->run_hooks("unrecognized_command", $cmd);
|
||||
if ($rc == DENY) {
|
||||
if ($rc == DENY_DISCONNECT or $rc == DENY) {
|
||||
$self->log(LOGWARN, "Returning DENY for the unrecognized_command hook is deprecated; use DENY_DISCONNECT")
|
||||
if $rc == DENY;
|
||||
$self->respond(521, $msg);
|
||||
$self->disconnect;
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ sub check_unrec_cmd {
|
||||
|
||||
if ($badcmdcount >= $self->{_unrec_cmd_max}) {
|
||||
$self->log(LOGINFO, "Closing connection. Too many unrecognized commands.");
|
||||
return (DENY, "Closing connection. $badcmdcount unrecognized commands. Perhaps you should read RFC 2821?");
|
||||
return (DENY_DISCONNECT, "Closing connection. $badcmdcount unrecognized commands. Perhaps you should read RFC 2821?");
|
||||
}
|
||||
|
||||
return DECLINED;
|
||||
|
Loading…
Reference in New Issue
Block a user