From 0d8d9f03b86957bea7dfe1a38361d05ba31ebfca Mon Sep 17 00:00:00 2001 From: Matt Sergeant Date: Mon, 15 Aug 2005 18:43:19 +0000 Subject: [PATCH] Merge from trunk r540:541 git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.31@542 958fd67b-6ff1-0310-b445-bb7760255be9 --- plugins/tls | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/plugins/tls b/plugins/tls index 0e3a789..30dc927 100644 --- a/plugins/tls +++ b/plugins/tls @@ -41,6 +41,21 @@ sub init { # now extract the password... $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 { @@ -133,4 +148,4 @@ sub bad_ssl_hook { return DENY, "Command refused due to lack of security" if $transaction->notes('ssl_failed'); 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;