Mailing List Archive

info: dns: bad dns reply: bgread: recv() failed
Hello
It seems that i have little problem with DNS and Spamassasssin, i found any topics
but i didnt found the right solutions, and the error persist.

please check me settings, here and thanks for any possible update
regards

--

Debian - buster 10.13

dpkg -l | grep spamassassin
ii spamassassin 3.4.2-1+deb10u3

root@nmail:/# cat /etc/systemd/system/multi-user.target.wants/spamassassin.service
[Unit]
Description=Perl-based spam filter using text analysis
After=syslog.target network-online.target

[Service]
Type=forking
PIDFile=/run/spamd.pid
EnvironmentFile=-/etc/default/spamassassin
[Unit]
Description=Spamassassin daemon
After=syslog.target network-online.target

cat spamd.log
Wed Sep 28 22:00:39 2022 [12607] info: spamd: connection from 127.0.0.1 [127.0.0.1]:47024 to port 783, fd 6
Wed Sep 28 22:00:39 2022 [12607] info: spamd: setuid to debian-spamd succeeded
Wed Sep 28 22:00:39 2022 [12607] info: spamd: checking message <D4F669A1-7EC2-49B9-9612-8800DE1C2B15@domain.ch> for debian-spamd:116
Wed Sep 28 21:46:55 2022 [9418] info: dns: bad dns reply: bgread: recv() failed: Connection refused at /usr/local/share/perl/5.28.1/Mail/SpamAssassin/DnsResolver.pm line 742, <GEN921> line 189.
Wed Sep 28 21:46:55 2022 [9418] info: dns: bad dns reply: bgread: recv() failed: Connection refused at /usr/local/share/perl/5.28.1/Mail/SpamAssassin/DnsResolver.pm line 742.

root@nmail:/var/log# cat /etc/resolv.conf
nameserver 127.0.0.1

bind9 running
Sep 28 21:45:49 nmail named[12447]: zone 127.in-addr.arpa/IN: loaded serial 1
Sep 28 21:45:49 nmail named[12447]: zone 255.in-addr.arpa/IN: loaded serial 1
Sep 28 21:45:49 nmail named[12447]: zone domain.nmail/IN: sig-re-signing-interval less than 3 * refresh.
Sep 28 21:45:49 nmail named[12447]: zone domain.nmail/IN: loaded serial 1 (DNSSEC signed)
Sep 28 21:45:49 nmail named[12447]: zone 190.120.37.in-addr.arpa/IN: loaded serial 1
Sep 28 21:45:49 nmail named[12447]: zone localhost/IN: loaded serial 2
Sep 28 21:45:49 nmail named[12447]: all zones loaded
Sep 28 21:45:49 nmail named[12447]: running
Sep 28 21:45:49 nmail named[12447]: zone domain.nmail/IN: reconfiguring zone keys
Sep 28 21:45:49 nmail named[12447]: zone domain.nmail/IN: next key event: 28-Sep-2022 22:45:49.345
Re: info: dns: bad dns reply: bgread: recv() failed [ In reply to ]
On 2022-09-28 at 16:54:16 UTC-0400 (Wed, 28 Sep 2022 22:54:16 +0200)
Maurizio Caloro <mauric@gmx.ch>
is rumored to have said:

> Hello
> It seems that i have little problem with DNS and Spamassasssin, i
> found any topics
> but i didnt found the right solutions, and the error persist.
>
> please check me settings, here and thanks for any possible update
> regards
>
> --
>
> Debian - buster 10.13
>
> dpkg -l | grep spamassassin
> ii spamassassin 3.4.2-1+deb10u3

Current version is 3.4.6. There have been very many bugs fixed between
3.4.2 and 3.4.6.

Also relevant: version of Net::DNS module in your Perl installation.
There were complex bug interactions between SA v3.4.[012] and Net::DNS
<v1.07.

