> On 07 Apr 2016, at 13:13, Michiel van Es <m...@pragmasec.nl> wrote:
>> On 07 Apr 2016, at 12:59, Joerg Jung <m...@umaxx.net> wrote:
>> 
>> Ok... that makes sense now.
>> -2 seems to be EAI_NONAME which seems to be the error code specific on 
>> Ubuntu libc for NXDOMAIN replies, instead of EAI_NODATA.
>> 
>> These error codes and related RFCs are subject to a lot of discussions.
>> See here to get an idea: 
>> https://sourceware.org/bugzilla/show_bug.cgi?id=15726
>> Especially, note the cross references to Ubuntu bugs ...
>> 
>> Instead of trying to fit all distribution specific changes,
>> the easiest might be to change the logic here and check for the returned 
>> address not being empty -- instead of errno.
>> 
>> I'll try to come up with a proper diff to fix this, but give me some time as 
>> I'm very busy currently.
>> 
>> As quick fix: you can just change the if statement to:
>> if (ar->ar_gai_errno != EAI_NODATA && ar->ar_gai_errno != EAI_NONAME) {
> 
> like this? =>

yes.

> dnsbl_event_dispatch(struct asr_result *ar, void *arg)
> {
>        uint64_t *q = arg;
> 
>        if (ar->ar_addrinfo)
>                freeaddrinfo(ar->ar_addrinfo);
>        log_warnx("warn: DEBUG: ar_gai_errno=%d, EAI_NODATA=%d", 
> ar->ar_gai_errno, EAI_NODATA);
>        if (ar->ar_gai_errno != EAI_NODATA && ar->ar_gai_errno != EAI_NONAME) {
>                log_warnx("warn: session %016"PRIx64": event_dispatch: REJECT 
> address ar_gai_errno=%d", *q, ar->ar_gai_errno);
>                filter_api_reject_code(*q, FILTER_CLOSE, 554, "5.7.1 Address 
> in DNSBL");
>        } else
>                filter_api_accept(*q);
>        free(q);
> }
> 
>> ... and it should start working as expected. Can you confirm that, please?
> 
> if above is correct, it did not work:
> 
> dnsbl[26098]: warn: DEBUG: ar_gai_errno=-5, EAI_NODATA=-2
> dnsbl[26098]: warn: session de57c06bd67994d3: event_dispatch: REJECT address 
> ar_gai_errno=-5
> filter: imsg IMSG_FILTER_RESPONSE from procfilter 
> dnsbl[hooks=0xffffffff,flags=0x0000]
> filter: filter_drain_query de57c06c3dc0ecca[QUERY_CONNECT=178.21.114.197 <-> 
> 185.14.168.222(pro-mail-smtp-001.bol.com),filter_session@0x1588030[datalen=0,eom=(nil),ofile=(nil)]]
> filter: filter_end_query de57c06c3dc0ecca[QUERY_CONNECT=178.21.114.197 <-> 
> 185.14.168.222(pro-mail-smtp-001.bol.com),filter_session@0x1588030[datalen=0,eom=(nil),ofile=(nil)]]
> filter: query de57c06c3dc0ecca done: status=FILTER_CLOSE code=554 
> response="5.7.1 Address in DNSBL"
> smtp-in: Failed command on session de57c06bd67994d3: "" => 554 5.7.1 Address 
> in DNSBL
> smtp-in: Closing session de57c06bd67994d3
> debug: smtp: 0x1655cf0: deleting session: done
> filter: post-event event=EVENT_DISCONNECT filter=dnsbl
> ^Cinfo: queue handler exiting
> info: scheduler handler exiting
> info: ca agent exiting
> warn: control -> queue: pipe closed
> warn: lka -> queue: pipe closed
> strace: Process 26091 detached
> 

Ok can change the added DEBUG line right before the if statement once again to:

log_warnx("warn: DEBUG: ar_gai_errno=%d, EAI_NODATA=%d, EAI_NONAME=%d, 
gai_strerror=‘%s'", ar->ar_gai_errno, EAI_NODATA, EAI_NONAME, 
gai_strerror(ar->ar_gai_errno));

… and show me output?



--
You received this mail because you are subscribed to misc@opensmtpd.org
To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org

Reply via email to