Rename Qpsmtpd::Auth to README.authentication.

Replace tabs with spaces in a few plugins.


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@606 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
John Peacock 2006-01-26 21:36:34 +00:00
parent 654179e8c8
commit 29d739b009
4 changed files with 14 additions and 21 deletions

View File

@ -1,8 +1,10 @@
#!/usr/bin/perl -w #
# read this with 'perldoc README.authentication' ...
#
=head1 NAME =head1 NAME
Qpsmtpd::Auth - Authentication framework for qpsmtpd Authentication framework for qpsmtpd
=head1 DESCRIPTION =head1 DESCRIPTION
@ -15,7 +17,7 @@ for more details.
=head1 USAGE =head1 USAGE
This module is automatically loaded by Qpsmtpd::SMTP only if a plugin This code is automatically loaded by Qpsmtpd::SMTP only if a plugin
providing one of the defined L<Auth Hooks> is loaded. The only providing one of the defined L<Auth Hooks> is loaded. The only
time this can happen is if the client process employs the EHLO command to time this can happen is if the client process employs the EHLO command to
initiate the SMTP session. If the client uses HELO, the AUTH command is initiate the SMTP session. If the client uses HELO, the AUTH command is
@ -30,14 +32,14 @@ All plugins must provide two functions:
=over 4 =over 4
=item * register() =item * init()
This is the standard function which is called by qpsmtpd for any plugin This is the standard function which is called by qpsmtpd for any plugin
listed in config/plugins. Typically, an auth plugin should register at listed in config/plugins. Typically, an auth plugin should register at
least one hook, like this: least one hook, like this:
sub register { sub init {
my ($self, $qp) = @_; my ($self, $qp) = @_;
$self->register_hook("auth", "authfunction"); $self->register_hook("auth", "authfunction");
@ -205,7 +207,7 @@ John Peacock <jpeacock@cpan.org>
=head1 COPYRIGHT AND LICENSE =head1 COPYRIGHT AND LICENSE
Copyright (c) 2004 John Peacock Copyright (c) 2004-2006 John Peacock
Portions based on original code by Ask Bjoern Hansen and Guillaume Filion Portions based on original code by Ask Bjoern Hansen and Guillaume Filion
@ -213,5 +215,3 @@ This plugin is licensed under the same terms as the qpsmtpd package itself.
Please see the LICENSE file included with qpsmtpd for details. Please see the LICENSE file included with qpsmtpd for details.
=cut =cut
1;

View File

@ -44,10 +44,10 @@ sub hook_logging { # wlog
return DECLINED if defined $plugin and $plugin eq $self->plugin_name; return DECLINED if defined $plugin and $plugin eq $self->plugin_name;
if ( defined $self->{_maxlevel} && $trace <= $self->{_maxlevel} ) { if ( defined $self->{_maxlevel} && $trace <= $self->{_maxlevel} ) {
my $fd = $self->fd(); my $fd = $self->fd();
warn join( warn join(
" ", $$. " ", $$.
(defined $fd ? " fd:$fd" : "") . (defined $fd ? " fd:$fd" : "") .
( (
defined $plugin ? " $plugin plugin:" defined $plugin ? " $plugin plugin:"
: defined $hook ? " running plugin ($hook):" : defined $hook ? " running plugin ($hook):"

View File

@ -10,10 +10,10 @@ sub register {
$self->{_level} = LOGWARN; $self->{_level} = LOGWARN;
if ( defined($loglevel) ) { if ( defined($loglevel) ) {
if ($loglevel =~ /^\d+$/) { if ($loglevel =~ /^\d+$/) {
$self->{_level} = $loglevel; $self->{_level} = $loglevel;
} }
else { else {
$self->{_level} = log_level($loglevel); $self->{_level} = log_level($loglevel);
} }
} }

View File

@ -7,13 +7,6 @@ our $MAILS_RECEIVED = 0;
our $MAILS_REJECTED = 0; our $MAILS_REJECTED = 0;
our $MAILS_TEMPFAIL = 0; our $MAILS_TEMPFAIL = 0;
sub register {
my ($self) = @_;
$self->register_hook('deny', 'increment_deny');
$self->register_hook('queue', 'increment_mails');
}
sub get_stats { sub get_stats {
my $class = shift; my $class = shift;
my $uptime = $class->uptime; my $uptime = $class->uptime;
@ -29,7 +22,7 @@ sub get_stats {
$uptime, $recvd, $reject, $soft, $rate); $uptime, $recvd, $reject, $soft, $rate);
} }
sub increment_deny { sub hook_deny {
my ($self, $tran, $plugin, $level) = @_; my ($self, $tran, $plugin, $level) = @_;
if ($level == DENY or $level == DENY_DISCONNECT) { if ($level == DENY or $level == DENY_DISCONNECT) {
@ -42,7 +35,7 @@ sub increment_deny {
return DECLINED; return DECLINED;
} }
sub increment_mails { sub hook_mail {
my $self = shift; my $self = shift;
$MAILS_RECEIVED++; $MAILS_RECEIVED++;