>
> root@nmail:/# cat
> /etc/systemd/system/multi-user.target.wants/spamassassin.service
> [Unit]
> Description=Perl-based spam filter using text analysis
> After=syslog.target network-online.target
>
> [Service]
> Type=forking
> PIDFile=/run/spamd.pid
> EnvironmentFile=-/etc/default/spamassassin
> [Unit]
> Description=Spamassassin daemon
> After=syslog.target network-online.target
>
> cat spamd.log
> Wed Sep 28 22:00:39 2022 [12607] info: spamd: connection from
> 127.0.0.1 [127.0.0.1]:47024 to port 783, fd 6
> Wed Sep 28 22:00:39 2022 [12607] info: spamd: setuid to debian-spamd
> succeeded
> Wed Sep 28 22:00:39 2022 [12607] info: spamd: checking message
> <D4F669A1-7EC2-49B9-9612-8800DE1C2B15@domain.ch> for debian-spamd:116
> Wed Sep 28 21:46:55 2022 [9418] info: dns: bad dns reply: bgread:
> recv() failed: Connection refused at
> /usr/local/share/perl/5.28.1/Mail/SpamAssassin/DnsResolver.pm line
> 742, <GEN921> line 189.
> Wed Sep 28 21:46:55 2022 [9418] info: dns: bad dns reply: bgread:
> recv() failed: Connection refused at
> /usr/local/share/perl/5.28.1/Mail/SpamAssassin/DnsResolver.pm line
> 742.

That looks like BIND or a packet filter refusing the query packet or
possibly a case of failed fallback to TCP when a reply was too big for
UDP.

Are you certain that BIND is configured to do recursion for 127.0.0.1
and doesn't have anything blocking port 53 for both UDP and TCP?


> root@nmail:/var/log# cat /etc/resolv.conf
> nameserver 127.0.0.1
>
> bind9 running
> Sep 28 21:45:49 nmail named[12447]: zone 127.in-addr.arpa/IN: loaded
> serial 1
> Sep 28 21:45:49 nmail named[12447]: zone 255.in-addr.arpa/IN: loaded
> serial 1
> Sep 28 21:45:49 nmail named[12447]: zone domain.nmail/IN:
> sig-re-signing-interval less than 3 * refresh.
> Sep 28 21:45:49 nmail named[12447]: zone domain.nmail/IN: loaded
> serial 1 (DNSSEC signed)
> Sep 28 21:45:49 nmail named[12447]: zone 190.120.37.in-addr.arpa/IN:
> loaded serial 1
> Sep 28 21:45:49 nmail named[12447]: zone localhost/IN: loaded serial 2
> Sep 28 21:45:49 nmail named[12447]: all zones loaded
> Sep 28 21:45:49 nmail named[12447]: running
> Sep 28 21:45:49 nmail named[12447]: zone domain.nmail/IN:
> reconfiguring zone keys
> Sep 28 21:45:49 nmail named[12447]: zone domain.nmail/IN: next key
> event: 28-Sep-2022 22:45:49.345


--
Bill Cole
bill@scconsult.com or billcole@apache.org
(AKA @grumpybozo and many *@billmail.scconsult.com addresses)
Not Currently Available For Hire
Re: info: dns: bad dns reply: bgread: recv() failed [ In reply to ]
>On 2022-09-28 at 16:54:16 UTC-0400 (Wed, 28 Sep 2022 22:54:16 +0200)
>Maurizio Caloro <mauric@gmx.ch>
>is rumored to have said:
>>It seems that i have little problem with DNS and Spamassasssin, i
>>found any topics
>>but i didnt found the right solutions, and the error persist.
>>
>>please check me settings, here and thanks for any possible update
>>regards
>>
>>--
>>
>>Debian - buster 10.13
>>
>>dpkg -l | grep spamassassin
>>ii spamassassin 3.4.2-1+deb10u3

On 28.09.22 17:41, Bill Cole wrote:
>Current version is 3.4.6. There have been very many bugs fixed between
>3.4.2 and 3.4.6.

upgrade to bullseye, it contains 3.4.6.

also, 3.4.6 is available in backports, install it from there.

>Also relevant: version of Net::DNS module in your Perl installation.
>There were complex bug interactions between SA v3.4.[012] and Net::DNS
><v1.07.

buster 1.19, bullseye 1.29. should be OK

