Skip to content

Container Startup Fails on daemon start: opendkim #621

@alinmear

Description

@alinmear

Hey guys,

tried to provision a container instance for my kopano environment today. The initial container startup and also the following startups are failing at the daemon start function:

1155 function _start_daemons_opendkim()

I am using LDAP as user store, and also as mentioned in #478 the opendkim setup logic is not supporting ldap user store at the moment.

How to Reproduce:

In this example I'm not providing any config folder as volume mount (that's why I'm using ENABLE_LDAP, otherwise Startup procedure would fail, complaining about no users for postfix specified):

docker run --hostname "test.domain.com" -it --rm -e ENABLE_LDAP=1 -e DMS_DEBUG=1 --name mailtest tvial/docker-mailserver:latest

Starting mail server
 Starting cron  [ OK ]
 Starting rsyslog  [ OK ]
 Starting dovecot services  [ OK ]
 Starting opendkimfalse
  *  [ FAILED ]
Error: Please fix your configuration. Exiting...

Investigation:

start-mailserver.sh is calling /etc/init.d/opendkim start

This fails because opendkim is expecting the file KeyTable at /etc/opendkim/KeyTable (as defined in the config file for opendkim).

Starting OpenDKIM: opendkim: /etc/opendkim.conf: refile:/etc/opendkim/KeyTable: dkimf_db_open(): No such file or directory

Proposal/Fix:

The easiest thing would be to extend the _setup_dkim() function (Line 722):

[...]
if [ -e "/tmp/docker-mailserver/opendkim/KeyTable" ]; then
		[...]
	else
		notify 'warn' "No DKIM key provided. Check the documentation to find how to get your keys."

                # >>>
                local _f_keytable="/etc/opendkim/KeyTable"
                [ ! -f "$_f_keytable" ] && touch "$_f_keytable"
                # <<<
fi
[...]

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions