OpenDKIM icon indicating copy to clipboard operation
OpenDKIM copied to clipboard

Can't connect to memcached

Open mattparlane opened this issue 1 year ago • 3 comments

Hi all... Not sure if this is a bug, but I'm stumped.

I'm trying to connect opendkim with memcached, but I'm getting the following error:

root@ad66fb76c1d5:~# /usr/sbin/opendkim -x /etc/opendkim.conf -u opendkim -P /var/run/opendkim.pid
opendkim: opendkim-db.c:6433: dkimf_db_walk: Assertion `0' failed.
Aborted (core dumped)

Here are the relevant lines from my opendkim.conf:

KeyTable memcache:localhost/key
SigningTable memcache:localhost/sign

and here is my command line:

/usr/sbin/opendkim -x /etc/opendkim.conf -u opendkim -P /var/run/opendkim.pid

memcached is indeed running and accessible:

root@ad66fb76c1d5:~# telnet localhost 11211
Trying ::1...
Connected to localhost.
Escape character is '^]'.
stats
STAT pid 7
STAT uptime 4018
...

I'm using the Ubuntu distribution of opendkim, and it is compiled with memcache support.

Any ideas? Thanks!

mattparlane avatar Jun 17 '24 22:06 mattparlane

The function dkimf_db_walk() don't have the code for db->db_type == DKIMF_DB_TYPE_MEMCACHE.

Function dkimf_db_walk() is used for SigningTable in opendkim.c (opendkim(8)), for KeyTable in opendkim-genzone.c (opendkim-genzone(8)) and opendkim-testkey.c (opendkim-testkey(8)), for ReputationLimits and ReputationLimitModifiers in reputation.c (opendkim(8)), and for ATPS db in opedkim-atpszone.c (opendkim-atpszone(8); obsolete).

So we can't use memecache DB for SigningTable, ReputationLimits and ReputationLimitModifiers datasets, and if we use memcache DB for KeyTable, we cant use opendkim-genzone(8) and opendkim-testkey(8).

futatuki avatar Jun 18 '24 04:06 futatuki

With the patch in PR #219, opendkim(8) might avoid assertion failure caused by unhandled DB type in dkimf_db_walk(). opendkim(8) would not crash on the verification of SigningTable even if it is memecache, although it is not mean directly that we can use memecached for SigningTable.

futatuki avatar Jun 20 '24 04:06 futatuki

Although I've not tested, it is expected that you can use memcached table as Signing Table by using the patch in PR #228 and with suitable config setting or with suitable command option.

futatuki avatar Oct 03 '24 23:10 futatuki