Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1307081

Summary: [Patch] Timestamps for configuration files are not kept (causes warnings after Postfix update)
Product: Red Hat Enterprise Linux 7 Reporter: Robert Scheck <redhat-bugzilla>
Component: postfixAssignee: Jaroslav Škarvada <jskarvad>
Status: CLOSED ERRATA QA Contact: Patrik Moško <pmosko>
Severity: medium Docs Contact:
Priority: low    
Version: 7.2CC: kvolny, olysonek, pmosko, psklenar, robert.scheck, thozza
Target Milestone: rcKeywords: EasyFix, Patch, Reproducer, TestCaseProvided
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: postfix-2.10.1-8.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1307064 Environment:
Last Closed: 2020-03-31 19:10:27 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:
Bug Depends On:    
Bug Blocks: 1716960    
Attachments:
Description Flags
postfix-2.6.6-timestamp.patch
none
patch
none
Backported fix none

Description Robert Scheck 2016-02-12 16:17:34 UTC
Description of problem:
By default all timestamps of /etc/postfix/* are the timestamps of "make
install" when the RPM package is built. While this is not an issue in general,
this may cause warnings after a postfix update in a common scenario like
this:

Have /etc/postfix/virtual empty (like the default), but reference it within 
main.cf. This needs a "postmap /etc/postfix/virtual" indeed. Everything fine
so far. Then a postfix update happens, /etc/postfix/virtual gets replaced by
the newer file from the RPM package - which leads to a newer timestamp. This 
however makes postfix complaining in logs: "postfix/smtpd[11483]: warning: 
database /etc/postfix/virtual.db is older than source file /etc/postfix/
virtual". The main point here, is that the content of virtual nor virtual.db
changed, just the timestamp of the "source" file.

This issue could be avoided if "install -p" rather "install" is used or if
there is a "touch -c -r <reference>" within the spec file. If there is any
upstream change of one of these files, the newer filestamp would indeed be
applied and thus causes a *.rpmnew (if the original file was touched) - as
it's expected further on.

Version-Release number of selected component (if applicable):
postfix-2.10.1-6.el7.x86_64

How reproducible:
Everytime, see above.

Actual results:
Timestamps for configuration files are not kept (causes warnings after Postfix 
update).

Expected results:
Timestamps for configuration files should be kept (thus no Postfix warnings).

Additional info:
Cross-filed case 01582767 on the Red Hat customer portal.

Comment 2 Robert Scheck 2016-02-13 13:02:39 UTC
Created attachment 1123776 [details]
postfix-2.6.6-timestamp.patch

Comment 3 Ondřej Lysoněk 2016-08-29 14:36:44 UTC
*** Bug 1365015 has been marked as a duplicate of this bug. ***

Comment 4 Robert Scheck 2016-08-29 16:32:35 UTC
As mentioned in bug #1307066 comment #7 the situation and the patch might
not be suitable for upstream, but relevant for downstreams which are not
constantly rebasing Postfix, but patching it like Red Hat does with RHEL;
the situation outlined in the initial description IS real life with RHEL.

Comment 6 Ondřej Lysoněk 2016-10-31 08:09:54 UTC
Created attachment 1215701 [details]
patch

I'm attaching a new upstream patch. The new '-keep-new-mtime' option will have to be added to the invocation of the 'postfix-install' script in the %install phase of the spec file.

Comment 11 Jaroslav Škarvada 2019-07-23 12:07:34 UTC
Created attachment 1592868 [details]
Backported fix

Upstream renamed the option '-keep-new-mtime' to '-keep-build-mtime' changing the patch to stay close with upstream.

Comment 17 errata-xmlrpc 2020-03-31 19:10:27 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:1004