From 10269e6084cc461adec85489280452fdcd6d1da81c839624114df15e1fac75a7 Mon Sep 17 00:00:00 2001 From: Peter Varkoly Date: Mon, 9 Jun 2014 12:19:18 +0000 Subject: [PATCH] - bnc#863350 - SuSEconfig.postfix complains about modified /etc/postfix/main.cf after updating postfix OBS-URL: https://build.opensuse.org/package/show/server:mail/postfix?expand=0&rev=187 --- postfix.changes | 5 +++++ postfix.spec | 27 +++++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/postfix.changes b/postfix.changes index da2ba2d..d300e6b 100644 --- a/postfix.changes +++ b/postfix.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Jun 9 12:17:35 UTC 2014 - varkoly@suse.com + +- bnc#863350 - SuSEconfig.postfix complains about modified /etc/postfix/main.cf after updating postfix + ------------------------------------------------------------------- Mon May 26 17:21:54 UTC 2014 - chris@computersalat.de diff --git a/postfix.spec b/postfix.spec index a67d78e..468ff5c 100644 --- a/postfix.spec +++ b/postfix.spec @@ -415,10 +415,33 @@ fi %post # We never have to run suseconfig for postfix after installation # We only start postfix own upgrade-configuration by update -/usr/sbin/postfix set-permissions || : if [ ${1:-0} -gt 1 ]; then touch /var/adm/postfix.configured - /usr/sbin/postfix upgrade-configuration || : + # Check if main.cf and master.cf was changed manualy + MAINCH=0 + if [ -e /var/adm/SuSEconfig/md5/etc/postfix/main.cf ]; then + MD5SUM1=$( cat /var/adm/SuSEconfig/md5/etc/postfix/main.cf ) + MD5SUM2=$( grep -v "^#" /etc/postfix/main.cf | md5sum ) + if [ "$MD5SUM1" != "$MD5SUM2" ]; then + MAINCH=1 + fi + fi + MASTERCH=0 + if [ -e /var/adm/SuSEconfig/md5/etc/postfix/master.cf ]; then + MD5SUM1=$( cat /var/adm/SuSEconfig/md5/etc/postfix/master.cf ) + MD5SUM2=$( grep -v "^#" /etc/postfix/master.cf | md5sum ) + if [ "$MD5SUM1" != "$MD5SUM2" ]; then + MASTERCH=1 + fi + fi + echo "Executing upgrade-configuration." + /usr/sbin/postfix set-permissions upgrade-configuration setgid_group=%{pf_setgid_group} + if [ $MASTERCH -eq 0 ]; then + test -e /var/adm/SuSEconfig/md5/etc/postfix/master.cf && grep -v "^#" /etc/postfix/master.cf | md5sum > /var/adm/SuSEconfig/md5/etc/postfix/master.cf + fi + if [ $MAINCH -eq 0 ]; then + test -e /var/adm/SuSEconfig/md5/etc/postfix/main.cf && grep -v "^#" /etc/postfix/main.cf | md5sum > /var/adm/SuSEconfig/md5/etc/postfix/main.cf + fi fi %{fillup_and_insserv -y postfix} %{fillup_only -an mail}