docker-mailserver: dovecot overrided files permission denied at server start

📝 Preliminary Checks

  • I tried searching for an existing issue and followed the debugging docs advice, but still need assistance.

👀 What Happened?

i start a simple docker postfix with dovecot files overrided but in the server, permission denied

image

and the status of overrided files image

👟 Reproduction Steps

execute sudo docker-compose up and check the logs

with this compose file

version: '3'
services:
  mailserver:
    image: docker.io/mailserver/docker-mailserver:latest
    container_name: mailserver
    hostname: mail.xx.ae
    domainname: xx.ae
    ports:
      - "25:25"
      - "143:143"
      - "587:587"
      - "993:993"
    volumes:
      - /usr/local/docker/mailserver/mail-data/:/var/mail/
      - /usr/local/docker/mailserver/mail-state/:/var/mail-state/
      - /usr/local/docker/mailserver/mail-logs/:/var/log/mail/
      - /usr/local/docker/mailserver/config/:/tmp/docker-mailserver/
      - /etc/localtime:/etc/localtime:ro
      - ./docker-data/dms/config/dovecot/dovecot.conf:/etc/dovecot/dovecot.conf
      - ./docker-data/dms/config/dovecot/dovecot-dict-sql.conf.ext:/etc/dovecot/dovecot-dict-sql.conf.ext
      - ./docker-data/dms/config/dovecot/dovecot-sql.conf.ext:/etc/dovecot/dovecot-sql.conf.ext
      
    environment:
      - ENABLE_SPAMASSASSIN=1
      - SPAMASSASSIN_SPAM_TO_INBOX=1
      - ENABLE_CLAMAV=1
      - ENABLE_FAIL2BAN=1
      - ENABLE_POSTGREY=1
      - ENABLE_SASLAUTHD=0
      - ONE_DIR=1
      - DMS_DEBUG=0
      - PERMIT_DOCKER=host
    cap_add:
      - NET_ADMIN
      - SYS_PTRACE
    restart: always

I just want to reproduce locally a server running to test shared mail not working in production

🐋 DMS Version

12.1.0

💻 Operating System and Architecture

linux fedora 37

⚙️ Container configuration files

version: '3'
services:
  mailserver:
    image: docker.io/mailserver/docker-mailserver:latest
    container_name: mailserver
    hostname: mail.equitativa.ae
    domainname: equitativa.ae
    ports:
      - "25:25"
      - "143:143"
      - "587:587"
      - "993:993"
    volumes:
      - /usr/local/docker/mailserver/mail-data/:/var/mail/
      - /usr/local/docker/mailserver/mail-state/:/var/mail-state/
      - /usr/local/docker/mailserver/mail-logs/:/var/log/mail/
      - /usr/local/docker/mailserver/config/:/tmp/docker-mailserver/
      - /etc/localtime:/etc/localtime:ro
      - ./docker-data/dms/config/dovecot/dovecot.conf:/etc/dovecot/dovecot.conf
      - ./docker-data/dms/config/dovecot/dovecot-dict-sql.conf.ext:/etc/dovecot/dovecot-dict-sql.conf.ext
      - ./docker-data/dms/config/dovecot/dovecot-sql.conf.ext:/etc/dovecot/dovecot-sql.conf.ext
      
    environment:
      - ENABLE_SPAMASSASSIN=1
      - SPAMASSASSIN_SPAM_TO_INBOX=1
      - ENABLE_CLAMAV=1
      - ENABLE_FAIL2BAN=1
      - ENABLE_POSTGREY=1
      - ENABLE_SASLAUTHD=0
      - ONE_DIR=1
      - DMS_DEBUG=0
      - PERMIT_DOCKER=host
    cap_add:
      - NET_ADMIN
      - SYS_PTRACE
    restart: always

📜 Relevant log output

No response

Improvements to this form?

No response

About this issue

  • Original URL
  • State: closed
  • Created 10 months ago
  • Comments: 27 (16 by maintainers)

Most upvoted comments

sudo docker exec -it mailserver apt-get install nano
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package nano

Because of this, you have to run this before: sudo docker exec -it mailserver apt-get update

O after some instigation as you mentionned selinux cause issue so adding :Z make the trick

version: '3'
services:
  mailserver:
    image: ghcr.io/docker-mailserver/docker-mailserver:latest
    container_name: mailserver
    hostname: mail.equitativa.ae
    #env_file: mailserver.env
    ports:
      - "25:25"
      - "143:143"
      - "587:587"
      - "993:993"
      - "8082:8082"
    volumes:
      - ./docker-data/mail-data/:/var/mail/:Z
      - ./docker-data/mail-state/:/var/mail-state/:Z
      - ./docker-data/mail-logs/:/var/log/mail/:Z
      - ./docker-data/config/:/tmp/docker-mailserver/:Z
      - /etc/localtime:/etc/localtime:ro
      - ./docker-data/dms/config/dovecot/10-master.conf:/etc/dovecot/conf.d/10-master.conf:Z
    environment:
      - ENABLE_QUOTAS=0 
      - PERMIT_DOCKER=host
    cap_add:
      - NET_ADMIN
    restart: always

then for the apt-get we need to do apt-get update, then the install work, but some cmd are not existing, like ifconfig or netstat

so then this is the issue i have

[   INF   ]  Welcome to docker-mailserver 12.1.0
[   INF   ]  Checking configuration
[ WARNING ]  This container was (likely) improperly restarted which can result in undefined behavior
[ WARNING ]  Please destroy the container properly and then start DMS again
[   INF   ]  Configuring mail server
sed: cannot rename /etc/dovecot/conf.d/sed3kptni: Device or resource busy
sed: cannot rename /etc/dovecot/conf.d/sedoEn3Fj: Device or resource busy
sed: cannot rename /etc/dovecot/conf.d/sedL6Efio: Device or resource busy
[ WARNING ]  !! INSECURE !! SSL configured with plain text access - DO NOT USE FOR PRODUCTION DEPLOYMENT
[   INF   ]  Starting daemons
[   INF   ]  mail.equitativa.ae is up and running
Sep 14 15:44:18 mail amavis[489]: starting. /usr/sbin/amavisd-new at mail.equitativa.ae amavisd-new-2.11.1 (20181009), Unicode aware, LC_CTYPE="C.UTF-8"
Sep 14 15:44:18 mail amavis[489]: perl=5.032001, user=, EUID: 109 (109);  group=, EGID: 111 111 (111 111)
Sep 14 15:44:18 mail amavis[489]: Net::Server: Group Not Defined.  Defaulting to EGID '111 111'
Sep 14 15:44:18 mail amavis[489]: Net::Server: User Not Defined.  Defaulting to EUID '109'
Sep 14 15:44:18 mail amavis[489]: No ext program for   .zoo, tried: zoo
Sep 14 15:44:18 mail amavis[489]: No ext program for   .doc, tried: ripole
Sep 14 15:44:18 mail amavis[489]: No decoder for       .F   
Sep 14 15:44:18 mail amavis[489]: No decoder for       .doc 
Sep 14 15:44:18 mail amavis[489]: No decoder for       .zoo 

but i managed to connect form postman on the rest api !