2004-09-08 23:48:27 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2005-07-14 15:31:07 +02:00
|
|
|
$self->hook_connect($self->qp->transaction);
|
2004-09-08 23:48:27 +02:00
|
|
|
|
|
|
|
ok($self->qp->connection->notes('dnsbl_sockets'));
|
|
|
|
}
|
|
|
|
|
|
|
|
sub test_returnval {
|
|
|
|
my $self = shift;
|
2005-02-22 01:38:06 +01:00
|
|
|
|
|
|
|
my $address = Qpsmtpd::Address->parse('<rcpt@example.com>');
|
2005-07-14 15:31:07 +02:00
|
|
|
my ($ret, $note) = $self->hook_rcpt($self->qp->transaction,
|
2005-02-22 01:38:06 +01:00
|
|
|
$address);
|
2004-09-08 23:48:27 +02:00
|
|
|
is($ret, DENY, "Check we got a DENY");
|
2004-09-08 23:53:29 +02:00
|
|
|
print("# dnsbl result: $note\n");
|
2004-09-08 23:48:27 +02:00
|
|
|
}
|