Mailing List Archive

dnsdb loses characters (exim 4.96.2, 4.97)
Hello

This is a real case.

Let's resolve the TXT record of the perrigo.com domain.

# pkg info -E exim
exim-4.95_5

# echo '${lookup dnsdb{>\n; defer_never,txt=perrigo.com}}' | exim -be |
grep v=spf1
v=spf1 include:spf-00157e01.pphosted.com
include:spf-00157e03.pphosted.com include:spf.protection.outlook.com
include:spf.natchcloud.com include:spf.messagelabs.com
include:spf.mailjet.com a:smtp5.silae.fr include:_spf-dc8.sapsf.com
include:_spf-dc4.sapsf.com ip4:70.42.227.151/32 ip4:70.42.227.152/32
ip4:65.221.8.29/32 ip4:65.221.12.128/32 ip4:65.221.12.148/32
ip4:198.11.114.29/32 ~all

# pkg info -E exim
exim-4.96.2

# echo '${lookup dnsdb{>\n; defer_never,txt=perrigo.com}}' | exim -be |
grep v=spf1
v=spf1 include:spf-00157e01.pphosted.com
include:spf-00157e03.pphosted.com include:spf.protection.outlook.com
include:spf.natchcloud.com include:spf.messagelabs.com
include:spf.mailjet.com a:smtp5.silae.fr include:_spf-dc8.sapsf.co#
include:_spf-dc4.sapsf.com ip4:70.42.227.151/32 ip4:70.42.227.152/32
ip4:65.221.8.29/32 ip4:65.221.12.128/2 ip4:65.221.12.148/32
ip4:198.11.114.29/32 ~all

# host -t txt perrigo.com | grep v=spf1
perrigo.com descriptive text "v=spf1 include:spf-00157e01.pphosted.com
include:spf-00157e03.pphosted.com include:spf.protection.outlook.com
include:spf.natchcloud.com include:spf.messagelabs.com
include:spf.mailjet.com a:smtp5.silae.fr include:_spf-dc8.sapsf.com" "
include:_spf-dc4.sapsf.com ip4:70.42.227.151/32 ip4:70.42.227.152/32
ip4:65.221.8.29/32 ip4:65.221.12.128/32 ip4:65.221.12.148/32
ip4:198.11.114.29/32 ~all"


Look at the network 65.221.12.128 and its mask.

exim 4.95 returns a netmask /32, it's ok.
exim 4.96.2 (and exim 4.97 too) returns a netmask /2. This is wrong netmask.
and CLI tool host returns a netmask /32, it's ok.


So far this is the only problematic TXT record I have encountered.

I was able to reproduce the problem on a test domain on a server running
exim 4.97 with the same TXT record value.


# host -t txt test.mx.org.ua
test.mx.org.ua descriptive text "v=spf1
include:spf-00157e01.pphosted.com include:spf-00157e03.pphosted.com
include:spf.protection.outlook.com include:spf.natchcloud.com
include:spf.messagelabs.com include:spf.mailjet.com a:smtp5.silae.fr
include:_spf-dc8.sapsf.com" " include:_spf-dc4.sapsf.com
ip4:70.42.227.151/32 ip4:70.42.227.152/32 ip4:65.221.8.29/32
ip4:65.221.12.128/32 ip4:65.221.12.148/32 ip4:198.11.114.29/32 ~all"

host returned ip4:65.221.12.128/32

# echo '${lookup dnsdb{>\n; defer_never,txt=test.mx.org.ua}}' | exim -be
| grep v=spf1
v=spf1 include:spf-00157e01.pphosted.com
include:spf-00157e03.pphosted.com include:spf.protection.outlook.com
include:spf.natchcloud.com include:spf.messagelabs.com
include:spf.mailjet.com a:smtp5.silae.fr include:_spf-dc8.sapsf.co#
include:_spf-dc4.sapsf.com ip4:70.42.227.151/32 ip4:70.42.227.152/32
ip4:65.221.8.29/32 ip4:65.221.12.128/2 ip4:65.221.12.148/32
ip4:198.11.114.29/32 ~all

exim 4.97 returned ip4:65.221.12.128/2


Next, I added an extra character to the TXT record a little before the
problem area (I replaced "_spf-dc4.sapsf.com" with "_spf-dc44.sapsf.com").


