diff --git a/lib/Qpsmtpd.pm b/lib/Qpsmtpd.pm index 382aea7..b5b7169 100644 --- a/lib/Qpsmtpd.pm +++ b/lib/Qpsmtpd.pm @@ -230,7 +230,7 @@ sub _load_plugins { my $package = "Qpsmtpd::Plugin::$plugin_name"; # don't reload plugins if they are already loaded - unless ( defined &{"${package}::register"} ) { + unless ( defined &{"${package}::plugin_name"} ) { Qpsmtpd::Plugin->compile($plugin_name, $package, "$dir/$plugin", $self->{_test_mode}); $self->log(LOGDEBUG, "Loading $plugin_line") diff --git a/lib/Qpsmtpd/Plugin.pm b/lib/Qpsmtpd/Plugin.pm index 48f3a43..6f8b124 100644 --- a/lib/Qpsmtpd/Plugin.pm +++ b/lib/Qpsmtpd/Plugin.pm @@ -94,8 +94,8 @@ sub isa_plugin { $cleanParent =~ s/\W/_/g; my $newPackage = $currentPackage."::_isa_$cleanParent"; - - return if defined &{"${newPackage}::register"}; + # don't reload plugins if they are already loaded + return if defined &{"${newPackage}::plugin_name"}; $self->compile($self->plugin_name . "_isa_$cleanParent", $newPackage,