improve readability in SMTP::auth_parse_respond

This commit is contained in:
Matt Simerson 2012-05-04 14:51:35 -04:00 committed by Robert
parent 9b4a0de70a
commit 049d34ee55

View File

@ -266,25 +266,24 @@ sub auth_parse_respond {
$mechanism = lc($mechanism);
#they AUTH'd once already
return $self->respond( 503, "but you already said AUTH ..." )
if ( defined $self->{_auth}
and $self->{_auth} == OK );
if ( defined $self->{_auth} && $self->{_auth} == OK );
return $self->respond( 503, "AUTH not defined for HELO" )
if ( $self->connection->hello eq "helo" );
return $self->respond( 503, "SSL/TLS required before AUTH" )
if ( ($self->config('tls_before_auth'))[0]
and $self->transaction->notes('tls_enabled') );
&& $self->transaction->notes('tls_enabled') );
# if we don't have a plugin implementing this auth mechanism, 504
# we don't have a plugin implementing this auth mechanism, 504
if( exists $auth_mechanisms{uc($mechanism)} ) {
return $self->{_auth} = Qpsmtpd::Auth::SASL( $self, $mechanism, @stuff );
} else {
$self->respond( 504, "Unimplemented authentification mechanism: $mechanism" );
return DENY;
}
};
$self->respond( 504, "Unimplemented authentification mechanism: $mechanism" );
return DENY;
}
sub mail {