Gordon Rowell wrote:
--- plugins/check_badrcptto.orig 2005-07-02 17:13:11.000000000 +1000
+++ plugins/check_badrcptto 2005-07-02 17:13:18.000000000 +1000
--- plugins/rhsbl.orig 2005-07-02 17:15:11.000000000 +1000
+++ plugins/rhsbl 2005-07-02 17:15:29.000000000 +1000
--- plugins/dnsbl.orig 2005-07-02 12:17:32.000000000 +1000
+++ plugins/dnsbl 2005-07-02 17:17:00.000000000 +1000
These three I'm not going to commit (without discussion), because I don't like
the code duplication involved. Rather than patching every plugin to respect the
check_relay() setting (and yes, I know, I have done this recently), and remember
to add that code to any *new* plugin, I'd rather have a relay_ok() plugin which
hooked mail and rcpt and just shortcircuits the tests, thus making it is site
preference to do this rather than global.
Something like this (not tested), loaded after all connect plugins but before
any mail or rcpt plugins:
sub register {
my ($self, $qp) = @_;
$self->register_hook("mail", "relay_ok");
$self->register_hook("rcpt", "relay_ok");
}
sub relay_ok {
my $self = shift;
if $self->qp->connection->relay_client() {
return OK;
}
else {
return DECLINED;
}
}
In particular, it might be desireable to _not_ use the above plugin, even in
your outbound e-mail server, because worms are getting smarter. It might be
necessary to check even trusted hosts for wormspawn, so having the
relay_client() test embedded in each plugin would make it that much harder to do.
John