From: Wietse Venema Date: Fri, 1 Feb 2008 05:00:00 +0000 (-0500) Subject: postfix-2.6-20080201 X-Git-Tag: v2.6.0-RC1~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c007cc26ceec2880549dbd767cedf670a8c76034;p=thirdparty%2Fpostfix.git postfix-2.6-20080201 --- diff --git a/postfix/HISTORY b/postfix/HISTORY index 862d2f53c..bc5012440 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -14280,10 +14280,11 @@ Apologies for any names omitted. 20080125 - Bugfix: missing {} in the LDAP client broke OpenLDAP TLS. - The setting tls_require_cert=no was further broken because - Postfix used OpenLDAP incorrectly. Victor Duchovni. This - broke tls_require_cert=no File: global/dict_ldap.c. + Bugfix (introduced 20071216): missing {} in the LDAP client + broke OpenLDAP TLS. The setting tls_require_cert=no was + further broken because Postfix used OpenLDAP incorrectly. + Victor Duchovni. This broke tls_require_cert=no File: + global/dict_ldap.c. 20080126 @@ -14303,3 +14304,14 @@ Apologies for any names omitted. Bugfix (introduced 20080126): the new "do not execute directly" test in post-install got broken during code cleanup. File: conf/post-install. + +20080201 + + Workaround: undo the changes that require that post-install + is invoked via the postfix command, because this breaks + when "postfix start" is invoked with an obsolete postfix + command that doesn't export the new data_directory parameter. + + Workaround: pick up a missing data_directory setting from + main.cf when "postfix start" is invoked with an obsolete + postfix command. File: conf/post-install. diff --git a/postfix/RELEASE_NOTES b/postfix/RELEASE_NOTES index 7f4ae50c5..190b2fb49 100644 --- a/postfix/RELEASE_NOTES +++ b/postfix/RELEASE_NOTES @@ -16,11 +16,3 @@ Incompatibility with Postfix 2.4 and earlier If you upgrade from Postfix 2.4 or earlier, read RELEASE_NOTES-2.5 before proceeding. - -Incompatible changes with snapshot 20080127 -=========================================== - -The post-install script now requires explicitly that it is invoked -via the postfix(1) command. This was the intended usage since Postfix -version 2.1, but it was never enforced. The internal documentation -for package maintainers has been updated accordingly. diff --git a/postfix/conf/post-install b/postfix/conf/post-install index 833685c79..c09fdfa32 100644 --- a/postfix/conf/post-install +++ b/postfix/conf/post-install @@ -9,7 +9,7 @@ # SUMMARY # Postfix post-installation script # SYNOPSIS -# postfix post-install [name=value] command ... +# post-install [name=value] command ... # DESCRIPTION # The post-install script performs the finishing touch of a Postfix # installation, after the executable programs and configuration @@ -90,7 +90,7 @@ # copy the configuration files from the primary Postfix instance to # a secondary configuration directory and execute: # -# postfix post-install config_directory=secondary-config-directory \e +# post-install config_directory=secondary-config-directory \e # .in +4 # queue_directory=secondary-queue-directory \e # .br @@ -106,7 +106,7 @@ # To upgrade a secondary Postfix installation on the same machine, # execute: # -# postfix post-install config_directory=secondary-config-directory \e +# post-install config_directory=secondary-config-directory \e # .in +4 # upgrade-permissions upgrade-configuration # INSTALLATION PARAMETER INPUT METHODS @@ -139,10 +139,10 @@ # .IP command_directory # The directory for Postfix administrative commands. This # directory should be in the command search path of adminstrative users. -# .IP data_directory -# The directory for Postfix writable data files (caches, etc.). # .IP queue_directory # The directory for Postfix queues. +# .IP data_directory +# The directory for Postfix writable data files (caches, etc.). # .IP sendmail_path # The full pathname for the Postfix sendmail command. # This is the Sendmail-compatible mail posting interface. @@ -166,6 +166,7 @@ # The directory for the Postfix on-line manual pages. # .IP sample_directory # The directory for the Postfix sample configuration files. +# This feature is obsolete as of Postfix 2.1. # .IP readme_directory # The directory for the Postfix README files. # SEE ALSO @@ -199,8 +200,6 @@ MOST_PARAMETERS="command_directory daemon_directory data_directory USAGE="Usage: $0 [name=value] command create-missing Create missing queue directories. - set-permissions Update file permission and ownership. - upgrade-configuration Update configuration files. upgrade-source When installing or upgrading from source code. upgrade-package When installing or upgrading from pre-built package. first-install-reminder Remind of mandatory first-time configuration steps. @@ -236,20 +235,18 @@ test -n "$create$upgrade_conf$first_install_reminder" || { exit 1 } -for name in config_directory $MOST_PARAMETERS -do - eval test -n \"\${$name}\" || { - echo "$0: Error: do not invoke this command directly" 1>&2 - echo Re-run this command as: postfix $0 ... 1>&2 - exit 1 - } -done +# Bootstrapping problem. -POSTCONF="$command_directory/postconf" +if [ -n "$command_directory" ] +then + POSTCONF="$command_directory/postconf" +else + POSTCONF="postconf" +fi $POSTCONF -d mail_version >/dev/null 2>/dev/null || { echo $0: Error: no $POSTCONF command found. 1>&2 - echo Re-run this command as: postfix $0 command_directory=/some/where. 1>&2 + echo Re-run this command as $0 command_directory=/some/where. 1>&2 exit 1 } @@ -287,18 +284,51 @@ SunOS*) FMT=fake_fmt;; *) FMT=fmt;; esac +# If a parameter is not set via the command line or environment, +# try to use settings from installed configuration files. + +# Extract parameter settings from the obsolete install.cf file, as +# a transitional aid. + +grep setgid_group $config_directory/main.cf >/dev/null 2>&1 || { + test -f $config_directory/install.cf && { + for name in sendmail_path newaliases_path mailq_path setgid manpages + do + eval junk=\$$name + case "$junk" in + "") eval unset $name;; + esac + eval : \${$name="\`. $config_directory/install.cf; echo \$$name\`"} \ + || exit 1 + done + : ${setgid_group=$setgid} + : ${manpage_directory=$manpages} + } +} + +# Extract parameter settings from the installed main.cf file. + +test -f $config_directory/main.cf && { + for name in $MOST_PARAMETERS + do + eval junk=\$$name + case "$junk" in + "") eval unset $name;; + esac + eval : \${$name=\`$POSTCONF -c $config_directory -h $name\`} || exit 1 + done +} + # Sanity checks case $manpage_directory in no) echo $0: Error: manpage_directory no longer accepts \"no\" values. 1>&2 - echo Try again with \"postfix $0 manpage_directory=/pathname ...\". 1>&2 - exit 1;; + echo Try again with \"$0 manpage_directory=/pathname ...\". 1>&2; exit 1;; esac case $setgid_group in no) echo $0: Error: setgid_group no longer accepts \"no\" values. 1>&2 - echo Try again with \"postfix $0 setgid_group=groupname ...\" 1>&2 - exit 1;; + echo Try again with \"$0 setgid_group=groupname ...\" 1>&2; exit 1;; esac for path in "$daemon_directory" "$command_directory" "$queue_directory" \ @@ -315,22 +345,61 @@ do case "$path" in /*) ;; no) ;; - *) echo $0: Error: \"$path\" should be \"no\" or an absolute path name. 1>&2 - exit 1;; + *) echo $0: Error: \"$path\" should be \"no\" or an absolute path name. 1>&2; exit 1;; esac done +# Find out what parameters were not specified via command line, +# via environment, or via installed configuration files. + +missing= +for name in $MOST_PARAMETERS +do + eval test -n \"\$$name\" || missing="$missing $name" +done + +# All parameters must be specified at this point. + +test -n "$non_interactive" -a -n "$missing" && { + cat <&2 +$0: Error: some required installation parameters are not defined. + +- Either the parameters need to be given in the $config_directory/main.cf +file from a recent Postfix installation, + +- Or the parameters need to be specified through the process +environment. + +- Or the parameters need to be specified as name=value arguments +on the $0 command line, + +The following parameters were missing: + + $missing + +EOF + exit 1 +} + +POSTCONF="$command_directory/postconf" + # Save settings, allowing command line/environment override. -# Optimization: don't update main.cf if nothing has changed. -# Caution: "`command`" removes the last newline character. -test "`for name in $MOST_PARAMETERS; do eval echo \\\${\$name}; done`" = \ - "`$POSTCONF -h $MOST_PARAMETERS`" || { +override= +for name in $MOST_PARAMETERS +do + eval test \"\$$name\" = \"`$POSTCONF -c $config_directory -h $name`\" || { + override=1 + break + } +done + +test -n "$override" && { $POSTCONF -c $config_directory -e \ "daemon_directory = $daemon_directory" \ "command_directory = $command_directory" \ - "data_directory = $data_directory" \ "queue_directory = $queue_directory" \ + "data_directory = $data_directory" \ "mail_owner = $mail_owner" \ "setgid_group = $setgid_group" \ "sendmail_path = $sendmail_path" \ @@ -512,7 +581,7 @@ EOF # Postfix 2.2. # File systems have improved since Postfix came out, and all we - # require now that defer and deferred are hashed because those + # require now is that defer and deferred are hashed because those # can contain lots of files. found=`$POSTCONF -c $config_directory -h hash_queue_names` @@ -617,6 +686,20 @@ proxywrite unix - - n - 1 proxymap EOF } + # Postfix 2.5. + # Fix a typo in the default master.cf proxywrite entry. + + grep '^proxywrite.*-[ ]*proxymap' $config_directory/master.cf >/dev/null && { + echo Editing $config_directory/master.cf, setting proxywrite process limit to 1 + ed $config_directory/master.cf <