Package: postfix
Version: 3.8.2-1
Severity: normal

Note: I am specifically discussing the postfix/destinations debconf
setting and the corresponding mydestination setting in
/etc/postfix/main.cf, but looking at the code in the postfix config
script, I suspect this issue may apply to other settings as well.

If I preload the postfix settings I want into the debconf database --
in particular if I set postfix/destinations to "localhost" -- and then
call dpkg-reconfigure -fnoninteractive postfix, here's what happens:

1. The config script notices that I have set postfix/destinations.
2. It calls postfix -hx mydestination, which returns the value of
   mydestination in /etc/postfix/main.cf OR THE DEFAULT VALUE IF THERE
   IS NO VALUE IN THE FILE.
3. It overwrites the postfix/destinations debconf setting with
   whatever postconf returned.
4. The postinst script is called and writes the value from
   postfix/destinations into /etc/postfix/main.cf.

As a result, the value that I explicitly put into the debconf setting
is lost, AND the wrong, default value that I don't want is explicitly
hard-coded into /etc/postfix/main.cf, perpetuating the error.

I kind of get the argument that if there is a value explicitly set in
/etc/postfix/main.cf it should override the debconf value, but if
there's no value in /etc/postfix/main.cf, then I don't think the
default value returned by postconf should overwrite an explicitly set
debconf value!

I think the fix for this would probably be to modify the config script
so that it calls postconf -nhx instead of postconf -hx and then only
replaces the setting in debconf if postconf returns a non-empty value.

Thanks,

Jonathan Kamens

-- System Information:
Debian Release: trixie/sid
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 
'testing'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 6.5.0-1-amd64 (SMP w/16 CPU threads; PREEMPT)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages postfix depends on:
ii  adduser                3.137
ii  cpio                   2.13+dfsg-7.1
ii  debconf [debconf-2.0]  1.5.82
ii  dpkg                   1.22.0
ii  e2fsprogs              1.47.0-2+b1
ii  init-system-helpers    1.65.2
ii  libc6                  2.37-10
ii  libdb5.3               5.3.28+dfsg2-2
ii  libicu72               72.1-3
ii  libnsl2                1.3.0-2
ii  libsasl2-2             2.1.28+dfsg1-3
ii  libssl3                3.0.11-1
ii  netbase                6.4
ii  ssl-cert               1.1.2

Versions of packages postfix recommends:
ii  ca-certificates  20230311
ii  python3          3.11.4-5+b1

Versions of packages postfix suggests:
ii  emacs-gtk [mail-reader]        1:29.1+1-5
ii  evolution [mail-reader]        3.50.0-1
ii  libsasl2-modules               2.1.28+dfsg1-3
ii  mailutils [mail-reader]        1:3.16-1+b1
pn  postfix-cdb                    <none>
pn  postfix-doc                    <none>
pn  postfix-ldap                   <none>
pn  postfix-lmdb                   <none>
pn  postfix-mta-sts-resolver       <none>
pn  postfix-mysql                  <none>
pn  postfix-pcre                   <none>
pn  postfix-pgsql                  <none>
pn  postfix-sqlite                 <none>
ii  procmail                       3.22-27
ii  systemd-resolved [resolvconf]  254.4-1
ii  thunderbird [mail-reader]      1:115.2.2-1
ii  ufw                            0.36.2-1

-- debconf information excluded

Reply via email to