develooper Front page | perl.cvs.qpsmtpd | Postings from January 2006

[svn:qpsmtpd] r606 - in trunk: . lib/Qpsmtpd plugins plugins/logging

From:
jpeacock
Date:
January 26, 2006 13:36
Subject:
[svn:qpsmtpd] r606 - in trunk: . lib/Qpsmtpd plugins plugins/logging
Message ID:
20060126213634.29703.qmail@x1.develooper.com
Author: jpeacock
Date: Thu Jan 26 13:36:34 2006
New Revision: 606

Added:
   trunk/README.authentication
      - copied, changed from r605, trunk/lib/Qpsmtpd/Auth.pm
Removed:
   trunk/lib/Qpsmtpd/Auth.pm
Modified:
   trunk/plugins/logging/adaptive
   trunk/plugins/logging/warn
   trunk/plugins/stats
Log:
Rename Qpsmtpd::Auth to README.authentication.
Replace tabs with spaces in a few plugins.


Copied: trunk/README.authentication (from r605, trunk/lib/Qpsmtpd/Auth.pm)
==============================================================================
--- trunk/lib/Qpsmtpd/Auth.pm	(original)
+++ trunk/README.authentication	Thu Jan 26 13:36:34 2006
@@ -1,8 +1,10 @@
-#!/usr/bin/perl -w
+#
+# read this with 'perldoc README.authentication'  ...
+#
 
 =head1 NAME
 
-Qpsmtpd::Auth - Authentication framework for qpsmtpd
+Authentication framework for qpsmtpd
 
 =head1 DESCRIPTION
 
@@ -15,7 +17,7 @@ for more details.
 
 =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
 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
@@ -30,14 +32,14 @@ All plugins must provide two functions:
 
 =over 4
 
-=item * register()
+=item * init()
 
 This is the standard function which is called by qpsmtpd for any plugin 
 listed in config/plugins.  Typically, an auth plugin should register at
 least one hook, like this:
 
 
-  sub register {
+  sub init {
     my ($self, $qp) = @_;
 
     $self->register_hook("auth", "authfunction");
@@ -205,7 +207,7 @@ John Peacock <jpeacock@cpan.org>
 
 =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
 
@@ -213,5 +215,3 @@ This plugin is licensed under the same t
 Please see the LICENSE file included with qpsmtpd for details.
 
 =cut
-
-1;

Modified: trunk/plugins/logging/adaptive
==============================================================================
--- trunk/plugins/logging/adaptive	(original)
+++ trunk/plugins/logging/adaptive	Thu Jan 26 13:36:34 2006
@@ -44,10 +44,10 @@ sub hook_logging { # wlog
     return DECLINED if defined $plugin and $plugin eq $self->plugin_name;
 
     if ( defined $self->{_maxlevel} && $trace <= $self->{_maxlevel} ) {
-	my $fd = $self->fd();
+        my $fd = $self->fd();
         warn join(
             " ", $$.
-	    (defined $fd ? " fd:$fd" : "") .
+            (defined $fd ? " fd:$fd" : "") .
             (
                   defined $plugin ? " $plugin plugin:"
                 : defined $hook   ? " running plugin ($hook):"

Modified: trunk/plugins/logging/warn
==============================================================================
--- trunk/plugins/logging/warn	(original)
+++ trunk/plugins/logging/warn	Thu Jan 26 13:36:34 2006
@@ -10,10 +10,10 @@ sub register {
   $self->{_level} = LOGWARN;
   if ( defined($loglevel) ) {
       if ($loglevel =~ /^\d+$/) {
-	  $self->{_level} = $loglevel;
+          $self->{_level} = $loglevel;
       }
       else {
-	  $self->{_level} = log_level($loglevel);
+          $self->{_level} = log_level($loglevel);
       }
   }
 

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



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About