From: Wietse Venema Date: Tue, 15 Jan 2002 05:00:00 +0000 (-0500) Subject: snapshot-20020115 X-Git-Tag: v1.1.0~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4203d8f1f3a0abcee82473f9b37535611e501359;p=thirdparty%2Fpostfix.git snapshot-20020115 --- diff --git a/postfix/HISTORY b/postfix/HISTORY index 192049a78..90bf26024 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -5965,6 +5965,18 @@ Apologies for any names omitted. Bugfix: the rewritten postfix-install script did not chattr +S the Postfix queue. +20020115 + + Cleanup: added sample_directory and readme_directory + installation parameters for sample configuration files and + for README files. Files: postconf.c, postfix-install, + conf/postfix-files, conf/post-install. + + Robustness: the postfix command now exports all installation + parameter settings, and input filters the environment, so + that the startup shell scripts produce a consistent result. + Files: postconf.c. + Open problems: Low: don't do user@domain and @domain lookups in diff --git a/postfix/README_FILES/PACKAGE_README b/postfix/README_FILES/PACKAGE_README index 14a0ad145..cc1e9a7c8 100644 --- a/postfix/README_FILES/PACKAGE_README +++ b/postfix/README_FILES/PACKAGE_README @@ -1,19 +1,51 @@ -Hints and tips for Postfix packagers -==================================== - -1) The installed main.cf file must be small. PLEASE resist the -temptation to list all 100 million Postfix parameters in the main.cf -file. Postfix is supposed to be easy to configure. Listing all -100 million parameters in main.cf defeats the purpose. - -2) Please provide the sample-xxx files. If these files are not -installed in the same directory as main.cf, PLEASE update the notice -at the top of main.cf that advises the user of the existence of -the sample-xxx files. Without the sample-xxx files, Postfix will -be much more difficult to configure. - -Building a package for distribution to other systems -==================================================== +Purpose of this document +======================== + +This document has hints and tips for those who manage their own +Postfix distribution for internal use, and for those who maintain +Postfix distributions for general use. + +General distributions: please provide a small default main.cf file +================================================================== + +The installed main.cf file must be small. PLEASE resist the temptation +to list all 100 million Postfix parameters in the main.cf file. +Postfix is supposed to be easy to configure. Listing all 100 million +parameters in main.cf defeats the purpose. + +General distributions: please include the sample configuration files +==================================================================== + +Please provide the sample-xxx files. If these files are not installed +in the same directory as main.cf, PLEASE update the notice at the +top of main.cf that advises the user of the existence of the +sample-xxx files. Without the sample-xxx files, Postfix will be +much more difficult to configure. + +Postfix Installation parameter defaults +======================================= + +Postfix installation is controlled by a dozen installation parameters. +See the postfix-install and post-install files for details. Built-in +default settings can be changed at compile time with: + + % make makefiles CCARGS=whatever + +Names of C symbolic constants and their meaning: + + DEF_CONFIG_DIR default configuration directory + DEF_QUEUE_DIR default queue directory + DEF_DAEMON_DIR default daemon directory + DEF_COMMAND_DIR default command directory + DEF_SENDMAIL_PATH default Postfix sendmail command + DEF_MAILQ_PATH default Postfix mailq command + DEF_NEWALIAS_PATH default Postfix newaliases command + DEF_MANPAGE_DIR default manual page directory + DEF_SAMPLE_DIR default directory for sample configuration files + DEF_README_DIR default directory for README files + +Preparing a pre-built package for distribution to other systems +=============================================================== You can build a Postfix package on a machine that does not have Postfix installed on it. All you need is Postfix source code and @@ -32,12 +64,13 @@ installation parameter settings will be recorded in the main.cf file, but they won't take effect until the package is unpacked and installed on the destination machine. -If you want to fully automate the process, specify all the non-default -installation parameters on the command line: +If you want to fully automate this process, specify all the +non-default installation parameters on the command line: % sh postfix-install -non-interactive install_root=/some/where ... Begin Security Alert. +--------------------- When building an archive for distribution, be sure to archive only files and symbolic links, not their parent directories. Otherwise, @@ -47,14 +80,17 @@ ownership of system directories such as / /etc /usr /usr/bin /var postfix-install (see above) as an unprivileged user. End Security Alert. +------------------- + +Thus, to tar up the pre-built package, take the following steps: -Thus, instead of simply tarring up a pre-built tree it is much -safer if you jump the following hoops: + % cd INSTALL_ROOT + % rm -f SOMEWHERE/outputfile + % find . \! -type d -print | xargs tar rf SOMEWHERE/outputfile + % gzip SOMEWHERE/outputfile - % cd /install/root - % rm -f /some/where/outputfile - % find . \! -type d -print | xargs tar rf /some/where/outputfile - % gzip /some/where/outputfile +This way you will not include any directories that might cause trouble +upon extraction. Installing a pre-built Postfix package ====================================== diff --git a/postfix/RELEASE_NOTES b/postfix/RELEASE_NOTES index 9b9c46455..a52c9e849 100644 --- a/postfix/RELEASE_NOTES +++ b/postfix/RELEASE_NOTES @@ -1,3 +1,10 @@ +Incompatible changes with snapshot-20020115 +=========================================== + +Another revision of installation procedures. The location of the +sample-xxx and XXX_README files is now specified with the +sample_directory and readme_directory parameters. + Incompatible changes with snapshot-20020113 =========================================== diff --git a/postfix/conf/main.cf b/postfix/conf/main.cf index acf424ac0..c90780737 100644 --- a/postfix/conf/main.cf +++ b/postfix/conf/main.cf @@ -527,6 +527,14 @@ mailq_path = # setgid_group = -# manpage_path: The location of the Postfix on-line manual pages. +# manpage_directory: The location of the Postfix on-line manual pages. # -manpage_path = +manpage_directory = + +# sample_directory: The location of the Postfix sample configuration files. +# +sample_directory = + +# readme_directory: The location of the Postfix README files. +# +readme_directory = diff --git a/postfix/conf/post-install b/postfix/conf/post-install index 10160f01f..933801cae 100644 --- a/postfix/conf/post-install +++ b/postfix/conf/post-install @@ -158,8 +158,12 @@ # The group for mail submission and for queue management commands. # Its numerical group ID must not be used by any other accounts on the # system, not even by the mail_owner account. -# .IP manpage_path +# .IP manpage_directory # The directory for the Postfix on-line manual pages. +# .IP sample_directory +# The directory for the Postfix sample configuration files. +# .IP readme_directory +# The directory for the Postfix README files. # SEE ALSO # postfix-install(1) Postfix primary installation script. # FILES @@ -269,11 +273,15 @@ 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_path=$manpages} + : ${manpage_directory=$manpages} } } @@ -281,30 +289,45 @@ grep setgid_group $config_directory/main.cf >/dev/null 2>&1 || { test -f $config_directory/main.cf && { for name in daemon_directory command_directory queue_directory mail_owner \ - setgid_group sendmail_path newaliases_path mailq_path manpage_path + setgid_group sendmail_path newaliases_path mailq_path \ + manpage_directory sample_directory readme_directory 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_path in - no) echo $0: Error: manpage_path no longer accepts \"no\" values. 1>&2 - echo Re-run this script as \"$0 manpage_path=/pathname $*\". 1>&2; exit 1;; +case $manpage_directory in + no) echo $0: Error: manpage_directory no longer accepts \"no\" values. 1>&2 + 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 Re-run this script as \"$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 $sendmail_path $newaliases_path $mailq_path $manpage_path +for path in "$daemon_directory" "$command_directory" "$queue_directory" \ + "$sendmail_path" "$newaliases_path" "$mailq_path" "$manpage_directory" \ + "$sample_directory" do - case $path in + case "$path" in /*) ;; - *) echo $0: Error: $path should be an absolute path name. 1>&2; exit 1;; + *) echo $0: Error: \"$path\" should be an absolute path name. 1>&2; exit 1;; + esac +done + +for path in "$readme_directory" +do + case "$path" in + /*) ;; + no) ;; + *) echo $0: Error: \"$path\" should be \"no\" or an absolute path name. 1>&2; exit 1;; esac done @@ -313,7 +336,8 @@ done missing= for name in daemon_directory command_directory queue_directory mail_owner \ - setgid_group sendmail_path newaliases_path mailq_path manpage_path + setgid_group sendmail_path newaliases_path mailq_path manpage_directory \ + sample_directory readme_directory do eval test -n \"\$$name\" || missing="$missing $name" done @@ -347,7 +371,8 @@ POSTCONF="$command_directory/postconf" override= for name in daemon_directory command_directory queue_directory mail_owner \ - setgid_group sendmail_path newaliases_path mailq_path manpage_path + setgid_group sendmail_path newaliases_path mailq_path manpage_directory \ + sample_directory readme_directory do eval test \"\$$name\" = \"`$POSTCONF -c $config_directory -h $name`\" || { override=1 @@ -365,7 +390,9 @@ test -n "$override" && { "sendmail_path = $sendmail_path" \ "mailq_path = $mailq_path" \ "newaliases_path = $newaliases_path" \ - "manpage_path = $manpage_path" \ + "manpage_directory = $manpage_directory" \ + "sample_directory = $sample_directory" \ + "readme_directory = $readme_directory" \ || exit 1 } @@ -379,8 +406,8 @@ test -n "$create" && { set_permission= # Skip comments. case $path in - [/$]*) ;; - *) continue;; + [$]*) ;; + *) continue;; esac # Expand $name, and canonicalize null fields. for name in path owner group flags @@ -392,6 +419,11 @@ test -n "$create" && { *) ;; esac done + # Skip uninstalled files. + case $path in + no|no/*) continue;; + esac + # Pick up the flags. case $flags in *u*) upgrade_flag=1;; *) upgrade_flag=;; esac case $flags in *c*) create_flag=1;; *) create_flag=;; esac # Create missing directories with proper owner/group/mode settings. diff --git a/postfix/conf/postfix-files b/postfix/conf/postfix-files index 662dc18b9..334d2aac9 100644 --- a/postfix/conf/postfix-files +++ b/postfix/conf/postfix-files @@ -36,6 +36,8 @@ $config_directory:d:root:-:755:u $daemon_directory:d:root:-:755:u $queue_directory:d:root:-:755:uc +$sample_directory:d:root:-:755 +$readme_directory:d:root:-:755 $queue_directory/active:d:$mail_owner:-:700:uc $queue_directory/bounce:d:$mail_owner:-:700:uc $queue_directory/corrupt:d:$mail_owner:-:700:uc @@ -91,74 +93,93 @@ $config_directory/pcre_table:f:root:-:644:p $config_directory/postfix-files:f:root:-:644 $config_directory/regexp_table:f:root:-:644:p $config_directory/relocated:f:root:-:644:p -$config_directory/sample-aliases.cf:f:root:-:644 -$config_directory/sample-auth.cf:f:root:-:644 -$config_directory/sample-canonical.cf:f:root:-:644 -$config_directory/sample-compatibility.cf:f:root:-:644 -$config_directory/sample-debug.cf:f:root:-:644 -$config_directory/sample-filter.cf:f:root:-:644 -$config_directory/sample-flush.cf:f:root:-:644 -$config_directory/sample-ldap.cf:f:root:-:644 -$config_directory/sample-lmtp.cf:f:root:-:644 -$config_directory/sample-local.cf:f:root:-:644 -$config_directory/sample-misc.cf:f:root:-:644 -$config_directory/sample-pcre-access.cf:f:root:-:644 -$config_directory/sample-pcre-body.cf:f:root:-:644 -$config_directory/sample-pcre-header.cf:f:root:-:644 -$config_directory/sample-qmqpd.cf:f:root:-:644 -$config_directory/sample-rate.cf:f:root:-:644 -$config_directory/sample-regexp-access.cf:f:root:-:644 -$config_directory/sample-regexp-body.cf:f:root:-:644 -$config_directory/sample-regexp-header.cf:f:root:-:644 -$config_directory/sample-relocated.cf:f:root:-:644 -$config_directory/sample-resource.cf:f:root:-:644 -$config_directory/sample-rewrite.cf:f:root:-:644 -$config_directory/sample-smtp.cf:f:root:-:644 -$config_directory/sample-smtpd.cf:f:root:-:644 -$config_directory/sample-transport.cf:f:root:-:644 -$config_directory/sample-virtual.cf:f:root:-:644 $config_directory/transport:f:root:-:644:p $config_directory/virtual:f:root:-:644:p $config_directory/postfix-script:f:root:-:755 $config_directory/post-install:f:root:-:755 -$manpage_path/man1/mailq.1:f:root:-:644 -$manpage_path/man1/newaliases.1:f:root:-:644 -$manpage_path/man1/postalias.1:f:root:-:644 -$manpage_path/man1/postcat.1:f:root:-:644 -$manpage_path/man1/postconf.1:f:root:-:644 -$manpage_path/man1/postdrop.1:f:root:-:644 -$manpage_path/man1/postfix.1:f:root:-:644 -$manpage_path/man1/postkick.1:f:root:-:644 -$manpage_path/man1/postlock.1:f:root:-:644 -$manpage_path/man1/postlog.1:f:root:-:644 -$manpage_path/man1/postmap.1:f:root:-:644 -$manpage_path/man1/postqueue.1:f:root:-:644 -$manpage_path/man1/postsuper.1:f:root:-:644 -$manpage_path/man1/sendmail.1:f:root:-:644 -$manpage_path/man5/access.5:f:root:-:644 -$manpage_path/man5/aliases.5:f:root:-:644 -$manpage_path/man5/canonical.5:f:root:-:644 -$manpage_path/man5/pcre_table.5:f:root:-:644 -$manpage_path/man5/regexp_table.5:f:root:-:644 -$manpage_path/man5/relocated.5:f:root:-:644 -$manpage_path/man5/transport.5:f:root:-:644 -$manpage_path/man5/virtual.5:f:root:-:644 -$manpage_path/man8/bounce.8:f:root:-:644 -$manpage_path/man8/cleanup.8:f:root:-:644 -$manpage_path/man8/defer.8:f:root:-:644 -$manpage_path/man8/error.8:f:root:-:644 -$manpage_path/man8/flush.8:f:root:-:644 -$manpage_path/man8/lmtp.8:f:root:-:644 -$manpage_path/man8/local.8:f:root:-:644 -$manpage_path/man8/master.8:f:root:-:644 -$manpage_path/man8/nqmgr.8:f:root:-:644 -$manpage_path/man8/pickup.8:f:root:-:644 -$manpage_path/man8/pipe.8:f:root:-:644 -$manpage_path/man8/qmgr.8:f:root:-:644 -$manpage_path/man8/qmqpd.8:f:root:-:644 -$manpage_path/man8/showq.8:f:root:-:644 -$manpage_path/man8/smtp.8:f:root:-:644 -$manpage_path/man8/smtpd.8:f:root:-:644 -$manpage_path/man8/spawn.8:f:root:-:644 -$manpage_path/man8/trivial-rewrite.8:f:root:-:644 -$manpage_path/man8/virtual.8:f:root:-:644 +$manpage_directory/man1/mailq.1:f:root:-:644 +$manpage_directory/man1/newaliases.1:f:root:-:644 +$manpage_directory/man1/postalias.1:f:root:-:644 +$manpage_directory/man1/postcat.1:f:root:-:644 +$manpage_directory/man1/postconf.1:f:root:-:644 +$manpage_directory/man1/postdrop.1:f:root:-:644 +$manpage_directory/man1/postfix.1:f:root:-:644 +$manpage_directory/man1/postkick.1:f:root:-:644 +$manpage_directory/man1/postlock.1:f:root:-:644 +$manpage_directory/man1/postlog.1:f:root:-:644 +$manpage_directory/man1/postmap.1:f:root:-:644 +$manpage_directory/man1/postqueue.1:f:root:-:644 +$manpage_directory/man1/postsuper.1:f:root:-:644 +$manpage_directory/man1/sendmail.1:f:root:-:644 +$manpage_directory/man5/access.5:f:root:-:644 +$manpage_directory/man5/aliases.5:f:root:-:644 +$manpage_directory/man5/canonical.5:f:root:-:644 +$manpage_directory/man5/pcre_table.5:f:root:-:644 +$manpage_directory/man5/regexp_table.5:f:root:-:644 +$manpage_directory/man5/relocated.5:f:root:-:644 +$manpage_directory/man5/transport.5:f:root:-:644 +$manpage_directory/man5/virtual.5:f:root:-:644 +$manpage_directory/man8/bounce.8:f:root:-:644 +$manpage_directory/man8/cleanup.8:f:root:-:644 +$manpage_directory/man8/defer.8:f:root:-:644 +$manpage_directory/man8/error.8:f:root:-:644 +$manpage_directory/man8/flush.8:f:root:-:644 +$manpage_directory/man8/lmtp.8:f:root:-:644 +$manpage_directory/man8/local.8:f:root:-:644 +$manpage_directory/man8/master.8:f:root:-:644 +$manpage_directory/man8/nqmgr.8:f:root:-:644 +$manpage_directory/man8/pickup.8:f:root:-:644 +$manpage_directory/man8/pipe.8:f:root:-:644 +$manpage_directory/man8/qmgr.8:f:root:-:644 +$manpage_directory/man8/qmqpd.8:f:root:-:644 +$manpage_directory/man8/showq.8:f:root:-:644 +$manpage_directory/man8/smtp.8:f:root:-:644 +$manpage_directory/man8/smtpd.8:f:root:-:644 +$manpage_directory/man8/spawn.8:f:root:-:644 +$manpage_directory/man8/trivial-rewrite.8:f:root:-:644 +$manpage_directory/man8/virtual.8:f:root:-:644 +$sample_directory/sample-aliases.cf:f:root:-:644 +$sample_directory/sample-auth.cf:f:root:-:644 +$sample_directory/sample-canonical.cf:f:root:-:644 +$sample_directory/sample-compatibility.cf:f:root:-:644 +$sample_directory/sample-debug.cf:f:root:-:644 +$sample_directory/sample-filter.cf:f:root:-:644 +$sample_directory/sample-flush.cf:f:root:-:644 +$sample_directory/sample-ldap.cf:f:root:-:644 +$sample_directory/sample-lmtp.cf:f:root:-:644 +$sample_directory/sample-local.cf:f:root:-:644 +$sample_directory/sample-misc.cf:f:root:-:644 +$sample_directory/sample-pcre-access.cf:f:root:-:644 +$sample_directory/sample-pcre-body.cf:f:root:-:644 +$sample_directory/sample-pcre-header.cf:f:root:-:644 +$sample_directory/sample-qmqpd.cf:f:root:-:644 +$sample_directory/sample-rate.cf:f:root:-:644 +$sample_directory/sample-regexp-access.cf:f:root:-:644 +$sample_directory/sample-regexp-body.cf:f:root:-:644 +$sample_directory/sample-regexp-header.cf:f:root:-:644 +$sample_directory/sample-relocated.cf:f:root:-:644 +$sample_directory/sample-resource.cf:f:root:-:644 +$sample_directory/sample-rewrite.cf:f:root:-:644 +$sample_directory/sample-smtp.cf:f:root:-:644 +$sample_directory/sample-smtpd.cf:f:root:-:644 +$sample_directory/sample-transport.cf:f:root:-:644 +$sample_directory/sample-virtual.cf:f:root:-:644 +$readme_directory/DB_README:f:root:-:644 +$readme_directory/DEBUG_README:f:root:-:644 +$readme_directory/ETRN_README:f:root:-:644 +$readme_directory/FILTER_README:f:root:-:644 +$readme_directory/LDAP_README:f:root:-:644 +$readme_directory/LINUX_README:f:root:-:644 +$readme_directory/LMTP_README:f:root:-:644 +$readme_directory/MACOSX_README:f:root:-:644 +$readme_directory/MYSQL_README:f:root:-:644 +$readme_directory/NFS_README:f:root:-:644 +$readme_directory/PACKAGE_README:f:root:-:644 +$readme_directory/PCRE_README:f:root:-:644 +$readme_directory/QMQP_README:f:root:-:644 +$readme_directory/RESTRICTION_CLASS_README:f:root:-:644 +$readme_directory/SASL_README:f:root:-:644 +$readme_directory/ULTRIX_README:f:root:-:644 +$readme_directory/UUCP_README:f:root:-:644 +$readme_directory/VERP_README:f:root:-:644 +$readme_directory/VIRTUAL_README:f:root:-:644 diff --git a/postfix/html/postfix.1.html b/postfix/html/postfix.1.html index 8f653d402..39b37cbde 100644 --- a/postfix/html/postfix.1.html +++ b/postfix/html/postfix.1.html @@ -82,6 +82,7 @@ POSTFIX(1) POSTFIX(1) This is set when the -D command-line option is pre- sent. +CONFIGURATION PARAMETERS The following main.cf configuration parameters are made available as process environment variables with the same names: @@ -110,6 +111,31 @@ POSTFIX(1) POSTFIX(1) The group for mail submission and queue management commands. + sendmail_path + The full pathname for the Postfix sendmail command. + + newaliases_path + The full pathname for the Postfix newaliases com- + mand. + + mailq_path + The full pathname for the Postfix mailq command. + + manpage_directory + The directory for the Postfix on-line manual pages. + + sample_directory + The directory for the Postfix sample configuration + files. + + readme_directory + The directory for the Postfix README files. + +Other configuration parameters + import_environment + List of names of environment parameters that can be + imported from non-Postfix processes. + FILES $config_directory/postfix-script, administrative commands $config_directory/main.cf, configuration parameters @@ -119,7 +145,7 @@ POSTFIX(1) POSTFIX(1) master(8) Postfix master program LICENSE - The Secure Mailer license must be distributed with this + The Secure Mailer license must be distributed with this software. AUTHOR(S) diff --git a/postfix/man/man1/postfix.1 b/postfix/man/man1/postfix.1 index a20350468..204cd7e2a 100644 --- a/postfix/man/man1/postfix.1 +++ b/postfix/man/man1/postfix.1 @@ -75,7 +75,11 @@ Directory with Postfix configuration files. This is set when the -v command-line option is present. .IP \fBMAIL_DEBUG\fR This is set when the -D command-line option is present. -.PP +.SH CONFIGURATION PARAMETERS +.na +.nf +.ad +.fi The following \fBmain.cf\fR configuration parameters are made available as process environment variables with the same names: .IP \fBcommand_directory\fR @@ -93,6 +97,24 @@ that run in the optional chrooted environment. The owner of Postfix queue files and of most Postfix processes. .IP \fBsetgid_group\fR The group for mail submission and queue management commands. +.IP \fBsendmail_path +The full pathname for the Postfix sendmail command. +.IP \fBnewaliases_path +The full pathname for the Postfix newaliases command. +.IP \fBmailq_path +The full pathname for the Postfix mailq command. +.IP \fBmanpage_directory +The directory for the Postfix on-line manual pages. +.IP \fBsample_directory +The directory for the Postfix sample configuration files. +.IP \fBreadme_directory +The directory for the Postfix README files. +.SH Other configuration parameters +.ad +.fi +.IP \fBimport_environment\fR +List of names of environment parameters that can be imported +from non-Postfix processes. .SH FILES .na .nf diff --git a/postfix/postfix-install b/postfix/postfix-install index d0e569e7c..750254352 100644 --- a/postfix/postfix-install +++ b/postfix/postfix-install @@ -124,9 +124,15 @@ # system, not even by the mail_owner account. # The built-in default group name is postdrop. # This parameter setting is recorded in the installed main.cf file. -# .IP manpage_path +# .IP manpage_directory # The destination directory for the Postfix on-line manual pages. # This parameter setting is recorded in the installed main.cf file. +# .IP sample_directory +# The destination directory for the Postfix sample configuration files. +# This parameter setting is recorded in the installed main.cf file. +# .IP readme_directory +# The destination directory for the Postfix README files. +# This parameter setting is recorded in the installed main.cf file. # SEE ALSO # post-install(1) post-installation procedure # FILES @@ -326,9 +332,15 @@ management commands. Specify a group name with a numerical group ID that is not shared with other accounts, not even with the Postfix mail_owner account. You can no longer specify \"no\" here." -manpage_path_prompt="the destination directory for the Postfix on-line +manpage_directory_prompt="the destination directory for the Postfix on-line manual pages. You can no longer specify \"no\" here." +sample_directory_prompt="the destination directory for the Postfix +sample configuration files." + +readme_directory_prompt="the destination directory for the Postfix +README files. Specify \"no\" if you do not want to install these files." + # Default settings, just to get started. : ${install_root=/} @@ -373,11 +385,15 @@ 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 : \${$name="\`. $CONFIG_DIRECTORY/install.cf; echo \$$name\`"} \ + 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_path=$manpages} + : ${manpage_directory=$manpages} } } @@ -385,8 +401,13 @@ grep setgid_group $CONFIG_DIRECTORY/main.cf >/dev/null 2>&1 || { test -f $CONFIG_DIRECTORY/main.cf && { for name in daemon_directory command_directory queue_directory mail_owner \ - setgid_group sendmail_path newaliases_path mailq_path manpage_path + setgid_group sendmail_path newaliases_path mailq_path manpage_directory \ + sample_directory readme_directory do + eval junk=\$$name + case "$junk" in + "") eval unset $name;; + esac eval : \${$name=\`bin/postconf -c $CONFIG_DIRECTORY -h $name\`} || exit 1 done @@ -395,8 +416,13 @@ test -f $CONFIG_DIRECTORY/main.cf && { # Use built-in defaults as the final source of parameter settings. for name in daemon_directory command_directory queue_directory mail_owner \ - setgid_group sendmail_path newaliases_path mailq_path manpage_path + setgid_group sendmail_path newaliases_path mailq_path manpage_directory \ + sample_directory readme_directory do + eval junk=\$$name + case "$junk" in + "") eval unset $name;; + esac eval : \${$name=\`bin/postconf -d -h $name\`} || exit 1 done @@ -404,7 +430,7 @@ done test -z "$non_interactive" && for name in daemon_directory command_directory \ queue_directory sendmail_path newaliases_path mailq_path mail_owner \ - setgid_group manpage_path + setgid_group manpage_directory sample_directory readme_directory do while : do @@ -421,28 +447,39 @@ done # Sanity checks -case $setgid_group in - no) echo $0: Error: the setgid_group parameter no longer accepts 1>&2 - echo \"no\" values. Try again with \"setgid_group=groupname\" on the 1>&2 - echo command line or execute \"make install\" and specify setgid_group 1>&2 - echo interactively. 1>&2 +case "$setgid_group" in + no) (echo $0: Error: the setgid_group parameter no longer accepts + echo \"no\" values. Try again with \"setgid_group=groupname\" on the + echo command line or execute \"make install\" and specify setgid_group + echo interactively.) | ${FMT} 1>&2 exit 1;; esac -case $manpage_path in - no) echo $0: Error: the manpage_path parameter no longer accepts 1>&2 - echo \"no\" values. Try again with \"manpage_path=/path/name\" on the 1>&2 - echo command line or execute \"make install\" and specify manpage_path 1>&2 - echo interactively. 1>&2 +case "$manpage_directory" in + no) (echo $0: Error: the manpage_directory parameter no longer accepts + echo \"no\" values. Try again with \"manpage_directory=/path/name\" + echo on the command line or execute \"make install\" and specify + echo manpage_directory interactively.) | ${FMT} 1>&2 exit 1;; esac -for path in $daemon_directory $command_directory \ - $queue_directory $sendmail_path $newaliases_path $mailq_path $manpage_path +for path in "$readme_directory" +do + case "$path" in + /*) ;; + no) ;; + *) echo $0: Error: \"$path\" should be \"no\" or an absolute path name. 1>&2 + exit 1;; + esac +done + +for path in "$daemon_directory" "$command_directory" "$queue_directory" \ + "$sendmail_path" "$newaliases_path" "$mailq_path" "$manpage_directory" \ + "$sample_directory" do - case $path in + case "$path" in /*) ;; - *) echo $0: Error: $path should be an absolute path name. 1>&2; exit 1;; + *) echo $0: Error: \"$path\" should be an absolute path name. 1>&2; exit 1;; esac done @@ -464,14 +501,14 @@ test -z "$install_root" && { } chown "$mail_owner" $tempdir/junk >/dev/null 2>&1 || { - echo $0: Error: $mail_owner needs an entry in the passwd file. 1>&2 - echo Remember, $mail_owner needs a dedicated user id and group id. 1>&2 + echo $0: Error: \"$mail_owner\" needs an entry in the passwd file. 1>&2 + echo Remember, \"$mail_owner\" needs a dedicated user and group id. 1>&2 exit 1 } chgrp "$setgid_group" $tempdir/junk >/dev/null 2>&1 || { - echo $0: Error: $setgid needs an entry in the group file. 1>&2 - echo Remember, $setgid needs a dedicated group id. 1>&2 + echo $0: Error: \"$setgid_group\" needs an entry in the group file. 1>&2 + echo Remember, \"$setgid_group\" needs a dedicated group id. 1>&2 exit 1 } @@ -489,12 +526,18 @@ QUEUE_DIRECTORY=$install_root$queue_directory SENDMAIL_PATH=$install_root$sendmail_path NEWALIASES_PATH=$install_root$newaliases_path MAILQ_PATH=$install_root$mailq_path -MANPAGE_PATH=$install_root$manpage_path +MANPAGE_DIRECTORY=$install_root$manpage_directory +SAMPLE_DIRECTORY=$install_root$sample_directory +README_DIRECTORY=$install_root$readme_directory # Avoid repeated tests for existence of these. test -d $DAEMON_DIRECTORY || mkdir -p $DAEMON_DIRECTORY || exit 1 test -d $COMMAND_DIRECTORY || mkdir -p $COMMAND_DIRECTORY || exit 1 +test -d $COMMAND_DIRECTORY || mkdir -p $COMMAND_DIRECTORY || exit 1 +test -d $SAMPLE_DIRECTORY || mkdir -p $SAMPLE_DIRECTORY || exit 1 +test "$readme_directory" = "no" -o -d $README_DIRECTORY || + mkdir -p $README_DIRECTORY || exit 1 # Upgrade or first-time installation? @@ -551,7 +594,7 @@ do case $type in d) eval path=$install_root$path - test -d $path || { + test "$path" = "${install_root}no" -o -d $path || { mkdir -p $path || exit 1 test -z "$owner" || chown $owner $path || exit 1 test -z "$group" || chgrp $group $path || exit 1 @@ -586,10 +629,17 @@ do '$newaliases_path') check_parent $NEWALIASES_PATH || exit 1 compare_or_symlink $SENDMAIL_PATH $NEWALIASES_PATH || exit 1;; - '$manpage_path') - check_parent $MANPAGE_PATH/$file || exit 1 - compare_or_replace 644 "$owner" "$group" man/$file \ - $MANPAGE_PATH/$file || exit 1;; + '$manpage_directory') + check_parent $MANPAGE_DIRECTORY/$file || exit 1 + compare_or_replace $mode "$owner" "$group" man/$file \ + $MANPAGE_DIRECTORY/$file || exit 1;; + '$sample_directory') + compare_or_replace $mode "$owner" "$group" conf/$file \ + $SAMPLE_DIRECTORY/$file || exit 1;; + '$readme_directory') + test "$readme_directory" = "no" || + compare_or_replace $mode "$owner" "$group" README_FILES/$file \ + $README_DIRECTORY/$file || exit 1;; *) echo $0: Error: unknown entry $path in conf/postfix-files; exit 1;; esac) || exit 1 done @@ -608,11 +658,17 @@ bin/postconf -c $CONFIG_DIRECTORY -e \ "sendmail_path = $sendmail_path" \ "mailq_path = $mailq_path" \ "newaliases_path = $newaliases_path" \ - "manpage_path = $manpage_path" \ + "manpage_directory = $manpage_directory" \ + "sample_directory = $sample_directory" \ + "readme_directory = $readme_directory" \ || exit 1 # If Postfix is being installed locally from source code, do the # post-install processing now. -test -n "$install_root" || +test -n "$install_root" || { + export daemon_directory command_directory queue_directory sendmail_path \ + newaliases_path mailq_path mail_owner setgid_group manpage_directory \ + sample_directory readme_directory ${SHELL} conf/post-install $post_install_options || exit 1 +} diff --git a/postfix/src/global/Makefile.in b/postfix/src/global/Makefile.in index 73b3d1236..6083e1107 100644 --- a/postfix/src/global/Makefile.in +++ b/postfix/src/global/Makefile.in @@ -513,7 +513,7 @@ mail_conf.o: ../../include/dict.h mail_conf.o: ../../include/argv.h mail_conf.o: ../../include/safe.h mail_conf.o: ../../include/stringops.h -mail_conf.o: ../../include/safe_open.h +mail_conf.o: ../../include/readlline.h mail_conf.o: mail_params.h mail_conf.o: mail_conf.h mail_conf_bool.o: mail_conf_bool.c diff --git a/postfix/src/global/mail_params.h b/postfix/src/global/mail_params.h index 959c017c0..4009dbdc2 100644 --- a/postfix/src/global/mail_params.h +++ b/postfix/src/global/mail_params.h @@ -1396,8 +1396,20 @@ extern int var_fault_inj_code; #define DEF_NEWALIAS_PATH "/usr/bin/newaliases" #endif -#define VAR_MANPAGE_PATH "manpage_path" -#define DEF_MANPAGE_PATH "/usr/local/man" +#define VAR_MANPAGE_DIR "manpage_directory" +#ifndef DEF_MANPAGE_DIR +#define DEF_MANPAGE_DIR "/usr/local/man" +#endif + +#define VAR_SAMPLE_DIR "sample_directory" +#ifndef DEF_SAMPLE_DIR +#define DEF_SAMPLE_DIR DEF_CONFIG_DIR +#endif + +#define VAR_README_DIR "readme_directory" +#ifndef DEF_README_DIR +#define DEF_README_DIR "no" +#endif /* LICENSE /* .ad diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index 47696dd07..4e9c07d48 100644 --- a/postfix/src/global/mail_version.h +++ b/postfix/src/global/mail_version.h @@ -15,7 +15,7 @@ * Version of this program. */ #define VAR_MAIL_VERSION "mail_version" -#define DEF_MAIL_VERSION "Snapshot-20020114" +#define DEF_MAIL_VERSION "Snapshot-20020115" extern char *var_mail_version; /* LICENSE diff --git a/postfix/src/postconf/Makefile.in b/postfix/src/postconf/Makefile.in index 3deeb43a5..2c0b7e7d5 100644 --- a/postfix/src/postconf/Makefile.in +++ b/postfix/src/postconf/Makefile.in @@ -99,9 +99,11 @@ postconf.o: int_vars.h postconf.o: str_vars.h postconf.o: raw_vars.h postconf.o: smtp_vars.h +postconf.o: install_vars.h postconf.o: time_table.h postconf.o: bool_table.h postconf.o: int_table.h postconf.o: str_table.h postconf.o: smtp_table.h +postconf.o: install_table.h postconf.o: raw_table.h diff --git a/postfix/src/postconf/install_table.h b/postfix/src/postconf/install_table.h index 21209fa93..a7dff6f3f 100644 --- a/postfix/src/postconf/install_table.h +++ b/postfix/src/postconf/install_table.h @@ -1,5 +1 @@ - VAR_SENDMAIL_PATH, DEF_SENDMAIL_PATH, &var_sendmail_path, 1, 0, - VAR_MAILQ_PATH, DEF_MAILQ_PATH, &var_mailq_path, 1, 0, - VAR_NEWALIAS_PATH, DEF_NEWALIAS_PATH, &var_newalias_path, 1, 0, VAR_CONFIG_DIR, DEF_CONFIG_DIR, &var_config_dir, 1, 0, - VAR_MANPAGE_PATH, DEF_MANPAGE_PATH, &var_manpage_path, 1, 0, diff --git a/postfix/src/postconf/install_vars.h b/postfix/src/postconf/install_vars.h index 9321b1473..c54581ee8 100644 --- a/postfix/src/postconf/install_vars.h +++ b/postfix/src/postconf/install_vars.h @@ -1,5 +1 @@ -char *var_sendmail_path; -char *var_mailq_path; -char *var_newalias_path; char *var_config_dir; -char *var_manpage_path; diff --git a/postfix/src/postfix/Makefile.in b/postfix/src/postfix/Makefile.in index 3b651dbec..21f14ef80 100644 --- a/postfix/src/postfix/Makefile.in +++ b/postfix/src/postfix/Makefile.in @@ -66,5 +66,7 @@ postfix.o: ../../include/msg_vstream.h postfix.o: ../../include/msg_syslog.h postfix.o: ../../include/stringops.h postfix.o: ../../include/vstring.h +postfix.o: ../../include/clean_env.h +postfix.o: ../../include/argv.h postfix.o: ../../include/mail_conf.h postfix.o: ../../include/mail_params.h diff --git a/postfix/src/postfix/postfix.c b/postfix/src/postfix/postfix.c index ce5417c54..dca1876bb 100644 --- a/postfix/src/postfix/postfix.c +++ b/postfix/src/postfix/postfix.c @@ -67,7 +67,9 @@ /* This is set when the -v command-line option is present. /* .IP \fBMAIL_DEBUG\fR /* This is set when the -D command-line option is present. -/* .PP +/* CONFIGURATION PARAMETERS +/* .ad +/* .fi /* The following \fBmain.cf\fR configuration parameters are made /* available as process environment variables with the same names: /* .IP \fBcommand_directory\fR @@ -82,9 +84,27 @@ /* communication endpoints, and with files needed for daemon programs /* that run in the optional chrooted environment. /* .IP \fBmail_owner\fR -/* The owner of Postfix queue files and of most Postfix processes. +/* The owner of Postfix queue files and of most Postfix processes. /* .IP \fBsetgid_group\fR -/* The group for mail submission and queue management commands. +/* The group for mail submission and queue management commands. +/* .IP \fBsendmail_path +/* The full pathname for the Postfix sendmail command. +/* .IP \fBnewaliases_path +/* The full pathname for the Postfix newaliases command. +/* .IP \fBmailq_path +/* The full pathname for the Postfix mailq command. +/* .IP \fBmanpage_directory +/* The directory for the Postfix on-line manual pages. +/* .IP \fBsample_directory +/* The directory for the Postfix sample configuration files. +/* .IP \fBreadme_directory +/* The directory for the Postfix README files. +/* .SH Other configuration parameters +/* .ad +/* .fi +/* .IP \fBimport_environment\fR +/* List of names of environment parameters that can be imported +/* from non-Postfix processes. /* FILES /* $\fBconfig_directory/postfix-script\fR, administrative commands /* $\fBconfig_directory/main.cf\fR, configuration parameters @@ -122,12 +142,23 @@ #include #include #include +#include +#include /* Global library. */ #include #include +/* Additional installation parameters. */ + +static char *var_sendmail_path; +static char *var_mailq_path; +static char *var_newalias_path; +static char *var_manpage_dir; +static char *var_sample_dir; +static char *var_readme_dir; + /* check_setenv - setenv() with extreme prejudice */ static void check_setenv(char *name, char *value) @@ -147,6 +178,16 @@ int main(int argc, char **argv) int uid; int fd; int ch; + ARGV *import_env; + static CONFIG_STR_TABLE str_table[] = { + VAR_SENDMAIL_PATH, DEF_SENDMAIL_PATH, &var_sendmail_path, 1, 0, + VAR_MAILQ_PATH, DEF_MAILQ_PATH, &var_mailq_path, 1, 0, + VAR_NEWALIAS_PATH, DEF_NEWALIAS_PATH, &var_newalias_path, 1, 0, + VAR_MANPAGE_DIR, DEF_MANPAGE_DIR, &var_manpage_dir, 1, 0, + VAR_SAMPLE_DIR, DEF_SAMPLE_DIR, &var_sample_dir, 1, 0, + VAR_README_DIR, DEF_README_DIR, &var_readme_dir, 1, 0, + 0, + }; /* * Be consistent with file permissions. @@ -213,6 +254,17 @@ int main(int argc, char **argv) * scripts. */ mail_conf_read(); + get_mail_conf_str_table(str_table); + + /* + * Environment import filter, to enforce consistent behavior whether this + * command is started by hand, or at system boot time. This is necessary + * because some shell scripts use environment settings to override + * main.cf settings. + */ + import_env = argv_split(var_import_environ, ", \t\r\n"); + clean_env(import_env->argv); + argv_free(import_env); check_setenv("PATH", ROOT_PATH); /* sys_defs.h */ check_setenv(CONF_ENV_PATH, var_config_dir);/* mail_conf.h */ @@ -221,8 +273,18 @@ int main(int argc, char **argv) check_setenv(VAR_DAEMON_DIR, var_daemon_dir); /* main.cf */ check_setenv(VAR_QUEUE_DIR, var_queue_dir); /* main.cf */ check_setenv(VAR_CONFIG_DIR, var_config_dir); /* main.cf */ + + /* + * Do we want to keep adding things here as shell scripts evolve? + */ check_setenv(VAR_MAIL_OWNER, var_mail_owner); /* main.cf */ check_setenv(VAR_SGID_GROUP, var_sgid_group); /* main.cf */ + check_setenv(VAR_SENDMAIL_PATH, var_sendmail_path); /* main.cf */ + check_setenv(VAR_MAILQ_PATH, var_mailq_path); /* main.cf */ + check_setenv(VAR_NEWALIAS_PATH, var_newalias_path); /* main.cf */ + check_setenv(VAR_MANPAGE_DIR, var_manpage_dir); /* main.cf */ + check_setenv(VAR_SAMPLE_DIR, var_sample_dir); /* main.cf */ + check_setenv(VAR_README_DIR, var_readme_dir); /* main.cf */ /* * Make sure these directories exist. Run the maintenance scripts with as diff --git a/postfix/src/postqueue/Makefile.in b/postfix/src/postqueue/Makefile.in index 864226d0a..f9470cc9a 100644 --- a/postfix/src/postqueue/Makefile.in +++ b/postfix/src/postqueue/Makefile.in @@ -66,6 +66,7 @@ postqueue.o: ../../include/argv.h postqueue.o: ../../include/safe.h postqueue.o: ../../include/connect.h postqueue.o: ../../include/iostuff.h +postqueue.o: ../../include/valid_hostname.h postqueue.o: ../../include/mail_proto.h postqueue.o: ../../include/attr.h postqueue.o: ../../include/mail_params.h @@ -74,5 +75,6 @@ postqueue.o: ../../include/mail_task.h postqueue.o: ../../include/debug_process.h postqueue.o: ../../include/mail_run.h postqueue.o: ../../include/mail_flush.h +postqueue.o: ../../include/flush_clnt.h postqueue.o: ../../include/smtp_stream.h postqueue.o: ../../include/vstring.h diff --git a/postfix/src/smtpd/Makefile.in b/postfix/src/smtpd/Makefile.in index 0587eb59e..866804198 100644 --- a/postfix/src/smtpd/Makefile.in +++ b/postfix/src/smtpd/Makefile.in @@ -193,6 +193,7 @@ smtpd_check.o: ../../include/mail_conf.h smtpd_check.o: ../../include/maps.h smtpd_check.o: ../../include/mail_addr_find.h smtpd_check.o: ../../include/match_parent_style.h +smtpd_check.o: ../../include/split_addr.h smtpd_check.o: smtpd.h smtpd_check.o: ../../include/mail_stream.h smtpd_check.o: smtpd_sasl_glue.h diff --git a/postfix/src/util/Makefile.in b/postfix/src/util/Makefile.in index 1eb00cbe3..e483e6c76 100644 --- a/postfix/src/util/Makefile.in +++ b/postfix/src/util/Makefile.in @@ -498,6 +498,7 @@ dict.o: vbuf.h dict.o: vstring.h dict.o: readlline.h dict.o: mac_parse.h +dict.o: stringops.h dict.o: dict.h dict.o: argv.h dict.o: dict_ht.h