diff --git a/lib/Qpsmtpd.pm b/lib/Qpsmtpd.pm index a17f242..f77c251 100644 --- a/lib/Qpsmtpd.pm +++ b/lib/Qpsmtpd.pm @@ -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); diff --git a/t/qpsmtpd.t b/t/qpsmtpd.t index 4c81d8c..982bb67 100644 --- a/t/qpsmtpd.t +++ b/t/qpsmtpd.t @@ -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',