Good morning,

is there a way to match a rule when the response from an RBL is NXDOMAIN? I wrote a function to do a particular lookup, and I both get valuable informations from an actual 127.0.0.x return code AND if response is NXDOMAIN.

.cf file:

header        SH_TEST eval:check_test('<redacted>.spamhaus.net', '')
priority      SH_TEST -100

the "check_test" function does the lookup like this:

$ent = $pms->{async}->bgsend_and_start_lookup($lookup,'A', undef, $ent,sub{
my($ent,$pkt)= @_;
$self->_finish_lookup($pms,$ent,$pkt,$subtest);
   }, master_deadline => $pms->{master_deadline});

and in the debug I see:

dbg: dns: dns reply to 43858/IN/A/<redacted>.spamhaus.net: NXDOMAIN

I tried putting "NXDOMAIN" in the sub-test part of the rule definition, or leaving it blank, but it never triggers on NXDOMAIN

Of course it works if I explicitly put a return code.

Is there a "right" way to do something like this, or do I need to take care of it in the "check_test" function?

Thank you for any pointer

--
Best regards,
Riccardo Alfieri

Spamhaus Technology
https://www.spamhaus.com/

Reply via email to