OpenDKIM
                                
                                
                                
                                    OpenDKIM copied to clipboard
                            
                            
                            
                        RFC 8616 and a configure issue
RFC 8616 allows UTF-8 characters in domain and selector (and the i= tag). That doesn't seem to disturb signing. However, verification is hampered by a couple of ASCII checks in dkim.c. In addition, looking up the key requires IDNA encoding.
The configure issue should go in a separate bug, but I report it here to avoid having to manually edit the diff.  It is res_ninit, which is not detected it it is a macro (similar to bug #23).
The patch attached is a diff against the trunk at revision 5013. It makes verification work. patch.txt
Your patch has a bug, at least for those that do not have the IDNA library - EAI_INCOMPATIBLE is only defined in dkim_keys.c, not in dkim.c, so it's no use checking for it there because it will always fail. Move the includes and the define to dkim_keys.h and all is fine.
That's correct. The patch is obviously meant to be used with libidn2.
I tagged EAI_INCOMPATIBLE some snippets of code so as to make the patch more readable, while hoping that it would never be defined. In dkim.c, it excludes checking that I consider unneeded. Their removal shouldn't prevent the library from working. If there are cases where omitting those checks causes harm, then the patch must be revised for the EAI compatible version as well.