Fix for tls enabling auth - this is kind of hacky, and I'd prefer to fix

this nastiness in the auth support instead. But this works for now.


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@541 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
Matt Sergeant 2005-08-15 17:58:41 +00:00
parent ff4c5d1ff2
commit 79ecf24218

View File

@ -40,6 +40,21 @@ sub init {
) or die "Could not create SSL context: $!"; ) or die "Could not create SSL context: $!";
$self->ssl_context($ssl_ctx); $self->ssl_context($ssl_ctx);
# Check for possible AUTH mechanisms
HOOK: foreach my $hook ( keys %{$qp->{hooks}} ) {
if ( $hook =~ m/^auth-?(.+)?$/ ) {
if ( defined $1 ) {
my $hooksub = "hook_$hook";
$hooksub =~ s/\W/_/g;
*$hooksub = \&bad_ssl_hook;
}
else { # at least one polymorphous auth provider
*hook_auth = \&bad_ssl_hook;
}
}
}
} }
sub hook_ehlo { sub hook_ehlo {
@ -143,4 +158,4 @@ sub bad_ssl_hook {
return DENY, "Command refused due to lack of security" if $transaction->notes('ssl_failed'); return DENY, "Command refused due to lack of security" if $transaction->notes('ssl_failed');
return DECLINED; return DECLINED;
} }
*hook_helo = *hook_data = *hook_rcpt = *hook_mail = *hook_auth = \&bad_ssl_hook; *hook_helo = *hook_data = *hook_rcpt = *hook_mail = \&bad_ssl_hook;