Control: severity -1 important
Control: tag -1 + confirmed
Control: merge 734401 -1

On Tue, 03 Oct 2023 11:43:57 -0400 Jonathan Kamens <j...@kamens.us> wrote:
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.

Yes, you're exactly right here.  See also https://bugs.debian.org/734401
(filed 10 years ago) which says exactly the same.

Thanks,

/mjt

Reply via email to