Docker-mailserver: Cannot start server

Created on 30 Apr 2017  路  10Comments  路  Source: tomav/docker-mailserver

Dear all,

I tried for several hours to get this image working and still have the same error:

docker log

docker-mailserver

Initializing setup
Checking configuration
Configuring mail server

  • No DKIM key provided. Check the documentation to find how to get your keys.
    Starting Misc
    Starting mail server
    Error: Please fix your configuration. Exiting...

docker-compose.yml
version: '2'

services:
mail:
build: docker-mailserver
hostname: xxxxxx
domainname: xxxx.xx
container_name: mail
ports:
- "25:25"
- "143:143"
- "587:587"
- "993:993"
volumes:
- ./maildata/:/var/mail
- ./mailstate/:/var/mail-state
- ./letsencrtypt/:/etc/letsencrypt/
- ./config/:/tmp/docker-mailserver/
environment:
- ENABLE_SPAMASSASSIN=1
- ENABLE_CLAMAV=1
- ENABLE_FAIL2BAN=1
- ENABLE_POSTGREY=1
- ONE_DIR=1
- DMS_DEBUG=0
- SSL_TYPE=letsencrypt
cap_add:
- NET_ADMIN

volumes:
maildata:
driver: local
mailstate:
driver: local

The docker-mailserver directory contains the git clone of the project. Using the suggested image ( tvial/docker-mailserver:latest) yelds the same results.

Can you please help me start this image?

BR,
Alecs

Most helpful comment

Hi, i have exact the same failure.

if i downgrade to docker-mailserver 2.2, then opendkim will be started, but then the error comes during start of amavis.

Output is then:
...
Starting amavisfalse
[ FAILED ] Error: Please fix your configuration. Exiting...

All 10 comments

Hi @alecsandruchirosca, to have more detail, use DMS_DEBUG=1, restart container and paste the console log.

