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

@ -265,26 +265,25 @@ sub auth_parse_respond {
unless ($ok == OK); unless ($ok == OK);
$mechanism = lc($mechanism); $mechanism = lc($mechanism);
#they AUTH'd once already #they AUTH'd once already
return $self->respond( 503, "but you already said AUTH ..." ) return $self->respond( 503, "but you already said AUTH ..." )
if ( defined $self->{_auth} if ( defined $self->{_auth} && $self->{_auth} == OK );
and $self->{_auth} == OK );
return $self->respond( 503, "AUTH not defined for HELO" ) return $self->respond( 503, "AUTH not defined for HELO" )
if ( $self->connection->hello eq "helo" ); if ( $self->connection->hello eq "helo" );
return $self->respond( 503, "SSL/TLS required before AUTH" ) return $self->respond( 503, "SSL/TLS required before AUTH" )
if ( ($self->config('tls_before_auth'))[0] 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)} ) { if( exists $auth_mechanisms{uc($mechanism)} ) {
return $self->{_auth} = Qpsmtpd::Auth::SASL( $self, $mechanism, @stuff ); 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 { sub mail {