qpsmtpd/t/plugin_tests/dnsbl
Matt Sergeant 2ca6e9d192 MERGE 503:505 FROM https://svn.perl.org/qpsmtpd/branches/0.31
Fix test failures due to hook renames
Fix redefined warnings due to hook renames


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@507 958fd67b-6ff1-0310-b445-bb7760255be9
2005-07-14 13:31:07 +00:00

28 lines
684 B
Plaintext

sub register_tests {
my $self = shift;
$self->register_test("test_local", 1);
$self->register_test("test_returnval", 1);
}
sub test_local {
my $self = shift;
my $connection = $self->qp->connection;
$connection->remote_ip('127.0.0.2'); # standard dnsbl test value
$self->hook_connect($self->qp->transaction);
ok($self->qp->connection->notes('dnsbl_sockets'));
}
sub test_returnval {
my $self = shift;
my $address = Qpsmtpd::Address->parse('<rcpt@example.com>');
my ($ret, $note) = $self->hook_rcpt($self->qp->transaction,
$address);
is($ret, DENY, "Check we got a DENY");
print("# dnsbl result: $note\n");
}