docker icon indicating copy to clipboard operation
docker copied to clipboard

postfix/postlog: fatal: Postfix integrity check failed!

Open RobinFrcd opened this issue 7 months ago • 4 comments

Support guidelines

I've found a bug and checked that ...

  • [x] ... the documentation does not mention anything about my problem
  • [ ] ... there are no open or closed issues that are related to my problem

Description

Hi, So I found a similar issue in the repo, but the person closed it without any comment... https://github.com/anonaddy/docker/issues/333

I recently moved my anonaddy docker deployment to another instance. Before restarting it I made sure to sudo chown -R 1000:1000 ./data.

I'm starting the container with docker-compose, I didn't change any user/group id.

  addy:
    image: anonaddy/anonaddy:latest
    container_name: addy
    depends_on:
      - db
      - redis
    ports:
      - "25:25/tcp"
      - "127.0.0.1:8484:8000/tcp"
    volumes:
      - "./data:/data:rw"
    env_file:
      - "./addy.env"
    environment:
      - "DB_HOST=db"
      - "DB_DATABASE=${MYSQL_DATABASE}"
      - "DB_USERNAME=${MYSQL_USER}"
      - "DB_PASSWORD=${MYSQL_PASSWORD}"
      - "REDIS_HOST=redis"
    restart: always

The service starts but outputs this error in loop:

2025/04/15 10:06:34 [notice] 751#751: start worker process 825
2025/04/15 10:06:34 [notice] 751#751: start worker process 826
2025/04/15 10:06:34 [notice] 751#751: start worker process 827
postsuper: fatal: scan_dir_push: open directory defer: Permission denied
[15-Apr-2025 10:06:35] NOTICE: fpm is running, pid 742
[15-Apr-2025 10:06:35] NOTICE: ready to handle connections
2025-04-15 10:06:35 #749(main) <e9dca5>; main; main: rspamd 3.10.2 is loading configuration, build id: release
postfix/postlog: fatal: Postfix integrity check failed!
postsuper: fatal: scan_dir_push: open directory defer: Permission denied
postfix/postlog: fatal: Postfix integrity check failed!
postsuper: fatal: scan_dir_push: open directory defer: Permission denied
postfix/postlog: fatal: Postfix integrity check failed!
postsuper: fatal: scan_dir_push: open directory defer: Permission denied
postfix/postlog: fatal: Postfix integrity check failed!
postsuper: fatal: scan_dir_push: open directory defer: Permission denied
postfix/postlog: fatal: Postfix integrity check failed!
postsuper: fatal: scan_dir_push: open directory defer: Permission denied
postfix/postlog: fatal: Postfix integrity check failed!
postsuper: fatal: scan_dir_push: open directory defer: Permission denied
postfix/postlog: fatal: Postfix integrity check failed!
postsuper: fatal: scan_dir_push: open directory defer: Permission denied

Expected behaviour

No permissions issues

Actual behaviour

postfix/postlog: fatal: Postfix integrity check failed!
postsuper: fatal: scan_dir_push: open directory defer: Permission denied

Steps to reproduce

Move a working docker volumes to another instance, and restart the instance.

Docker info

Client: Docker Engine - Community
 Version:    28.0.4
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.22.0
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.34.0
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 17
  Running: 17
  Paused: 0
  Stopped: 0
 Images: 45
 Server Version: 28.0.4
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 05044ec0a9a75232cad458027ca83437aae3f4da
 runc version: v1.2.5-0-g59923ef
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 5.10.0-34-amd64
 Operating System: Debian GNU/Linux 11 (bullseye)
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 7.65GiB
 Name: ns3292359
 ID: RJH4:VNMN:AS7Q:6L4M:UMAW:CELN:W44Z:JNGH:HYZV:WF6U:T3RF:CZEI
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  ::1/128
  127.0.0.0/8
 Live Restore Enabled: false

Docker Compose config

name: addy

services:
  db:
    image: mariadb:10
    container_name: addy_db
    command:
      - "mysqld"
      - "--character-set-server=utf8mb4"
      - "--collation-server=utf8mb4_unicode_ci"
    volumes:
      - "./db:/var/lib/mysql"
    environment:
      - "MARIADB_RANDOM_ROOT_PASSWORD=yes"
      - "MYSQL_DATABASE"
      - "MYSQL_USER"
      - "MYSQL_PASSWORD"
    restart: always

  redis:
    image: redis:4.0-alpine
    container_name: addy_redis
    restart: always

  addy:
    image: anonaddy/anonaddy:latest
    container_name: addy
    depends_on:
      - db
      - redis
    ports:
      - "25:25/tcp"
      - "127.0.0.1:8484:8000/tcp"
    volumes:
      - "./data:/data:rw"
    env_file:
      - "./addy.env"
    environment:
      - "DB_HOST=db"
      - "DB_DATABASE=${MYSQL_DATABASE}"
      - "DB_USERNAME=${MYSQL_USER}"
      - "DB_PASSWORD=${MYSQL_PASSWORD}"
      - "REDIS_HOST=redis"
    restart: always

Logs

postsuper: fatal: scan_dir_push: open directory defer: Permission denied
postfix/postlog: fatal: Postfix integrity check failed!
postsuper: fatal: scan_dir_push: open directory defer: Permission denied
postfix/postlog: fatal: Postfix integrity check failed!
postsuper: fatal: scan_dir_push: open directory defer: Permission denied
postfix/postlog: fatal: Postfix integrity check failed!
postsuper: fatal: scan_dir_push: open directory defer: Permission denied
postfix/postlog: fatal: Postfix integrity check failed!
postsuper: fatal: scan_dir_push: open directory defer: Permission denied

Additional info

No response

RobinFrcd avatar Apr 15 '25 10:04 RobinFrcd

Alright, so after checking a bit more it seems that the default user in the container is root (0) and not 1000. I deleted the postfix folder and now it works.

But before we close the issue, I just want to make sure this is expected. It's written in the Readme that the default user is PUID: user id (default 1000) but I get this:

$ docker compose exec addy id   
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel),11(floppy),20(dialout),26(tape),27(video)

Is that expected ?

Thanks !

RobinFrcd avatar Apr 15 '25 21:04 RobinFrcd

Hi, I have the same issue. I've delted /etc/postfix and /var/spool/postfix (separately and together) and the error logs still appear - even after a restart or recreating the container. Which folder did you delete exactly?

Perhaps as additional information: I've explicitly set PUID and PGID to 1000 in the env file.

shoneg avatar Apr 26 '25 17:04 shoneg

I mount my volume with

    volumes:
      - "./data:/data:rw"

And I did a mv data/postfix data/postfix.bak

RobinFrcd avatar Apr 26 '25 17:04 RobinFrcd

Thank you very much. Now it works for me again🥳

shoneg avatar Apr 26 '25 18:04 shoneg