> On 07 Apr 2016, at 23:24, Michiel van Es <[email protected]> wrote:
>> On 07 Apr 2016, at 21:28, Joerg Jung <[email protected]> wrote:
>> 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. 
>> 
> 
> np, removed it
> 
>>> 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?
> 
> done, rebuilding with ./bootstrap; etc.
> 
> but got the same error:
> 
> debug: smtp: new client on listener: 0x1bc3110
> smtp-in: New session e7ba7643bb567563 from host pro-mail-smtp-001.bol.com 
> [185.14.168.222]
> filter: post-event event=EVENT_CONNECT filter=dnsbl
> filter: new query QUERY_CONNECT
> filter: filter_drain_query e7ba7644f7858c96[QUERY_CONNECT=178.21.114.197 <-> 
> 185.14.168.222(pro-mail-smtp-001.bol.com),filter_session@0x1bb2010[datalen=0,eom=(nil),ofile=(nil)]]
> filter: running filter filter:dnsbl[hooks=0xffffffff,flags=0x0000] for query 
> e7ba7644f7858c96[QUERY_CONNECT=178.21.114.197 <-> 
> 185.14.168.222(pro-mail-smtp-001.bol.com),filter_session@0x1bb2010[datalen=0,eom=(nil),ofile=(nil)]]
> filter: waiting for running query 
> e7ba7644f7858c96[QUERY_CONNECT=178.21.114.197 <-> 
> 185.14.168.222(pro-mail-smtp-001.bol.com),filter_session@0x1bb2010[datalen=0,eom=(nil),ofile=(nil)]]
> dnsbl[8693]: debug: on_connect: checking 222.168.14.185.psbl.surriel.com.
> dnsbl[8693]: warn: DEBUG: ar_gai_errno=-5, EAI_NODATA=-2, EAI_NONAME=-2, 
> gai_strerror=‘No address associated with hostname’

For now I’m out of ideas how to solve the EAI_NODATA -5 vs -2 problem and where 
it exactly comes from. 
I need to install Ubuntu myself to figure out. Maybe I find some time on 
Weekend to do so.

As hacky-whacky-workaround-bad-idea-but-quick-hack you can add the following in 
line 43:

   #define MY_EAI_NODATA -5

and then use it one line later like this:

   if (ar->ar_gai_errno != EAI_NODATA && ar->ar_gai_errno != EAI_NONAME && 
ar->ar_gai_errno != MY_EAI_NODATA) {
   …

This should really make the filter work for you, but is a very ugly hack.

You opened a bug report already anyways, I will try to resolve this with a good 
solution.






--
You received this mail because you are subscribed to [email protected]
To unsubscribe, send a mail to: [email protected]

Reply via email to