# host -t txt test.mx.org.ua
test.mx.org.ua descriptive text "v=spf1
include:spf-00157e01.pphosted.com include:spf-00157e03.pphosted.com
include:spf.protection.outlook.com include:spf.natchcloud.com
include:spf.messagelabs.com include:spf.mailjet.com a:smtp5.silae.fr
include:_spf-dc8.sapsf.com" " include:_spf-dc44.sapsf.com
ip4:70.42.227.151/32 ip4:70.42.227.152/32 ip4:65.221.8.29/32
ip4:65.221.12.128/32 ip4:65.221.12.148/32 ip4:198.11.114.29/32 ~all"

host still returns ip4:ip4:65.221.12.128/32

# echo '${lookup dnsdb{>\n; defer_never,txt=test.mx.org.ua}}' | exim -be
| grep v=spf1
v=spf1 include:spf-00157e01.pphosted.com
include:spf-00157e03.pphosted.com include:spf.protection.outlook.com
include:spf.natchcloud.com include:spf.messagelabs.com
include:spf.mailjet.com a:smtp5.silae.fr include:_spf-dc8.sapsf.co#
include:_spf-dc44.sapsf.com ip4:70.42.227.151/32 ip4:70.42.227.152/32
ip4:65.221.8.29/32 ip4:65.221.12.12832 ip4:65.221.12.148/32
ip4:198.11.114.29/32 ~ll

exim 4.97 returns ip4:65.221.12.12832


Looks like a bug.


--
Best wishes Victor Ustugov
mailto:victor@corvax.kiev.ua
public GnuPG/PGP key: https://victor.corvax.kiev.ua/corvax.asc

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: dnsdb loses characters (exim 4.96.2, 4.97) [ In reply to ]
On Wed, 15 Nov 2023, Victor Ustugov via Exim-users wrote:

> Hello
>
> This is a real case.
>
> Let's resolve the TXT record of the perrigo.com domain.
>
> # pkg info -E exim
> exim-4.96.2
>
> # echo '${lookup dnsdb{>\n; defer_never,txt=perrigo.com}}' | exim -be |
> grep v=spf1
> v=spf1 include:spf-00157e01.pphosted.com
> include:spf-00157e03.pphosted.com include:spf.protection.outlook.com
> include:spf.natchcloud.com include:spf.messagelabs.com
> include:spf.mailjet.com a:smtp5.silae.fr include:_spf-dc8.sapsf.co#
> include:_spf-dc4.sapsf.com ip4:70.42.227.151/32 ip4:70.42.227.152/32
> ip4:65.221.8.29/32 ip4:65.221.12.128/2 ip4:65.221.12.148/32
> ip4:198.11.114.29/32 ~all

git bisect finds that
commit f6b1f8e7d642f82d830a71b78699a4349e0158e1
Date: Tue Oct 10 23:03:28 2023 +0100

Harden dnsdb against crafted DNS responses. Bug 3033

(cherry picked from commit 8787c8994f07c23c3664d76926e02f07314d699d)
is to blame.

