OpenDKIM icon indicating copy to clipboard operation
OpenDKIM copied to clipboard

ldapi:// not working

Open andreasschulze opened this issue 2 years ago • 4 comments

I tried to setup OpenDKIM to use ldapi URIs in KeyTable and Signingtable. This does not work here.

what's working in opendkim.conf:

KeyTable     ldap://ldapserver.example/dc=example?DKIMDomain,DKIMSelector,DKIMKey,?sub?(DKIMSelector=$d)
SigningTable ldap://ldapserver.example/dc=example?DKIMSelector?sub?(DKIMIdentity=$d)

but If OpenDKIM fail if I configure

KeyTable     ldapi://%2Fpath%2Fto%2Fldapi/dc=example?DKIMDomain,DKIMSelector,DKIMKey,?sub?(DKIMSelector=$d)
SigningTable ldapi://%2Fpath%2Fto%2Fldapi/dc=example?DKIMSelector?sub?(DKIMIdentity=$d)

I verified, the socket is present using ldapsearch:

ldapsearch -x -H ldapi://%2Fpath%2Fto%2Fldapi -b dc=example

Using strace I found OpenDKIM still tries to access /usr/local/var/run/ldapi which is a default location of OpenLDAP.

If I place a Symlink from /usr/local/var/run/ldapi pointing to /path/to/ldapi, the existing socket, everything works as expected.

andreasschulze avatar Jan 29 '23 13:01 andreasschulze

Is this a typo?

KeyTable     ldap://%2Fpath%2Fto%2Fldapi/dc=example?DKIMDomain,DKIMSelector,DKIMKey,?sub?(DKIMSelector=$d)
SigningTable ldap://%2Fpath%2Fto%2Fldapi/dc=example?DKIMSelector?sub?(DKIMIdentity=$d)

I would expect:


KeyTable     ldapi://%2Fpath%2Fto%2Fldapi/dc=example?DKIMDomain,DKIMSelector,DKIMKey,?sub?(DKIMSelector=$d)
SigningTable ldapi://%2Fpath%2Fto%2Fldapi/dc=example?DKIMSelector?sub?(DKIMIdentity=$d)

quanah avatar Jan 30 '23 16:01 quanah

yep, copy&paste error, now corrected ...

andreasschulze avatar Jan 30 '23 17:01 andreasschulze

Ok. Well, I know it was working when I played with it years ago. As long as the ldapi URI is passed correctly to libldap, the default socket path shouldn't matter. Do you know what version of OpenLDAP the libldap you're using comes from?

quanah avatar Feb 03 '23 16:02 quanah

it's openldap-2.6.3

andreasschulze avatar Feb 04 '23 21:02 andreasschulze