>>Wed Sep 28 22:00:39 2022 [12607] info: spamd: connection from
>>127.0.0.1 [127.0.0.1]:47024 to port 783, fd 6
>>Wed Sep 28 22:00:39 2022 [12607] info: spamd: setuid to debian-spamd
>>succeeded
>>Wed Sep 28 22:00:39 2022 [12607] info: spamd: checking message
>><D4F669A1-7EC2-49B9-9612-8800DE1C2B15@domain.ch> for
>>debian-spamd:116
>>Wed Sep 28 21:46:55 2022 [9418] info: dns: bad dns reply: bgread:
>>recv() failed: Connection refused at
>>/usr/local/share/perl/5.28.1/Mail/SpamAssassin/DnsResolver.pm line
>>742, <GEN921> line 189.
>>Wed Sep 28 21:46:55 2022 [9418] info: dns: bad dns reply: bgread:
>>recv() failed: Connection refused at
>>/usr/local/share/perl/5.28.1/Mail/SpamAssassin/DnsResolver.pm line
>>742.
>
>That looks like BIND or a packet filter refusing the query packet or
>possibly a case of failed fallback to TCP when a reply was too big for
>UDP.
>
>Are you certain that BIND is configured to do recursion for 127.0.0.1
>and doesn't have anything blocking port 53 for both UDP and TCP?
>
>
>>root@nmail:/var/log# cat /etc/resolv.conf
>>nameserver 127.0.0.1

sure it is BIND running on localhost?

sudo netstat -unlpe

>>bind9 running
>>Sep 28 21:45:49 nmail named[12447]: zone 127.in-addr.arpa/IN: loaded
>>serial 1
>>Sep 28 21:45:49 nmail named[12447]: zone 255.in-addr.arpa/IN: loaded
>>serial 1
>>Sep 28 21:45:49 nmail named[12447]: zone domain.nmail/IN:
>>sig-re-signing-interval less than 3 * refresh.
>>Sep 28 21:45:49 nmail named[12447]: zone domain.nmail/IN: loaded
>>serial 1 (DNSSEC signed)
>>Sep 28 21:45:49 nmail named[12447]: zone 190.120.37.in-addr.arpa/IN:
>>loaded serial 1
>>Sep 28 21:45:49 nmail named[12447]: zone localhost/IN: loaded serial 2
>>Sep 28 21:45:49 nmail named[12447]: all zones loaded
>>Sep 28 21:45:49 nmail named[12447]: running
>>Sep 28 21:45:49 nmail named[12447]: zone domain.nmail/IN:
>>reconfiguring zone keys
>>Sep 28 21:45:49 nmail named[12447]: zone domain.nmail/IN: next key
>>event: 28-Sep-2022 22:45:49.345

--
Matus UHLAR - fantomas, uhlar@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
The early bird may get the worm, but the second mouse gets the cheese.
Re: info: dns: bad dns reply: bgread: recv() failed [ In reply to ]
On Thu, 29 Sep 2022, Matus UHLAR - fantomas wrote:

[snip..]
>>> /usr/local/share/perl/5.28.1/Mail/SpamAssassin/DnsResolver.pm line 742,
>>> <GEN921> line 189.
>>> Wed Sep 28 21:46:55 2022 [9418] info: dns: bad dns reply: bgread: recv()
>>> failed: Connection refused at
>>> /usr/local/share/perl/5.28.1/Mail/SpamAssassin/DnsResolver.pm line 742.
>>
>> That looks like BIND or a packet filter refusing the query packet or
>> possibly a case of failed fallback to TCP when a reply was too big for UDP.
>>
>> Are you certain that BIND is configured to do recursion for 127.0.0.1 and
>> doesn't have anything blocking port 53 for both UDP and TCP?
>>
>>
>>> root@nmail:/var/log# cat /etc/resolv.conf
>>> nameserver 127.0.0.1
>
> sure it is BIND running on localhost?
>
> sudo netstat -unlpe
>
>>> bind9 running
>>> Sep 28 21:45:49 nmail named[12447]: zone 127.in-addr.arpa/IN: loaded
>>> serial 1
>>> Sep 28 21:45:49 nmail named[12447]: zone 255.in-addr.arpa/IN: loaded
>>> serial 1
>>> Sep 28 21:45:49 nmail named[12447]: zone domain.nmail/IN:
>>> sig-re-signing-interval less than 3 * refresh.
>>> Sep 28 21:45:49 nmail named[12447]: zone domain.nmail/IN: loaded serial 1
>>> (DNSSEC signed)
>>> Sep 28 21:45:49 nmail named[12447]: zone 190.120.37.in-addr.arpa/IN:
>>> loaded serial 1
>>> Sep 28 21:45:49 nmail named[12447]: zone localhost/IN: loaded serial 2
>>> Sep 28 21:45:49 nmail named[12447]: all zones loaded
>>> Sep 28 21:45:49 nmail named[12447]: running
>>> Sep 28 21:45:49 nmail named[12447]: zone domain.nmail/IN: reconfiguring
>>> zone keys
>>> Sep 28 21:45:49 nmail named[12447]: zone domain.nmail/IN: next key event:
>>> 28-Sep-2022 22:45:49.345

