#1030334 opendkim: does not work with sqlite3

Package:
opendkim
Source:
opendkim
Description:
DomainKeys Identified Mail (DKIM) signing and verifying milter
Submitter:
Rob Leslie
Date:
2023-02-03 13:45:02 UTC
Severity:
normal
Tags:
#1030334#5
Date:
2023-02-03 04:44:55 UTC
From:
To:
Dear Maintainer,

I have been unable to use opendkim with an sqlite3 data source.

According to the OpenDBX documentation[1], the sqlite backend uses the
host information to provide a path to the directory where the database
is stored, and the database name is used as the name of a file in that
directory.

In order to include this information within opendkim's dataset DSN
string, it seems the absolute pathname must be encoded as described in
opendkim(8):

So, in order to use a database path like /etc/mail/config.sqlite, I
would like to use something like this:

KeyTable dsn:sqlite3://=2Fetc=2Fmail=2F/config.sqlite/table=dkim_keys?keycol=domain?datacol=domain,selector,private_key

However, strace reveals that opendkim is using the host and database
values to construct a database file path without any quoted-printable
decoding, e.g.:

I would have expected the database path (host value) to be decoded from
its quoted-printable form before being passed to OpenDBX.

Thank you.

[1]: https://linuxnetworks.de/doc/index.php?title=OpenDBX/Configuration#sqlite3_backend

#1030334#10
Date:
2023-02-03 13:32:21 UTC
From:
To:
Rob Leslie:

Looking at the code, it is clear that the quoted-printable encoding
documented in the manual page has not been implemented.

A desperate workaround might be to create a symlink to
/etc/mail/config.sqlite from a file config.sqlite in the working
directory of the opendkim process, with configuration

KeyTable dsn:sqlite3://config/.sqlite/table=...

hoping that the resulting concatenated file path then points to the
right place. But ultimately a patch is needed.