[. I note that the '#' in include:_spf-dc8.sapsf.co# is actually 0x9c. ]

--
Andrew C. Aitchison Kendal, UK
andrew@aitchison.me.uk

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: dnsdb loses characters (exim 4.96.2, 4.97) [ In reply to ]
Andrew C Aitchison via Exim-users wrote on 15.11.2023 21:00:

>> Let's resolve the TXT record of the perrigo.com domain.
>>
>> # pkg info -E exim
>> exim-4.96.2
>>
>> # echo '${lookup dnsdb{>\n; defer_never,txt=perrigo.com}}' | exim -be |
>> grep v=spf1
>> v=spf1 include:spf-00157e01.pphosted.com
>> include:spf-00157e03.pphosted.com include:spf.protection.outlook.com
>> include:spf.natchcloud.com include:spf.messagelabs.com
>> include:spf.mailjet.com a:smtp5.silae.fr include:_spf-dc8.sapsf.co#
>> include:_spf-dc4.sapsf.com ip4:70.42.227.151/32 ip4:70.42.227.152/32
>> ip4:65.221.8.29/32 ip4:65.221.12.128/2 ip4:65.221.12.148/32
>> ip4:198.11.114.29/32 ~all
>
> git bisect finds that
>     commit f6b1f8e7d642f82d830a71b78699a4349e0158e1
>     Date:   Tue Oct 10 23:03:28 2023 +0100
>
>     Harden dnsdb against crafted DNS responses.  Bug 3033
>
>     (cherry picked from commit 8787c8994f07c23c3664d76926e02f07314d699d)
> is to blame.
>
> [. I note that the '#' in include:_spf-dc8.sapsf.co# is actually 0x9c. ]

But host returns value without 0x9c:


# host -t txt perrigo.com | grep v=spf
perrigo.com descriptive text "v=spf1 include:spf-00157e01.pphosted.com
include:spf-00157e03.pphosted.com include:spf.protection.outlook.com
include:spf.natchcloud.com include:spf.messagelabs.com
include:spf.mailjet.com a:smtp5.silae.fr include:_spf-dc8.sapsf.com" "
^^^^
include:_spf-dc4.sapsf.com ip4:70.42.227.151/32 ip4:70.42.227.152/32
ip4:65.221.8.29/32 ip4:65.221.12.128/32 ip4:65.221.12.148/32
ip4:198.11.114.29/32 ~all"


This TXT record is too long and wrapped.

For testing purposes I created such entry this way:


test IN TXT (
"v=spf1
include:spf-00157e01.pphosted.com include:spf-00157e03.pphosted.com
include:spf.protection.outlook.com include:spf.natchcloud.com
include:spf.messagelabs.com include:spf.mailjet.com a:smtp5.silae.fr
include:_spf-dc8.sapsf.com"
" include:_spf-dc44.sapsf.com
ip4:70.42.227.151/32 ip4:70.42.227.152/32 ip4:65.221.8.29/32
ip4:65.221.12.128/32 ip4:65.221.12.148/32 ip4:198.11.114.29/32 ~all"
)


This isn't "crafted DNS responses".

exim shows 0x9c exactly at the end of the first string:


# echo '${lookup dnsdb{>\n; defer_never,txt=test.mx.org.ua}}' | exim -be
| grep v=spf1
v=spf1 include:spf-00157e01.pphosted.com
include:spf-00157e03.pphosted.com include:spf.protection.outlook.com
include:spf.natchcloud.com include:spf.messagelabs.com
include:spf.mailjet.com a:smtp5.silae.fr include:_spf-dc8.sapsf.co#
^^^^
include:_spf-dc44.sapsf.com ip4:70.42.227.151/32 ip4:70.42.227.152/32
ip4:65.221.8.29/32 ip4:65.221.12.12832 ip4:65.221.12.148/32
ip4:198.11.114.29/32 ~ll


host dowsn't show 0x9c:


# host -t txt test.mx.org.ua | grep v=spf
test.mx.org.ua descriptive text "v=spf1
include:spf-00157e01.pphosted.com include:spf-00157e03.pphosted.com
include:spf.protection.outlook.com include:spf.natchcloud.com
include:spf.messagelabs.com include:spf.mailjet.com a:smtp5.silae.fr
include:_spf-dc8.sapsf.com" " include:_spf-dc44.sapsf.com
^^^^^^^
ip4:70.42.227.151/32 ip4:70.42.227.152/32 ip4:65.221.8.29/32
ip4:65.221.12.128/32 ip4:65.221.12.148/32 ip4:198.11.114.29/32 ~all"


Maybe this is also a bug?

--
Best wishes Victor Ustugov
mailto:victor@corvax.kiev.ua
public GnuPG/PGP key: https://victor.corvax.kiev.ua/corvax.asc

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: dnsdb loses characters (exim 4.96.2, 4.97) [ In reply to ]
On Wed, Nov 15, 2023 at 07:00:20PM +0000, Andrew C Aitchison via Exim-users wrote:
> On Wed, 15 Nov 2023, Victor Ustugov via Exim-users wrote:
>
> > Hello
> >
> > This is a real case.
> >
> > Let's resolve the TXT record of the perrigo.com domain.
> >
> > # pkg info -E exim
> > exim-4.96.2
> >
> > # echo '${lookup dnsdb{>\n; defer_never,txt=perrigo.com}}' | exim -be |
> > grep v=spf1
> > v=spf1 include:spf-00157e01.pphosted.com
> > include:spf-00157e03.pphosted.com include:spf.protection.outlook.com
> > include:spf.natchcloud.com include:spf.messagelabs.com
> > include:spf.mailjet.com a:smtp5.silae.fr include:_spf-dc8.sapsf.co#
> > include:_spf-dc4.sapsf.com ip4:70.42.227.151/32 ip4:70.42.227.152/32
> > ip4:65.221.8.29/32 ip4:65.221.12.128/2 ip4:65.221.12.148/32
> > ip4:198.11.114.29/32 ~all
>
> git bisect finds that
> commit f6b1f8e7d642f82d830a71b78699a4349e0158e1
> Date: Tue Oct 10 23:03:28 2023 +0100
>
> Harden dnsdb against crafted DNS responses. Bug 3033
>
> (cherry picked from commit 8787c8994f07c23c3664d76926e02f07314d699d)
> is to blame.
>
> [. I note that the '#' in include:_spf-dc8.sapsf.co# is actually 0x9c. ]

That "9c" is the length of the second DNS character-string in the TXT
record. A TXT record is a non-empty list of <character-string>, in
which each string is preceded by a one byte length (0–255).

$ dig +short -t txt perrigo.com | grep 'spf1'
"v=spf1 include:spf-00157e01.pphosted.com include:spf-00157e03.pphosted.com include:spf.protection.outlook.com include:spf.natchcloud.com include:spf.messagelabs.com include:spf.mailjet.com a:smtp5.silae.fr include:_spf-dc8.sapsf.com" " include:_spf-dc4.sapsf.com ip4:70.42.227.151/32 ip4:70.42.227.152/32 ip4:65.221.8.29/32 ip4:65.221.12.128/32 ip4:65.221.12.148/32 ip4:198.11.114.29/32 ~all"

$ set -- "v=spf1 include:spf-00157e01.pphosted.com include:spf-00157e03.pphosted.com include:spf.protection.outlook.com include:spf.natchcloud.com include:spf.messagelabs.com include:spf.mailjet.com a:smtp5.silae.fr include:_spf-dc8.sapsf.com" " include:_spf-dc4.sapsf.com ip4:70.42.227.151/32 ip4:70.42.227.152/32 ip4:65.221.8.29/32 ip4:65.221.12.128/32 ip4:65.221.12.148/32 ip4:198.11.114.29/32 ~all"

$ printf '%s' "$2" | wc -c
156

$ printf "%02x\n" $(printf '%s' "$2" | wc -c)
9c

The (new) code that is processing the TXT record is failing to properly
handle multi-element TXT records. Concatenation of the list elements
need to happen after removing the fragment length bytes.

--
Viktor.

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: dnsdb loses characters (exim 4.96.2, 4.97) [ In reply to ]
Viktor Dukhovni via Exim-users wrote on 16.11.2023 1:58:
> On Wed, Nov 15, 2023 at 07:00:20PM +0000, Andrew C Aitchison via Exim-users wrote:
>> On Wed, 15 Nov 2023, Victor Ustugov via Exim-users wrote:
>>
>>> Hello
>>>
>>> This is a real case.
>>>
>>> Let's resolve the TXT record of the perrigo.com domain.
>>>
>>> # pkg info -E exim
>>> exim-4.96.2
>>>
>>> # echo '${lookup dnsdb{>\n; defer_never,txt=perrigo.com}}' | exim -be |
>>> grep v=spf1
>>> v=spf1 include:spf-00157e01.pphosted.com
>>> include:spf-00157e03.pphosted.com include:spf.protection.outlook.com
>>> include:spf.natchcloud.com include:spf.messagelabs.com
>>> include:spf.mailjet.com a:smtp5.silae.fr include:_spf-dc8.sapsf.co#
>>> include:_spf-dc4.sapsf.com ip4:70.42.227.151/32 ip4:70.42.227.152/32
>>> ip4:65.221.8.29/32 ip4:65.221.12.128/2 ip4:65.221.12.148/32
>>> ip4:198.11.114.29/32 ~all
>>
>> git bisect finds that
>> commit f6b1f8e7d642f82d830a71b78699a4349e0158e1
>> Date: Tue Oct 10 23:03:28 2023 +0100
>>
>> Harden dnsdb against crafted DNS responses. Bug 3033
>>
>> (cherry picked from commit 8787c8994f07c23c3664d76926e02f07314d699d)
>> is to blame.
>>
>> [. I note that the '#' in include:_spf-dc8.sapsf.co# is actually 0x9c. ]
>
> That "9c" is the length of the second DNS character-string in the TXT
> record. A TXT record is a non-empty list of <character-string>, in
> which each string is preceded by a one byte length (0–255).
>
> $ dig +short -t txt perrigo.com | grep 'spf1'
> "v=spf1 include:spf-00157e01.pphosted.com include:spf-00157e03.pphosted.com include:spf.protection.outlook.com include:spf.natchcloud.com include:spf.messagelabs.com include:spf.mailjet.com a:smtp5.silae.fr include:_spf-dc8.sapsf.com" " include:_spf-dc4.sapsf.com ip4:70.42.227.151/32 ip4:70.42.227.152/32 ip4:65.221.8.29/32 ip4:65.221.12.128/32 ip4:65.221.12.148/32 ip4:198.11.114.29/32 ~all"
>
> $ set -- "v=spf1 include:spf-00157e01.pphosted.com include:spf-00157e03.pphosted.com include:spf.protection.outlook.com include:spf.natchcloud.com include:spf.messagelabs.com include:spf.mailjet.com a:smtp5.silae.fr include:_spf-dc8.sapsf.com" " include:_spf-dc4.sapsf.com ip4:70.42.227.151/32 ip4:70.42.227.152/32 ip4:65.221.8.29/32 ip4:65.221.12.128/32 ip4:65.221.12.148/32 ip4:198.11.114.29/32 ~all"
>
> $ printf '%s' "$2" | wc -c
> 156
>
> $ printf "%02x\n" $(printf '%s' "$2" | wc -c)
> 9c
>
> The (new) code that is processing the TXT record is failing to properly
> handle multi-element TXT records. Concatenation of the list elements
> need to happen after removing the fragment length bytes.

dnsdb is failing to properly handle even single-element TXT record:


# host -t txt exim.org
exim.org descriptive text "v=spf1 a ip4:37.221.193.62
ip6:2a03:4000:8:637::2 a:hh.schlittermann.de mx ?all"
exim.org descriptive text "cumin"


exim 4.95:

# echo '${lookup dnsdb{>\n; txt=exim.org}}' | exim -be
> cumin
v=spf1 a ip4:37.221.193.62 ip6:2a03:4000:8:637::2 a:hh.schlittermann.de
mx ?all
>


exim 4.97:

# echo '${lookup dnsdb{>\n; txt=exim.org}}' | exim -be
> cumi
v=spf1 a ip4:37.221.193.62 ip6:2a03:4000:8:637::2 a:hh.schlittermann.de
mx ?al
>


The last character in each record is missing.


--
Best wishes Victor Ustugov
mailto:victor@corvax.kiev.ua
public GnuPG/PGP key: https://victor.corvax.kiev.ua/corvax.asc

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: dnsdb loses characters (exim 4.96.2, 4.97) [ In reply to ]
Just pushed 79670d3c32cc - anybody building from git may wish to test.
--
Cheers,
Jeremy


--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: dnsdb loses characters (exim 4.96.2, 4.97) [ In reply to ]
On Fri, 17 Nov 2023, Victor Ustugov via Exim-users wrote:

> dnsdb is failing to properly handle even single-element TXT record:
>
>
> # host -t txt exim.org
> exim.org descriptive text "v=spf1 a ip4:37.221.193.62
> ip6:2a03:4000:8:637::2 a:hh.schlittermann.de mx ?all"
> exim.org descriptive text "cumin"
>
>
> exim 4.95:
>
> # echo '${lookup dnsdb{>\n; txt=exim.org}}' | exim -be
>> cumin
> v=spf1 a ip4:37.221.193.62 ip6:2a03:4000:8:637::2 a:hh.schlittermann.de
> mx ?all
>>
>
>
> exim 4.97:
>
> # echo '${lookup dnsdb{>\n; txt=exim.org}}' | exim -be
>> cumi
> v=spf1 a ip4:37.221.193.62 ip6:2a03:4000:8:637::2 a:hh.schlittermann.de
> mx ?al
>
> The last character in each record is missing.

If Jeremy isn't already working on it, maybe you can add that to
https://bugs.exim.org/show_bug.cgi?id=3054

--
Andrew C. Aitchison Kendal, UK
andrew@aitchison.me.uk

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: dnsdb loses characters (exim 4.96.2, 4.97) [ In reply to ]
Jeremy Harris via Exim-users wrote on 17.11.2023 20:45:
> Just pushed 79670d3c32cc - anybody building from git may wish to test.

My own patch was quite small

https://mta.org.ua/exim-4.97-conf/patches/exim-4.96.2-fix-dnsdb-txt/patch-src__exim-4.96.2-fix-dnsdb-txt.patch

--
Best wishes Victor Ustugov
mailto:victor@corvax.kiev.ua
public GnuPG/PGP key: https://victor.corvax.kiev.ua/corvax.asc

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: dnsdb loses characters (exim 4.96.2, 4.97) [ In reply to ]
Jeremy Harris via Exim-users wrote on 17.11.2023 20:45:
> Just pushed 79670d3c32cc - anybody building from git may wish to test.

79670d3c32cc works as expected.

Thank you.


--
Best wishes Victor Ustugov
mailto:victor@corvax.kiev.ua
public GnuPG/PGP key: https://victor.corvax.kiev.ua/corvax.asc

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: dnsdb loses characters (exim 4.96.2, 4.97) [ In reply to ]
On Fri, 17 Nov 2023, Jeremy Harris via Exim-users wrote:

> Just pushed 79670d3c32cc - anybody building from git may wish to test.

# echo '${lookup dnsdb{>\n; defer_never,txt=perrigo.com}}' | exim -be |\
grep -a v=spf1 | tr ' ' '\n' | grep 65.221.12.128
ip4:65.221.12.128/32

# echo '${lookup dnsdb{>\n; txt=exim.org}}' | exim -be
> cumin
v=spf1 a ip4:37.221.193.62 ip6:2a03:4000:8:637::2 a:hh.schlittermann.de mx
?all

So both the original issue and the single chunk case that Victor Ustugov
reported today look good.

When I run the test suite I had to change my hostname to avoid
*** Host name is not fully qualified: this may cause problems ***
so I wont vouch for the state of my DNS, but
./runtest 2200 -continue -keep
reports:

>>> The following tests require: lookup dnsdb
dnsdb/2200 dnsdb lookup in string expansions
** Comparison of test-stdout-munged with stdout/2200 failed===============
Line 4 of "test-stdout-munged" does not match line 4 of "stdout/2200".
----------
> txt=long.test.ex This is a max-length chunk
78901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012
----------
> txt=long.test.ex This is a max-length chunk
789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234A
short chunkA final chunk
===============
1 difference found.
"test-stdout-munged" contains 62 lines; "stdout/2200" contains 62 lines.

... so my exim has lost
3456789012345678901234A short chunkA final chunk

:-(

--
Andrew C. Aitchison Kendal, UK
andrew@aitchison.me.uk

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: dnsdb loses characters (exim 4.96.2, 4.97) [ In reply to ]
On 17/11/2023 20:15, Andrew C Aitchison wrote:
>     ./runtest 2200 -continue -keep
> reports:
>
>>>> The following tests require: lookup dnsdb
> dnsdb/2200 dnsdb lookup in string expansions
> ** Comparison of test-stdout-munged with stdout/2200 failed===============
> Line 4 of "test-stdout-munged" does not match line 4 of "stdout/2200".
> ----------
>> txt=long.test.ex           This is a max-length chunk
> 78901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012
> ----------
>> txt=long.test.ex           This is a max-length chunk
> 789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234A short chunkA final chunk
> ===============
> 1 difference found.
> "test-stdout-munged" contains 62 lines; "stdout/2200" contains 62 lines.
>
> ... so my exim has lost
> 3456789012345678901234A short chunkA final chunk

Thanks for checking - I misplaced some of the testsuite part of the commit.
I think the actual fix is all there.

--
Cheers,
Jeremy


--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: dnsdb loses characters (exim 4.96.2, 4.97) [ In reply to ]
On Fri, 17 Nov 2023, Jeremy Harris via Exim-users wrote:

> On 17/11/2023 20:15, Andrew C Aitchison wrote:
>>     ./runtest 2200 -continue -keep
>> reports:
>>
>>>>> The following tests require: lookup dnsdb
>> dnsdb/2200 dnsdb lookup in string expansions
>> ** Comparison of test-stdout-munged with stdout/2200 failed===============
>> Line 4 of "test-stdout-munged" does not match line 4 of "stdout/2200".
>> ----------
>>> txt=long.test.ex           This is a max-length chunk
>> 78901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012
>> ----------
>>> txt=long.test.ex           This is a max-length chunk
>> 789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234A
>> short chunkA final chunk
>> ===============
>> 1 difference found.
>> "test-stdout-munged" contains 62 lines; "stdout/2200" contains 62 lines.
>>
>> ... so my exim has lost
>> 3456789012345678901234A short chunkA final chunk
>
> Thanks for checking - I misplaced some of the testsuite part of the commit.
> I think the actual fix is all there.

Thanks.
Once I add commit 2194d594e9f1f966cfa2e0e266d37216729b0fa1
(and run make in the test dir) runtest 2200 is happy.

--
Andrew C. Aitchison Kendal, UK
andrew@aitchison.me.uk

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/