Does:
dig @localhost google.com

get you a valid answer or does it give you an error message:

dbfunk@a-lnx000:bin> dig @localhost google.com

; <<>> DiG 9.11.2 <<>> @localhost google.com
; (2 servers found)
;; global options: +cmd
;; connection timed out; no servers could be reached

If you get that kind of an error message that tends to indicate that either your
bind is not configured to listen on 'localhost' or there's some strange firewall
issue going on.

locate your bind's "named.conf" file and look for a "listen-on" parameter.
It should contain the value "any" or explicitly list the various appropriate
addresses, including the "127.0.0.1" localhost address.



--
Dave Funk University of Iowa
<dbfunk (at) engineering.uiowa.edu> College of Engineering
319/335-5751 FAX: 319/384-0549 1256 Seamans Center, 103 S Capitol St.
Sys_admin/Postmaster/cell_admin Iowa City, IA 52242-1527
#include <std_disclaimer.h>
Better is not better, 'standard' is better. B{
Aw: Re: info: dns: bad dns reply: bgread: recv() failed [ In reply to ]
> On 2022-09-28 at 16:54:16 UTC-0400 (Wed, 28 Sep 2022 22:54:16 +0200)
> Maurizio Caloro <mauric@gmx.ch>
> is rumored to have said:
>
> > Hello
> > It seems that i have little problem with DNS and Spamassasssin, i
> > found any topics
> > but i didnt found the right solutions, and the error persist.
> >
> > please check me settings, here and thanks for any possible update
> > regards
> >
> > --
> >
> > Debian - buster 10.13
> >
> > dpkg -l | grep spamassassin
> > ii spamassassin 3.4.2-1+deb10u3
>
> Current version is 3.4.6. There have been very many bugs fixed between
> 3.4.2 and 3.4.6.
>
> Also relevant: version of Net::DNS module in your Perl installation.
> There were complex bug interactions between SA v3.4.[012] and Net::DNS
> <v1.07.
>
> >
> > root@nmail:/# cat
> > /etc/systemd/system/multi-user.target.wants/spamassassin.service
> > [Unit]
> > Description=Perl-based spam filter using text analysis
> > After=syslog.target network-online.target
> >
> > [Service]
> > Type=forking
> > PIDFile=/run/spamd.pid
> > EnvironmentFile=-/etc/default/spamassassin
> > [Unit]
> > Description=Spamassassin daemon
> > After=syslog.target network-online.target
> >
> > cat spamd.log
> > Wed Sep 28 22:00:39 2022 [12607] info: spamd: connection from
> > 127.0.0.1 [127.0.0.1]:47024 to port 783, fd 6
> > Wed Sep 28 22:00:39 2022 [12607] info: spamd: setuid to debian-spamd
> > succeeded
> > Wed Sep 28 22:00:39 2022 [12607] info: spamd: checking message
> > <D4F669A1-7EC2-49B9-9612-8800DE1C2B15@domain.ch> for debian-spamd:116
> > Wed Sep 28 21:46:55 2022 [9418] info: dns: bad dns reply: bgread:
> > recv() failed: Connection refused at
> > /usr/local/share/perl/5.28.1/Mail/SpamAssassin/DnsResolver.pm line
> > 742, <GEN921> line 189.
> > Wed Sep 28 21:46:55 2022 [9418] info: dns: bad dns reply: bgread:
> > recv() failed: Connection refused at
> > /usr/local/share/perl/5.28.1/Mail/SpamAssassin/DnsResolver.pm line
> > 742.
>
> That looks like BIND or a packet filter refusing the query packet or
> possibly a case of failed fallback to TCP when a reply was too big for
> UDP.
>
> Are you certain that BIND is configured to do recursion for 127.0.0.1
> and doesn't have anything blocking port 53 for both UDP and TCP?
>
>
> > root@nmail:/var/log# cat /etc/resolv.conf
> > nameserver 127.0.0.1
> >
> > bind9 running
> > Sep 28 21:45:49 nmail named[12447]: zone 127.in-addr.arpa/IN: loaded
> > serial 1
> > Sep 28 21:45:49 nmail named[12447]: zone 255.in-addr.arpa/IN: loaded
> > serial 1
> > Sep 28 21:45:49 nmail named[12447]: zone domain.nmail/IN:
> > sig-re-signing-interval less than 3 * refresh.
> > Sep 28 21:45:49 nmail named[12447]: zone domain.nmail/IN: loaded
> > serial 1 (DNSSEC signed)
> > Sep 28 21:45:49 nmail named[12447]: zone 190.120.37.in-addr.arpa/IN:
> > loaded serial 1
> > Sep 28 21:45:49 nmail named[12447]: zone localhost/IN: loaded serial 2
> > Sep 28 21:45:49 nmail named[12447]: all zones loaded
> > Sep 28 21:45:49 nmail named[12447]: running
> > Sep 28 21:45:49 nmail named[12447]: zone domain.nmail/IN:
> > reconfiguring zone keys
> > Sep 28 21:45:49 nmail named[12447]: zone domain.nmail/IN: next key
> > event: 28-Sep-2022 22:45:49.345
>
>
> --
> Bill Cole
> bill@scconsult.com or billcole@apache.org
> (AKA @grumpybozo and many *@billmail.scconsult.com addresses)
> Not Currently Available For Hire
>

First let me thanks for your quick help, yes now are running:-)

