From fea300ed2ea28e6598e54a1aa15e55f314c9a154 Mon Sep 17 00:00:00 2001 From: John Peacock Date: Wed, 7 Feb 2007 21:49:45 +0000 Subject: [PATCH] Add authenticated method to base Qpsmtpd object. Add _auth field to PollServer. Make sure that check_earlytalker works with PollServer. git-svn-id: https://svn.perl.org/qpsmtpd/trunk@711 958fd67b-6ff1-0310-b445-bb7760255be9 --- lib/Qpsmtpd.pm | 5 +++++ lib/Qpsmtpd/PollServer.pm | 1 + plugins/check_earlytalker | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/Qpsmtpd.pm b/lib/Qpsmtpd.pm index ac6c70c..aa778a2 100644 --- a/lib/Qpsmtpd.pm +++ b/lib/Qpsmtpd.pm @@ -497,6 +497,11 @@ sub size_threshold { return $Size_threshold; } +sub authenticated { + my $self = shift; + return (defined $self->{_auth} ? $self->{_auth} : "" ); +} + sub auth_user { my $self = shift; return (defined $self->{_auth_user} ? $self->{_auth_user} : "" ); diff --git a/lib/Qpsmtpd/PollServer.pm b/lib/Qpsmtpd/PollServer.pm index f2de0dc..a22b5ed 100644 --- a/lib/Qpsmtpd/PollServer.pm +++ b/lib/Qpsmtpd/PollServer.pm @@ -15,6 +15,7 @@ use fields qw( hooks start_time cmd_timeout + _auth _auth_mechanism _auth_state _auth_ticket diff --git a/plugins/check_earlytalker b/plugins/check_earlytalker index 9987675..b35aa71 100644 --- a/plugins/check_earlytalker +++ b/plugins/check_earlytalker @@ -66,7 +66,7 @@ sub register { 'defer-reject' => 0, @args, }; - if ($qp->{conn} && $qp->{conn}->isa('Apache2::Connection')) { + if (exists $qp->{conn} && $qp->{conn}->isa('Apache2::Connection')) { require APR::Const; APR::Const->import(qw(POLLIN SUCCESS)); $self->register_hook('connect', 'apr_connect_handler');