On Tue, 13 May 2008 18:40:51 +0100 Pedro Melo <[EMAIL PROTECTED]> wrote: > On May 12, 2008, at 4:59 PM, Hanno Hecker wrote: > > The main disadvantage of having plugins as regular perl modules is, > > that you can not load them twice like "normal" qpsmtpd plugins (by > > using > > my_plugin some_arg > > my_plugin:0 other_arg > > ...) > > Maybe if you create two instances of the my_plugin with the different > parameters. Normal plugins (like rcpt_ok) can be loaded twice by appending :N to the plugin name with N being a postive integer. This N is also used for the namespace of this plugin, so no clashes appear.
Plugins as perl packages (My::Plugin) must have at least one "::" in their name (no problem, all plugins will probably have a Qpsmtpd::Plugin:: and can not be loaded twice. Attempting to load these twice would either overwrite the first or the second load will fail (I haven't tried yet). The normal plugin's namespace is set at loading time, while a packages namespace is set in it's "package My::Plugin;" line. Downloading plugins as packages from CPAN and then copy it to another name and edit it can't be the way to go, IMO... Hanno