Skip to content

Bug: Postfix not launching with podman #396

Description

@cdivriotis97

Hi,

First of all, thank you for your work on this project.
I am opening this issue because I am currently unable to start the container image docker.io/lbr38/repomanager:latest, and after debugging it looks like the failure happens in the Postfix setup.

What happens

The container exits during startup with:

postfix/postlog: fatal: mail system startup failed

Environment

  • Podman
  • running as root
  • SELinux enforcing
  • also tested with --privileged
  • same behavior

Run command

Example:

podman run -d --name repomanager \
  -e FQDN=repomanager.example.org \
  -e MAX_UPLOAD_SIZE=32M \
  -p 8080:8080 \
  -v /etc/localtime:/etc/localtime:ro \
  -v /root/repomanager/data:/var/lib/repomanager:Z \
  -v /root/repomanager/repo:/home/repo:Z \
  docker.io/lbr38/repomanager:latest

Logs

The container logs end with:

[INF] Starting postfix...
...
postfix/postlog: starting the Postfix mail system
postfix/postlog: fatal: mail system startup failed

Debugging performed

I started a shell inside the image and checked Postfix manually.

/etc/mailname is missing

Running:

postfix check

initially returns:

postfix: fatal: /etc/mailname: cannot open file: No such file or directory

So Postfix expects /etc/mailname, but it is not present by default.

After providing /etc/mailname, I checked the active Postfix configuration with:

postconf -n

But I still got :

[INF] Starting postfix...
...
postfix/postlog: starting the Postfix mail system
postfix/postlog: fatal: mail system startup failed
root@da17ee10dd74:/var/lib/repomanager# postconf -e "myhostname = $FQDN"
root@da17ee10dd74:/var/lib/repomanager# echo "$FQDN" > /etc/mailname
root@da17ee10dd74:/var/lib/repomanager# cat /etc/mailname
repomanager.example.com
root@da17ee10dd74:/var/lib/repomanager# /usr/sbin/service postfix start
Starting the Postfix mail system: /etc/postfixpostfix/postlog: starting the Postfix mail system
postfix/postlog: fatal: mail system startup failed
 failed!

Postfix configuration appears to be applied correctly at container startup (myhostname and /etc/mailname are set, postfix check returns success), but service postfix start still fails. During startup, /var/spool/postfix/pid/master.pid is created, but no master process remains running afterwards and no runtime sockets are created in /var/spool/postfix/private or /var/spool/postfix/public.

If useful, I can provide the full command output from:

  • postfix check
  • postconf -n
  • postfix start-fg
  • podman inspect

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions