diff --git a/Changes b/Changes index c305f0a..c5cbcbe 100644 --- a/Changes +++ b/Changes @@ -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) diff --git a/config.sample/rcpthosts b/config.sample/rcpthosts new file mode 100644 index 0000000..2fbb50c --- /dev/null +++ b/config.sample/rcpthosts @@ -0,0 +1 @@ +localhost diff --git a/t/plugin_tests/rcpt_ok b/t/plugin_tests/rcpt_ok new file mode 100644 index 0000000..6d71d1e --- /dev/null +++ b/t/plugin_tests/rcpt_ok @@ -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(''); + 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(''); + ($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); +}