Front page | perl.cvs.qpsmtpd |
Postings from May 2007
[svn:qpsmtpd] r737 - in trunk: config.sample lib lib/Qpsmtpd t/Test t/plugin_tests t/plugin_tests/auth
From:
msergeant
Date:
May 17, 2007 15:03
Subject:
[svn:qpsmtpd] r737 - in trunk: config.sample lib lib/Qpsmtpd t/Test t/plugin_tests t/plugin_tests/auth
Author: msergeant
Date: Thu May 17 15:02:32 2007
New Revision: 737
Added:
trunk/config.sample/flat_auth_pw
trunk/t/plugin_tests/auth/auth_flat_file
- copied unchanged from r736, /trunk/t/plugin_tests/auth::auth_flat_file
trunk/t/plugin_tests/auth/authdeny
- copied unchanged from r736, /trunk/t/plugin_tests/auth::authdeny
trunk/t/plugin_tests/auth/authnull
- copied unchanged from r736, /trunk/t/plugin_tests/auth::authnull
Removed:
trunk/t/plugin_tests/auth::auth_flat_file
trunk/t/plugin_tests/auth::authdeny
trunk/t/plugin_tests/auth::authnull
Modified:
trunk/config.sample/plugins
trunk/lib/Qpsmtpd.pm
trunk/lib/Qpsmtpd/Plugin.pm
trunk/t/Test/Qpsmtpd.pm
Log:
Allow plugin tests to be in subdir (as with plugins).
Added: trunk/config.sample/flat_auth_pw
==============================================================================
--- (empty file)
+++ trunk/config.sample/flat_auth_pw Thu May 17 15:02:32 2007
@@ -0,0 +1,2 @@
+good@example.com:good_pass
+bad@example.com:bad_pass
Modified: trunk/config.sample/plugins
==============================================================================
--- trunk/config.sample/plugins (original)
+++ trunk/config.sample/plugins Thu May 17 15:02:32 2007
@@ -35,6 +35,10 @@
# sender_permitted_from
+auth/auth_flat_file
+auth/authnull
+auth/authdeny
+
# this plugin needs to run after all other "rcpt" plugins
rcpt_ok
Modified: trunk/lib/Qpsmtpd.pm
==============================================================================
--- trunk/lib/Qpsmtpd.pm (original)
+++ trunk/lib/Qpsmtpd.pm Thu May 17 15:02:32 2007
@@ -314,7 +314,7 @@
PLUGIN_DIR: for my $dir (@plugin_dirs) {
if (-e "$dir/$plugin") {
Qpsmtpd::Plugin->compile($plugin_name, $package,
- "$dir/$plugin", $self->{_test_mode});
+ "$dir/$plugin", $self->{_test_mode}, $plugin);
$self->log(LOGDEBUG, "Loading $plugin_line from $dir/$plugin")
unless $plugin_line =~ /logging/;
last PLUGIN_DIR;
Modified: trunk/lib/Qpsmtpd/Plugin.pm
==============================================================================
--- trunk/lib/Qpsmtpd/Plugin.pm (original)
+++ trunk/lib/Qpsmtpd/Plugin.pm Thu May 17 15:02:32 2007
@@ -127,7 +127,7 @@
# why isn't compile private? it's only called from Plugin and Qpsmtpd.
sub compile {
- my ($class, $plugin, $package, $file, $test_mode) = @_;
+ my ($class, $plugin, $package, $file, $test_mode, $orig_name) = @_;
my $sub;
open F, $file or die "could not open $file: $!";
@@ -140,9 +140,9 @@
my $line = "\n#line 0 $file\n";
if ($test_mode) {
- if (open(F, "t/plugin_tests/$plugin")) {
+ if (open(F, "t/plugin_tests/$orig_name")) {
local $/ = undef;
- $sub .= "#line 1 t/plugin_tests/$plugin\n";
+ $sub .= "#line 1 t/plugin_tests/$orig_name\n";
$sub .= <F>;
close F;
}
Modified: trunk/t/Test/Qpsmtpd.pm
==============================================================================
--- trunk/t/Test/Qpsmtpd.pm (original)
+++ trunk/t/Test/Qpsmtpd.pm Thu May 17 15:02:32 2007
@@ -75,7 +75,7 @@
}
sub log {
- my ($self, $trace, @log) = @_;
+ my ($self, $trace, $hook, $plugin, @log) = @_;
my $level = Qpsmtpd::TRACE_LEVEL();
$level = $self->init_logger unless defined $level;
print("# " . join(" ", $$, @log) . "\n") if $trace <= $level;
-
[svn:qpsmtpd] r737 - in trunk: config.sample lib lib/Qpsmtpd t/Test t/plugin_tests t/plugin_tests/auth
by msergeant