qpsmtpd/t/plugin_tests/rcpt_ok
2010-07-25 23:04:58 -07:00

23 lines
638 B
Plaintext

sub register_tests {
my $self = shift;
$self->register_test("test_returnval", 2);
$self->register_test("rcpt_ok", 1);
}
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");
}
sub rcpt_ok {
ok(1);
}