2007-03-15 07:55:24 +01:00
|
|
|
|
|
|
|
sub register_tests {
|
|
|
|
my $self = shift;
|
|
|
|
$self->register_test("test_returnval", 2);
|
2010-07-02 22:42:08 +02:00
|
|
|
$self->register_test("rcpt_ok", 1);
|
2007-03-15 07:55:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
sub test_returnval {
|
|
|
|
my $self = shift;
|
|
|
|
my $address = Qpsmtpd::Address->parse('<me@example.com>');
|
|
|
|
my ($ret, $note) = $self->hook_rcpt($self->qp->transaction, $address);
|
|
|
|
is($ret, DENY, "Check we got a DENY");
|
|
|
|
print("# rcpt_ok result: $note\n");
|
|
|
|
$address = Qpsmtpd::Address->parse('<me@localhost>');
|
|
|
|
($ret, $note) = $self->hook_rcpt($self->qp->transaction, $address);
|
|
|
|
is($ret, OK, "Check we got a OK");
|
|
|
|
# print("# rcpt_ok result: $note\n");
|
|
|
|
}
|
|
|
|
|
2010-07-02 22:42:08 +02:00
|
|
|
sub rcpt_ok {
|
2007-03-15 07:55:24 +01:00
|
|
|
ok(1);
|
|
|
|
}
|