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
-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
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,
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
======================================
+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
===========================================
#
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 =
# 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
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}
}
}
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
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
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
"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
}
set_permission=
# Skip comments.
case $path in
- [/$]*) ;;
- *) continue;;
+ [$]*) ;;
+ *) continue;;
esac
# Expand $name, and canonicalize null fields.
for name in path owner group flags
*) ;;
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.
$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
$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
This is set when the -D command-line option is pre-
sent.
+<b>CONFIGURATION</b> <b>PARAMETERS</b>
The following <b>main.cf</b> configuration parameters are made
available as process environment variables with the same
names:
The group for mail submission and queue management
commands.
+ <b>sendmail</b><i>_</i><b>path</b>
+ The full pathname for the Postfix sendmail command.
+
+ <b>newaliases</b><i>_</i><b>path</b>
+ The full pathname for the Postfix newaliases com-
+ mand.
+
+ <b>mailq</b><i>_</i><b>path</b>
+ The full pathname for the Postfix mailq command.
+
+ <b>manpage</b><i>_</i><b>directory</b>
+ The directory for the Postfix on-line manual pages.
+
+ <b>sample</b><i>_</i><b>directory</b>
+ The directory for the Postfix sample configuration
+ files.
+
+ <b>readme</b><i>_</i><b>directory</b>
+ The directory for the Postfix README files.
+
+<b>Other</b> <b>configuration</b> <b>parameters</b>
+ <b>import</b><i>_</i><b>environment</b>
+ List of names of environment parameters that can be
+ imported from non-Postfix processes.
+
<b>FILES</b>
$<b>config</b><i>_</i><b>directory/postfix-script</b>, administrative commands
$<b>config</b><i>_</i><b>directory/main.cf</b>, configuration parameters
<a href="master.8.html">master(8)</a> Postfix master program
<b>LICENSE</b>
- The Secure Mailer license must be distributed with this
+ The Secure Mailer license must be distributed with this
software.
<b>AUTHOR(S)</b>
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
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
# 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
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=/}
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}
}
}
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
# 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
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
# 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
}
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
}
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?
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
'$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
"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
+}
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
#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
* 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
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
- 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,
-char *var_sendmail_path;
-char *var_mailq_path;
-char *var_newalias_path;
char *var_config_dir;
-char *var_manpage_path;
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
/* 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
/* 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
#include <msg_vstream.h>
#include <msg_syslog.h>
#include <stringops.h>
+#include <clean_env.h>
+#include <argv.h>
/* Global library. */
#include <mail_conf.h>
#include <mail_params.h>
+/* 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)
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.
* 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 */
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
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
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
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
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