Philip Gladstone wrote:
> The issue is that it used the register_hook and run_hooks functionality
> in an idosyncratic way -- it would register hooks with peculiar names
> and then (maybe) invoke them later.
I take it you mean that it is no longer possible for *some* *other* plugin to
register random hooks, like "user_delivery" and "exec_$cmd" were added. Other
than that, check_delivery itself should hardly need any tweaks to run in a more
modern qpsmtpd.
I'd think something like this should be mostly sufficient (untested):
package Qpsmtpd::Plugin;
...
sub register_custom_hook {
my ($self, $custom) = @_;
die "$custom hook already defined" if exists $hooks{$custom};
push @hooks, $custom;
$hooks{$custom} = 1;
return 1;
}
...
Then in check_delivery::init (replaces register):
...
$self->register_custom_hook("user_delivery");
...
but I'm not sure how to best handle the "exec_$cmd" polymorphous hook.
John