On Thu, Apr 07, 2016 at 04:41:57PM +0200, Michiel van Es wrote: > > On 07 Apr 2016, at 16:37, Michiel van Es <[email protected]> wrote: > >> On 07 Apr 2016, at 16:05, Joerg Jung <[email protected]> wrote: > >>> On 07 Apr 2016, at 14:47, Michiel van Es <[email protected]> wrote: > >>>> On 07 Apr 2016, at 14:40, Joerg Jung <[email protected]> wrote: > >>>> > >>>> 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));
Keep that change please. > >> Wow… what a mess, I think this is what is happening: > >> > >> - EAI_NODATA is usually -5 aka "No address associated with hostname". > >> > >> - Ubuntu eglibc seems to guard EAI_NODATA behind a #ifdef _GNU_SOURCE in > >> netdb.h, > >> so you may do not have it defined at all. > >> (- Nevertheless the error string is given with gai_strerror() anyway, no > >> matter that EAI_NODATA is not there.) > >> > >> - in case EAI_NODATA is not defined opensmtpd-extras defines EAI_NODATA == > >> EAI_NONAME == -2 in configure.ac > >> -> I think this is wrong and should be done as last resort. The better > >> solution should be to define _GNU_SOURCE to > >> receive EAI_NODATA from standard netdb.h. Can you try the following please: > >> > >> Add the following CFLAGS line to filter-dnsbl Makefile.am line 10: > >> https://github.com/OpenSMTPD/OpenSMTPD-extras/blob/master/extras/wip/filters/filter-dnsbl/Makefile.am > >> > >> CFLAGS += -D_GNU_SOURCE > >> > >> Rebuild everything — it’s important to clear the whole configure cache and > >> re-run sh bootstrap fully, so that this _GNU_SOURCE ends up in the > >> Makefile. > >> > >> Let me know if this helps and fixes the issue. Ok, I was wrong here. _GNU_SOURCE is already defined via openbsd-compat/includes.h So you can drop that Makefile addition, it's useless and too late anyway, sorry. > did a make uninstall after adding the Makefile.am line as instructed, > ./bootstrap;./configure —with-filter-*;make;make install > retested but still no go: > > debug: smtp: new client on listener: 0xebd0f0 > smtp-in: New session 141e1ab081a9e56f from host pro-mail-smtp-002.bol.com > [185.14.169.222] > filter: post-event event=EVENT_CONNECT filter=dnsbl > filter: new query QUERY_CONNECT > filter: filter_drain_query 141e1ab15e6c4024[QUERY_CONNECT=178.21.114.197 <-> > 185.14.169.222(pro-mail-smtp-002.bol.com),filter_session@0xeabff0[datalen=0,eom=(nil),ofile=(nil)]] > filter: running filter filter:dnsbl[hooks=0xffffffff,flags=0x0000] for query > 141e1ab15e6c4024[QUERY_CONNECT=178.21.114.197 <-> > 185.14.169.222(pro-mail-smtp-002.bol.com),filter_session@0xeabff0[datalen=0,eom=(nil),ofile=(nil)]] > filter: waiting for running query > 141e1ab15e6c4024[QUERY_CONNECT=178.21.114.197 <-> > 185.14.169.222(pro-mail-smtp-002.bol.com),filter_session@0xeabff0[datalen=0,eom=(nil),ofile=(nil)]] > dnsbl[2010]: debug: on_connect: checking 222.169.14.185.psbl.surriel.com. > dnsbl[2010]: warn: DEBUG: ar_gai_errno=-5, EAI_NODATA=-2, EAI_NONAME=-2, > gai_strerror=‘No address associated with hostname' I fail to understand, where the EAI_NODATA=-2 comes from. With GNU_SOURCE defined as mentioned above it should come from netdb.h header with -5 instead of -2. Can you try to remove/comment the whole #ifndef EAI_NODATA in openbsd-compat/defines.h line 205-213? Hopefully, EAI_NODATA is -5 afterwards and things will start to work? > dnsbl[2010]: warn: session 141e1ab081a9e56f: event_dispatch: REJECT address > ar_gai_errno=-5 > filter: imsg IMSG_FILTER_RESPONSE from procfilter > dnsbl[hooks=0xffffffff,flags=0x0000] > filter: filter_drain_query 141e1ab15e6c4024[QUERY_CONNECT=178.21.114.197 <-> > 185.14.169.222(pro-mail-smtp-002.bol.com),filter_session@0xeabff0[datalen=0,eom=(nil),ofile=(nil)]] > filter: filter_end_query 141e1ab15e6c4024[QUERY_CONNECT=178.21.114.197 <-> > 185.14.169.222(pro-mail-smtp-002.bol.com),filter_session@0xeabff0[datalen=0,eom=(nil),ofile=(nil)]] > filter: query 141e1ab15e6c4024 done: status=FILTER_CLOSE code=554 > response="5.7.1 Address in DNSBL" > smtp-in: Failed command on session 141e1ab081a9e56f: "" => 554 5.7.1 Address > in DNSBL > smtp-in: Closing session 141e1ab081a9e56f > debug: smtp: 0xf79cb0: deleting session: done > filter: post-event event=EVENT_DISCONNECT filter=dnsbl > > > > >> > >> However as written earlier, all this is just quick-fix. Better solution > >> would be IMHO to NOT rely on gai errno at all. > >> I’ll try to come up with a better fix soon. I changed my mind and think the quick fix is the only way to go to distinguish between different resolve errors. But we still need to find out where the EAI_NODATA=-2 comes from on Ubuntu. -- You received this mail because you are subscribed to [email protected] To unsubscribe, send a mail to: [email protected]
