#999597 opendkim ignores IPv6 nets for InternalHosts file

Package:
opendkim
Source:
opendkim
Description:
DomainKeys Identified Mail (DKIM) signing and verifying milter
Submitter:
Aliaksei Sheshka
Date:
2021-11-15 19:12:02 UTC
Severity:
normal
Tags:
#999597#5
Date:
2021-11-13 05:41:54 UTC
From:
To:
Dear Maintainer,

OpenDKIM igores IPv6 nets for InternalHosts file.
For example, specifying 2001:0DB8::/32 or
2001:0db8:0000:0000:0000:0000:0000:0000/32
while the sender has IP 2001:db8:3604:3::1:1210
makes OpenDKIM to skip signing with the message:
[2001:db8:3604:3::1:1210] not internal

Addig 2001:db8:3604:3::1:1210 to the InternalHosts file works,
and OpenDKIM signs mail propely. However such workaround is not viable
for the practicality reasons.

#999597#10
Date:
2021-11-13 12:12:12 UTC
From:
To:
Control: severity -1 normal

I didn’t try it myself, but according to the documentation both forms
that you used are not allowed (upper case, uncompressed ‘::’):

2001:0DB8::/32
2001:0db8:0000:0000:0000:0000:0000:0000/32

Can you try one of the following instead, and see if it works? In any
case IPv6 CIDR notation should be supported in OpenDKIM.

2001:0db8::/32
2001:db8::/32
[2001:0db8::]/32
[2001:db8::]/32

#999597#17
Date:
2021-11-13 15:28:35 UTC
From:
To:
Indeed, form [2001:db8::]/32 worked, while others not.

I didn't see that in documentation.
However in the code,file ./opendkim/util.c there is a commentary
/* try it with square brackets */
which suggest it should try both versions.
And a single IPv6 indeed works without any brackets.
While for IPv6 it works only with square brackets, at least on my setup.