Don't interpret invalid return codes as OK

This commit is contained in:
Jared Johnson 2015-02-03 17:01:52 -06:00
parent b24f766cc5
commit dcdda3a5e7
2 changed files with 11 additions and 6 deletions

View File

@ -302,6 +302,10 @@ sub run_continuation {
$self->log(LOGERROR, $log_msg . "undef!");
next;
}
if ( !return_code($r[0]) ) {
$self->log(LOGERROR, $log_msg . $r[0]);
next;
}
if ($tran) {
my $tnotes = $tran->notes($name);

View File

@ -149,12 +149,13 @@ sub __run_continuation {
descr => 'DECLINED -> DENY',
},
# TODO: ignore invalid return codes rather than treating them like OK
#{
# hooks => [ [123456,undef], [DENY, 'goaway'] ],
# expected_response => '550/goaway',
# disconnected => 0,
# descr => 'INVALID -> DENY',
#},
{
hooks => [ [123456,undef], [DENY, 'goaway'] ],
expected_response => '550/goaway',
disconnected => 0,
logged => 'LOGERROR:Plugin ___FakeHook___, hook helo returned 123456',
descr => 'INVALID -> DENY',
},
{
hooks => [ sub { die "dead\n" }, [DENY, 'begone'] ],
expected_response => '550/begone',