Public bug reported:

Summary:
postfix-resolvconf.service copies /etc/resolv.conf into the Postfix chroot
with the wrong owner, which then trips postfix-script's own "not owned by
root" sanity check on every subsequent postfix start/reload.

Details:

/usr/lib/systemd/system/postfix-resolvconf.service runs:

    ExecStart=cp -pLu /etc/resolv.conf
/var/spool/postfix/etc/resolv.conf

On a default Ubuntu install, systemd-resolved is enabled and
/etc/resolv.conf is a symlink to /run/systemd/resolve/stub-resolv.conf,
which is owned by systemd-resolve:systemd-resolve, not root.

`cp -p` preserves the source's ownership, and `-L` dereferences the
symlink down to that stub file. So the chroot copy ends up owned by
systemd-resolve:systemd-resolve instead of root.

postfix-script itself (same package) checks ownership of files copied
into the chroot and logs a warning if it isn't root:

    postfix/postfix-script: warning: not owned by root:
/var/spool/postfix/etc/resolv.conf

This warning then recurs on every postfix start/reload, and every time
the postfix-resolvconf.path unit fires (which watches /etc/resolv.conf
for changes and re-triggers the same cp command) — including on every
reboot.

Steps to reproduce:
1. Fresh Ubuntu 26.04 install with systemd-resolved enabled (default)
   and postfix installed with its resolvconf integration.
2. Reboot, or `systemctl start postfix-resolvconf.service`, or
   `systemctl restart postfix`.
3. Check `journalctl -u postfix` / mail.log for the "not owned by root"
   warning, and `ls -l /var/spool/postfix/etc/resolv.conf` to confirm
   the owner is systemd-resolve, not root.

Expected:
The chroot copy of resolv.conf should end up root-owned, matching what
postfix-script itself expects.

Actual:
The copy is owned by systemd-resolve:systemd-resolve, and the warning
repeats indefinitely.

Suggested fix:
Either drop the `-p` flag from the cp command in
postfix-resolvconf.service (the unit already runs as root, so the copy
would naturally end up root-owned), or add an explicit
`chown root:root /var/spool/postfix/etc/resolv.conf` step after the
copy.

Workaround (confirmed working locally): a systemd drop-in at
/etc/systemd/system/postfix-resolvconf.service.d/override.conf:

    [Service]
    ExecStartPost=chown root:root /var/spool/postfix/etc/resolv.conf

ProblemType: Bug
DistroRelease: Ubuntu 26.04
Package: postfix 3.10.6-4ubuntu2.2
ProcVersionSignature: Ubuntu 7.0.0-44.44-generic 7.0.14
Uname: Linux 7.0.0-44-generic x86_64
ApportVersion: 2.34.1-0ubuntu0.1
Architecture: amd64
CasperMD5CheckResult: unknown
Date: Thu Dec  3 14:51:18 2026
ProcEnviron:
 LANG=en_US.UTF-8
 PATH=(custom, no user)
 SHELL=/usr/bin/zsh
 TERM=xterm-256color
 XDG_RUNTIME_DIR=<set>
SourcePackage: postfix
UpgradeStatus: Upgraded to resolute on 2026-06-04 (182 days ago)
modified.conffile..etc.network.ip-down.d.postfix: [deleted]
modified.conffile..etc.postfix.post-install: [deleted]
modified.conffile..etc.postfix.postfix-script: [deleted]

** Affects: postfix (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug resolute

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2187243

Title:
  Incorrect permissions on resolv.conf in postfix chroot

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/postfix/+bug/2187243/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to