From c68aa8cf284b99ce23924944093a584e342622a9 Mon Sep 17 00:00:00 2001 From: Thomas Woerner Date: Mon, 18 Oct 2004 12:21:41 +0000 Subject: [PATCH] [tw] - automated postalias call in init script - removed postconf call from spec file: moved changes into patch --- postfix-2.1.5-aliases.patch | 11 +++++++++++ postfix-etc-init.d-postfix | 17 +++++++++++++++-- postfix.spec | 14 +++++++------- 3 files changed, 33 insertions(+), 9 deletions(-) create mode 100644 postfix-2.1.5-aliases.patch diff --git a/postfix-2.1.5-aliases.patch b/postfix-2.1.5-aliases.patch new file mode 100644 index 0000000..92891f9 --- /dev/null +++ b/postfix-2.1.5-aliases.patch @@ -0,0 +1,11 @@ +--- postfix-2.1.5/conf/main.cf.aliases 2004-10-18 13:57:18.932558373 +0200 ++++ postfix-2.1.5/conf/main.cf 2004-10-18 13:57:27.162425581 +0200 +@@ -384,7 +384,7 @@ + # + #alias_database = dbm:/etc/aliases + #alias_database = dbm:/etc/mail/aliases +-#alias_database = hash:/etc/aliases ++alias_database = hash:/etc/aliases + #alias_database = hash:/etc/aliases, hash:/opt/majordomo/aliases + + # ADDRESS EXTENSIONS (e.g., user+foo) diff --git a/postfix-etc-init.d-postfix b/postfix-etc-init.d-postfix index 8a5a05d..7dc778e 100644 --- a/postfix-etc-init.d-postfix +++ b/postfix-etc-init.d-postfix @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # postfix Postfix Mail Transfer Agent # @@ -34,7 +34,20 @@ RETVAL=0 start() { # Start daemons. echo -n "Starting postfix: " - /usr/sbin/postalias /etc/aliases + alias_database=$(postconf -h alias_database 2>/dev/null) + RETVAL=1 + [ -z "$alias_database" ] && { + failure "determination of alias_database" + echo + return 0 + } + /usr/sbin/postalias "$alias_database" 2>/dev/null + RETVAL=$? + [ $RETVAL -ne 0 ] && { + failure "postalias \"$alias_database\"" + echo + return 0 + } /usr/sbin/postfix start 2>/dev/null 1>&2 && success || failure RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/subsys/postfix diff --git a/postfix.spec b/postfix.spec index 4fa96c1..2fc5bfe 100644 --- a/postfix.spec +++ b/postfix.spec @@ -47,7 +47,7 @@ Name: postfix Summary: Postfix Mail Transport Agent Version: 2.1.5 -Release: 2.1 +Release: 2.2 Epoch: 2 Group: System Environment/Daemons URL: http://www.postfix.org @@ -110,6 +110,7 @@ Patch3: postfix-alternatives.patch Patch4: postfix-hostname-fqdn.patch Patch5: postfix-2.1.1-pie.patch Patch6: postfix-2.1.1-obsolete.patch +Patch7: postfix-2.1.5-aliases.patch # Optional patches - set the appropriate environment variables to include # them when building the package/spec file @@ -211,6 +212,7 @@ patch --fuzz=3 -p1 -b -z .config < %{P:1} %patch4 -p1 -b .postfix-hostname-fqdn %patch5 -p1 -b .pie %patch6 -p1 -b .obsolete +%patch7 -p1 -b .aliases %if %{PFLOGSUMM} gzip -dc %{SOURCE53} | tar xf - @@ -326,12 +328,6 @@ done perl -pi -e "s,/usr/local/bin/perl,/usr/bin/perl,g" $RPM_BUILD_ROOT%{postfix_doc_dir}/TLS/contributed/loadCAcert.pl %endif -# Change alias_maps and alias_database default directory to %{postfix_config_dir} -bin/postconf -c $RPM_BUILD_ROOT%{postfix_config_dir} -e \ - "alias_maps = hash:/etc/aliases" \ - "alias_database = hash:/etc/aliases" \ -|| exit 1 - # This installs into the /etc/rc.d/init.d directory /bin/mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d install -c %{_sourcedir}/postfix-etc-init.d-postfix \ @@ -562,6 +558,10 @@ exit 0 %changelog +* Mon Oct 18 2004 Thomas Woerner 2:2.1.5-2.2 +- automated postalias call in init script +- removed postconf call from spec file: moved changes into patch + * Fri Oct 15 2004 Thomas Woerner 2:2.1.5-2.1 - removed aliases from postfix-files (#135840) - fixed postalias call in init script