mistake:
named.conf.options
-listen-on { A.B.C.D, localhost; };
+listen-on { any; };
After this, the error in Spamd.log disapper, greate!

but now i see in main.log, this message:
Sep 29 21:15:05 nmail postfix/smtp[26109]: warning: DNSSEC validation may be unavailable
Sep 29 21:15:05 nmail postfix/smtp[26109]: warning: reason: dnssec_probe 'ns:.' received a response that is not DNSSEC validated

i see this as warning, and i think i dont need intervention here?

thanks
Re: Aw: Re: info: dns: bad dns reply: bgread: recv() failed [ In reply to ]
On Thu, 29 Sep 2022, Maurizio Caloro wrote:

> First let me thanks for your quick help, yes now are running:-)
>
> mistake:
> named.conf.options
> -listen-on { A.B.C.D, localhost; };
> +listen-on { any; };
> After this, the error in Spamd.log disapper, greate!

Your mistake is that 'localhost', you need to have a real IP address there.
use '127.0.0.1' instead of localhost in that listen-on statement, and also use
';' for component separators, not ','

IE
listen-on { A.B.C.D; 127.0.0.1; };

the key-word 'any' means to discover and bind to all possible interfaces on the
machine.

>
> but now i see in main.log, this message:
> Sep 29 21:15:05 nmail postfix/smtp[26109]: warning: DNSSEC validation may be unavailable
> Sep 29 21:15:05 nmail postfix/smtp[26109]: warning: reason: dnssec_probe 'ns:.' received a response that is not DNSSEC validated
>
> i see this as warning, and i think i dont need intervention here?

If you want your postfix to be able to validate DNSSEC signed DNS replys you
need to set up DNSSEC infrastructure. (postfix issue, not spamd).


--
Dave Funk University of Iowa
<dbfunk (at) engineering.uiowa.edu> College of Engineering
319/335-5751 FAX: 319/384-0549 1256 Seamans Center, 103 S Capitol St.
Sys_admin/Postmaster/cell_admin Iowa City, IA 52242-1527
#include <std_disclaimer.h>
Better is not better, 'standard' is better. B{