Added tests for the rcpt_ok plugin (Guy Hulbert, issue #4)

http://code.google.com/p/smtpd/issues/detail?id=4



git-svn-id: https://svn.perl.org/qpsmtpd/trunk@725 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
Ask Bjørn Hansen 2007-03-15 06:55:24 +00:00
parent 5c9e3d6004
commit 313f285847
3 changed files with 25 additions and 0 deletions

View File

@ -1,5 +1,7 @@
0.33 (to be)
Added tests for the rcpt_ok plugin (Guy Hulbert, issue #4)
greylisting: fix db_dir configuration option so it actually works
(kitno455, issue #6)

1
config.sample/rcpthosts Normal file
View File

@ -0,0 +1 @@
localhost

22
t/plugin_tests/rcpt_ok Normal file
View File

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