Ssl – How to fix tls_sessions.db cyrusdb error

cyrusimapssl

Why there is no tls_sessions.db file and how to fix this error?

So I finally decided to go with Cyrus for my mail server.
(I'm still deciding exim4 or postfix though)

I installed those packages:

sudo apt install cyrus-imapd cyrus-common cyrus-admin cyrus-caldav cyrus-clients cyrus-doc cyrus-murder cyrus-nntpd cyrus-replication sasl2-bin

I had to jump between their Debian installation process and their Quickstart process. (Documentation here).

The testsaslauthd command always returned connect() : No such file or directory.

/var/log/mail.log shows :

Sep  9 06:24:23 server-2 cyrus/ctl_cyrusdb[13282]: skiplist: clean shutdown file missing, updating recovery stamp
Sep  9 06:24:23 server-2 cyrus/ctl_cyrusdb[13282]: recovering cyrus databases
Sep  9 06:24:23 server-2 cyrus/ctl_cyrusdb[13282]: done recovering cyrus databases
Sep  9 06:24:23 server-2 cyrus/cyr_expire[13285]: Expired 0 and expunged 0 out of 0 messages from 0 mailboxes
Sep  9 06:24:23 server-2 cyrus/cyr_expire[13285]: duplicate_prune: pruning back 3.00 days
Sep  9 06:24:23 server-2 cyrus/cyr_expire[13285]: duplicate_prune: purged 0 out of 0 entries
Sep  9 06:24:23 server-2 cyrus/tls_prune[13288]: DBERROR: opening /var/lib/cyrus/tls_sessions.db: cyrusdb error
Sep  9 06:24:23 server-2 cyrus/master[13281]: process type:START name:tlsprune path:/usr/sbin/cyrus age:0.000s pid:13288 exited, status 1
Sep  9 06:24:23 server-2 cyrus/master[13281]: can't run startup
Sep  9 06:24:23 server-2 cyrus/master[13281]: exiting

Indeed the tls_sessions.db file is missing but the only thing I read was a while back and it says the file is created once a TLS connection is made for the first time.

I will run it only in TLS mode but I would like it to work first 🙂

How can I create the tls database or what am I missing?
Thanks!

Best Answer

Just create an empty file:

# touch /var/lib/cyrus/tls_sessions.db
# chown cyrus:mail tls_sessions.db