Control: tags -1 upstream Rob Leslie: > Package: opendkim > Version: 2.11.0~beta2-4 > Severity: important > > 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): > >> No value within the DSN may contain any of the six punctuation >> characters (":", "/", "@", "+", "?" and "=") used to delimit >> portions of the DSN. To include such characters within a value, >> encode them in quoted-printable style (e.g., "=20" will be >> translated into a single space character). Encoding of spaces >> is also advised. > > 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.: > >> % strace opendkim-testkey >> [...] >> lstat("=2Fetc=2Fmail=2Fconfig.sqlite", 0x7ffcad8871a0) = -1 ENOENT (No such >> file or directory) >> [...] >> >> opendkim-testkey: dkimf_db_open() failed > > I would have expected the database path (host value) to be decoded from > its quoted-printable form before being passed to OpenDBX.
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.