`#
#

ENV

#
#

HOSTNAME=xxxxxx.xxxx.xx
DMS_DEBUG=1
VIRUSMAILS_DELETE_DELAY=7
ENABLE_CLAMAV=1
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
ENABLE_FAIL2BAN=1
ENABLE_SPAMASSASSIN=1
PWD=/
SHLVL=1
HOME=/root
ONE_DIR=1
SSL_TYPE=letsencrypt
DEBIAN_FRONTEND=noninteractive
ENABLE_POSTGREY=1
_=/usr/bin/printenv

#
#

docker-mailserver

#
#

Initializing setup
Registering check,setup,fix,misc and start-daemons functions

  • _check_environment_variables() registered
  • _check_hostname() registered
  • _setup_default_vars() registered
  • _setup_dovecot() registered
  • _setup_dovecot_local_user() registered
  • _setup_postgrey() registered
  • _setup_dkim() registered
  • _setup_ssl() registered
  • _setup_docker_permit() registered
  • _setup_mailname() registered
  • _setup_amavis() registered
  • _setup_dmarc_hostname() registered
  • _setup_postfix_hostname() registered
  • _setup_dovecot_hostname() registered
  • _setup_postfix_sasl() registered
  • _setup_postfix_override_configuration() registered
  • _setup_postfix_sasl_password() registered
  • _setup_security_stack() registered
  • _setup_postfix_aliases() registered
  • _setup_postfix_vhost() registered
  • _setup_environment() registered
  • _fix_var_mail_permissions() registered
  • _fix_var_amavis_permissions() registered
  • _misc_save_states() registered
  • _start_daemons_cron() registered
  • _start_daemons_rsyslog() registered
  • _start_daemons_dovecot() registered
  • _start_daemons_opendkim() registered
  • _start_daemons_opendmarc() registered
  • _start_daemons_postgrey() registered
  • _start_daemons_postfix() registered
  • _start_daemons_fail2ban() registered
  • _start_daemons_clamav() registered
  • _start_daemons_amavis() registered
    Checking configuration
    Check that there are no conflicts with env variables [_check_environment_variables]
    Check that hostname/domainname is provided or overidden (no default docker hostname/kubernetes) [_check_hostname]
  • Domain has been set to xxxx.xx
  • Hostname has been set to xxxxxx.xxxx.xx
    Configuring mail server
    Setting up default variables [_setup_default_vars]
  • Set ENABLE_LDAP=0
  • Set ENABLE_FETCHMAIL=0
  • Set OVERRIDE_HOSTNAME=
  • Set ENABLE_MANAGESIEVE=0
  • Set DMS_DEBUG=1
  • Set ENABLE_POP3=0
  • Set ENABLE_SASLAUTHD=0
  • Set ENABLE_CLAMAV=1
  • Set SMTP_ONLY=0
  • Set ENABLE_FAIL2BAN=1
  • Set ENABLE_SPAMASSASSIN=1
  • Set POSTGREY_DELAY=300
  • Set POSTGREY_TEXT=Delayed by postgrey
  • Set ENABLE_POSTGREY=1
  • Set POSTGREY_MAX_AGE=35
    Setting up Dovecot
    Setting up Dovecot Local User
  • 'config/docker-mailserver/postfix-accounts.cf' is not provided. No mail account created.
  • Configuring postgrey
    Setting up DKIM
  • No DKIM key provided. Check the documentation to find how to get your keys.
    Setting up SSL
    Setting up PERMIT_DOCKER Option
  • Adding container ip in my networks
    Setting up Mailname
  • Creating /etc/mailname
    Setting up Amavis
  • Applying hostname to /etc/amavis/conf.d/05-node_id
    Setting up dmarc
  • Applying hostname to /etc/opendmarc.conf
    Applying hostname and domainname to Postfix
  • Applying hostname to /etc/postfix/main.cf
    Applying hostname to Dovecot
  • Applying hostname to /etc/dovecot/conf.d/15-lda.conf
    Setting up Postfix Override configuration
  • No extra postfix settings loaded because optional '/tmp/docker-mailserver/postfix-main.cf' not provided.
    Setting up Postfix SASL Password
  • Warning: 'SASL_PASSWD' is not provided. /etc/postfix/sasl_passwd not created.
    Setting up Security Stack
  • Enabling and configuring spamassassin
  • Enabling clamav
  • Fail2ban enabled
    Setting up Postfix Aliases
  • Warning 'config/postfix-virtual.cf' is not provided. No mail alias/forward created.
    Setting up Postfix vhost
    Setting up /etc/environment
    Checking /var/mail permissions
  • Permissions in /var/mail look OK
    Checking $amavis_state_dir permissions
  • Permissions in /var/mail-state/lib-amavis look OK
    Starting Misc
  • Consolidating all state onto /var/mail-state
  • Destination /var/mail-state/spool-postfix exists, linking /var/spool/postfix to it
  • Destination /var/mail-state/lib-postfix exists, linking /var/lib/postfix to it
  • Destination /var/mail-state/lib-amavis exists, linking /var/lib/amavis to it
  • Destination /var/mail-state/lib-clamav exists, linking /var/lib/clamav to it
  • Destination /var/mail-state/lib-spamassasin exists, linking /var/lib/spamassasin to it
  • Destination /var/mail-state/lib-fail2ban exists, linking /var/lib/fail2ban to it
  • Destination /var/mail-state/lib-postgrey exists, linking /var/lib/postgrey to it
    Starting mail server
    Starting cron [ OK ]
    Starting rsyslog [ OK ]
    Starting dovecot services [ OK ]
    Starting opendkimfalse
  • [ FAILED ]
    Error: Please fix your configuration. Exiting...
    `

With DMS_DEBUG I got the above log (docker log mail ).

BR,
Alecs

Hi, i have exact the same failure.

if i downgrade to docker-mailserver 2.2, then opendkim will be started, but then the error comes during start of amavis.

Output is then:
...
Starting amavisfalse
[ FAILED ] Error: Please fix your configuration. Exiting...

3 other error to solve:

May  6 12:36:14 mail postgrey[3623]: FATAL: ERROR: can't open lock file: /var/lib/postgrey/postgrey.lock#012

May  6 12:36:15 mail postfix[4414]: Postfix is running with backwards-compatible default settings
May  6 12:36:15 mail postfix[4414]: See http://www.postfix.org/COMPATIBILITY_README.html for details
May  6 12:36:15 mail postfix[4414]: To disable backwards compatibility use "postconf compatibility_level=2" and "postfix reload"

May  6 12:36:15 mail postfix/master[4451]: fatal: open lock file /var/lib/postfix/master.lock: cannot create file exclusively: Permission denied

Tried manually (and had to disable ONE_DIRbut after that it worked well).
No idea yet yo a long term patch. Ideas welcome.

Maybe this also relates to #545.

Although it works for me just well, I also receive backwards-compatibility warnings in my logs.

Will have a look at this later.

Duplicates https://github.com/tomav/docker-mailserver/issues/545
Move this discussion there.

@alecsandruchirosca you had this error because no user account has been provided:
'config/docker-mailserver/postfix-accounts.cf' is not provided. No mail account created. is debug log.
I reproduced this issue today, I'll add a fix.

:latest image available.

491 & #621

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Dubbeldrank picture Dubbeldrank  路  4Comments

strarsis picture strarsis  路  5Comments

nekrondev picture nekrondev  路  3Comments

42wim picture 42wim  路  4Comments

xiao1201 picture xiao1201  路  4Comments