Bug 2055024

Summary: Default settings in`postfix -d` differ from the actual default settings of postfix in RHEL
Product: Red Hat Enterprise Linux 8 Reporter: Sergei Petrosian <spetrosi>
Component: postfixAssignee: Jaroslav Škarvada <jskarvad>
Status: CLOSED WONTFIX QA Contact: František Hrdina <fhrdina>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: ---CC: fhrdina, rmeggins
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-08-16 07:28:34 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Sergei Petrosian 2022-02-16 08:53:45 UTC
Description of problem:
A common user scenario is to be able to reset configuration to the defaults.
When running `postconf -d` to receive default values, `postconf` prints upstream defaults. However, in RHEL, some defaults settings are different from the upstream defaults. Hence, it is impossible to get the real default settings for some parameters.
The fault defaults can be found by running `postconf -n` that prints settings that are different from the defaults. 

Version-Release number of selected component (if applicable):
postfix-3.5.8-2.el8.x86_64.rpm

How reproducible:
Always

Steps to Reproduce:
1. Install postfix
2. Enter `postconf -d` to find the default settings
3. Enter `postconf` to find the current settings

Actual results:
Some values at the output of `postconf -d` and `postconf` are different.

Expected results:
The outputs of `postconf -d` and `postconf` must be the same because we have just installed the package and did not change any settings.

Additional info:
The script that compares outputs of two commands and prints settings that are different:
~~~
#!/bin/bash
settings_to_apply=__postconf_settings_to_apply.txt
current_settings=__postconf_current.txt
default_settings=__postconf_defaults.txt
postconf > $current_settings
postconf -d > $default_settings
while read line; do
  if ! grep -Fxq "$line" $current_settings; then
    echo $line >> $settings_to_apply
  fi
done < $default_settings
cat $settings_to_apply
~~~

I think that the settings are rewritten in the spec file here but I might be wrong:
https://src.osci.redhat.com/rpms/postfix/blob/rhel-9.0.0/f/postfix.spec#_356

Comment 1 Jaroslav Škarvada 2022-02-16 16:44:57 UTC
Yes, this is problem and currently I am unsure how to solve it the best way. RHEL defaults differ a bit from the upstream defaults. The 'postconf -d' shows upstream defaults. But there is no option to show RHEL defaults. We could a) patch 'postconf -d' to show the RHEL defaults but then there will be no way how to get the upstream defaults (i.e. 'postconf -d' behavior will differ from the upstream). Or b) we could propose new postconf option to show the RHEL defaults, then the postconf behavior will differ from the upstream. Or c) we could provide new tool to show just the RHEL defaults. Or d) update the RHEL defaults to be the same as the upstream defaults. Unfortunately, d) probably isn't currently possible, because we need some hardening.

Comment 2 Sergei Petrosian 2022-02-21 12:15:02 UTC
How about providing a new file `/etc/postconf/main.cf.distribution.defaults` that is a copy of the distribution default `main.cf`?
This can be done within the spec file.

Comment 4 RHEL Program Management 2023-08-16 07:28:34 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.