Cleanup: construction debris. Files: Makefile.in,
conf/postfix-script.
- Cleanup: replace expanded MAIL_VERSION with $mail_version
- in main.cf installation parameter settings, to permit safe
- upgrade of a running mail system. File: postfix-install.
+ Cleanup: replace the result of MAIL_VERSION expansion with
+ $mail_version in main.cf installation parameter settings,
+ to permit safe upgrade of a running mail system. File:
+ postfix-install.
- Cleanup: replace expanded MAIL_VERSION with $mail_version
- in built-in default installation parameter settings, for
- consistency with main.cf. File: makedefs, postfix-install,
- conf/post-install.
+ Cleanup: replace the result of MAIL_VERSION expansion with
+ $mail_version in built-in default installation parameter
+ settings, for consistency with main.cf. File: makedefs,
+ postfix-install, conf/post-install.
Cleanup: removed $mail_version from the default shlib_directory
value. Files: global/mail_params.h, proto/INSTALL.html.
+
+ Cleanup: in postfix-script, use find instead of ls to
+ determine permissions or ownership, and group some checks
+ with "pathname/." and "pathname/*" into one. Downside:
+ more warnings will now have "/./" in the middle of a pathname.
+ File: conf/postfix-script.
+
+ Cleanup: need to evaluate mail_version before evaluating
+ parameters that may contain $mail_version. File:
+ global/mail_params.h
+
+ Cleanup: the postmulti command now exercises the postconf
+ "-x" option to expand $parameter_name in secondary-instance
+ parameter values. File: postmulti/postmulti.c.
+
+ Cleanup: post-install also needed to replace the result of
+ MAIL_VERSION expansion with $mail_version, for the same
+ reasons as postfix-script. Viktor Dukhovni. File:
+ conf/post-install.
+
+20140627
+
+ Bugfix (introduced: 20140626) broken build and broken install
+ with default shlib_directory. Files: makedefs.
+
+ Bugfix (introduced: 20140627) broken install with default
+ shlib_directory. Files: conf/post-install.
This installs shared libraries in $shlib_directory, typically /usr/lib/postfix
or /usr/local/lib/postfix, with file names libpostfix-name.so, where the name
-is a source-code directory name such as "util" or "global", and the version is
-the Postfix release version: x.y.z for stable releases, x.y-date for snapshot
-(development) releases, or x.y-date-nonprod for non-production releases.
+is a source-code directory name such as "util" or "global".
See section 4.3.3 "Customizing Postfix shared libraries and database plugins"
-below for how to customize the Postfix shared-library location and version,
-including support to upgrade a running mail system.
+below for how to customize the Postfix shared-library location, including
+support to upgrade a running mail system safely.
4.3.2 Turning on Postfix database-plugin support
This installs shared libraries in $shlib_directory, typically /usr/lib/postfix
or /usr/local/lib/postfix, with file names libpostfix-name.so, where the name
-is a source-code directory name such as "util" or "global", and the version is
-the Postfix release version: x.y.z for stable releases, x.y-date for snapshot
-(development) releases, or x.y-date-nonprod for non-production releases.
+is a source-code directory name such as "util" or "global".
See section 4.3.3 "Customizing Postfix shared libraries and database plugins"
-below for how to customize the Postfix shared-library location and version,
-including support to upgrade a running mail system.
+below for how to customize the Postfix shared-library location, including
+support to upgrade a running mail system safely.
4\b4.\b.3\b3.\b.2\b2 T\bTu\bur\brn\bni\bin\bng\bg o\bon\bn P\bPo\bos\bst\btf\bfi\bix\bx d\bda\bat\bta\bab\bba\bas\bse\be-\b-p\bpl\blu\bug\bgi\bin\bn s\bsu\bup\bpp\bpo\bor\brt\bt
# Save settings, allowing command line/environment override.
+# Undo MAIL_VERSION expansion. If someone really wants the expanded
+# mail version in main.cf, we're sorry.
+
+# Confine side effects from mail_version unexpansion within a subshell.
+
+(case "$mail_version" in
+"") mail_version="`$POSTCONF -dhx mail_version`" || exit 1
+esac
+
+for name in $MOST_PARAMETERS
+do
+ eval junk=\$$name
+ case "$junk" in
+ *"$mail_version"*)
+ case "$pattern" in
+ "") pattern=`echo "$mail_version" | sed 's/\./\\\\./g'` || exit 1
+ esac
+ val=`echo "$junk" | sed "s/$pattern/"'$mail_version/g'` || exit 1
+ eval ${name}='"$val"'
+ esac
+done
+
override=
for name in $MOST_PARAMETERS
do
"shlib_directory = $shlib_directory" \
"meta_directory = $meta_directory" \
|| exit 1
-}
+} || exit 0) || exit 1
# Use file/directory status information in $meta_directory/postfix-files.
check-warn)
# This command is NOT part of the public interface.
- todo="$config_directory $queue_directory $queue_directory/pid"
- test -n "$check_shared_files" && {
- todo="$daemon_directory $todo"
- test "$shlib_directory" = "no" || todo="$shlib_directory $todo"
- todo="$meta_directory $todo"
- }
- todo=`echo "$todo" | tr ' ' '\12' | sort -u`
+ # Check Postfix root-owned directory owner/permissions.
- for dir in $todo
- do
- ls -lLd $dir | (grep " root " >/dev/null ||
- $WARN not owned by root: $dir)
- done
+ find $queue_directory/. $queue_directory/pid \
+ -prune ! -user root \
+ -exec $WARN not owned by root: {} \;
- # Some people break Postfix's security model.
- ls -lLd $queue_directory | egrep '^.....(w|...w)' >/dev/null && \
- $WARN group or other writable: $queue_directory
+ find $queue_directory/. $queue_directory/pid \
+ -prune \( -perm -020 -o -perm -002 \) \
+ -exec $WARN group or other writable: {} \;
- todo="$config_directory/*"
- test -n "$check_shared_files" && {
- todo="$daemon_directory/* $todo"
- test "$shlib_directory" = "no" ||
- todo="$shlib_directory/* $todo"
- todo="$meta_directory/* $todo"
- }
- todo=`echo "$todo" | tr ' ' '\12' | sort -u`
-
- find $todo ! -user root \
- -exec $WARN not owned by root: {} \;
+ # Check Postfix root-owned directory tree owner/permissions.
todo="$config_directory/."
test -n "$check_shared_files" && {
- todo="$daemon_directory/. $todo"
+ todo="$daemon_directory/. $meta_directory/. $todo"
test "$shlib_directory" = "no" ||
todo="$shlib_directory/. $todo"
- todo="$meta_directory/. $todo"
}
todo=`echo "$todo" | tr ' ' '\12' | sort -u`
- find $todo \
- \( -perm -020 -o -perm -002 \) -type f \
- -exec $WARN group or other writable: {} \;
+ find $todo ! -user root \
+ -exec $WARN not owned by root: {} \;
+
+ find $todo \( -perm -020 -o -perm -002 \) \
+ -exec $WARN group or other writable: {} \;
+
+ # Check Postfix mail_owner-owned directory tree owner/permissions.
find $data_directory/. ! -user $mail_owner \
-exec $WARN not owned by $mail_owner: {} \;
- ls -lLd $data_directory | egrep '^.....(w|...w)' >/dev/null && \
- $WARN group or other writable: $data_directory
+ find $data_directory/. \( -perm -020 -o -perm -002 \) \
+ -exec $WARN group or other writable: {} \;
+
+ # Check Postfix mail_owner-owned directory tree owner.
find `ls -d $queue_directory/* | \
egrep '/(saved|incoming|active|defer|deferred|bounce|hold|trace|corrupt|public|private|flush)$'` \
! \( -type p -o -type s \) ! -user $mail_owner \
-exec $WARN not owned by $mail_owner: {} \;
+ # WARNING: this should not descend into the maildrop directory.
+ # maildrop is the least trusted Postfix directory.
+
+ find $queue_directory/maildrop -prune ! -user $mail_owner \
+ -exec $WARN not owned by $mail_owner: $queue_directory/maildrop \;
+
+ # Check Postfix setgid_group-owned directory and file group/permissions.
+
todo="$queue_directory/public $queue_directory/maildrop"
test -n "$check_shared_files" &&
todo="$command_directory/postqueue $command_directory/postdrop $todo"
-prune ! -perm -02111 \
-exec $WARN not set-gid or not owner+group+world executable: {} \;
- for name in `ls -d $queue_directory/* | \
- egrep '/(bin|etc|lib|usr)$'` ; \
- do \
- find $name ! -user root \
- -exec $WARN not owned by root: {} \; ; \
- done
-
- # WARNING: this should not descend into the maildrop directory.
- # maildrop is the least trusted Postfix directory.
-
- find $queue_directory/maildrop/. -prune ! -user $mail_owner \
- -exec $WARN not owned by $mail_owner: $queue_directory/maildrop \;
+ # Check non-Postfix root-owned directory tree owner/content.
for dir in bin etc lib sbin usr
do
- test -d $dir && find $dir -type f -print | while read path
+ test -d $dir && {
+ find $dir ! -user root \
+ -exec $WARN not owned by root: $queue_directory/{} \;
+
+ find $dir -type f -print | while read path
do
- test -f /$path && {
- cmp -s $path /$path ||
- $WARN $queue_directory/$path and /$path differ
- }
+ test -f /$path && {
+ cmp -s $path /$path ||
+ $WARN $queue_directory/$path and /$path differ
+ }
done
+ }
done
find corrupt -type f -exec $WARN damaged message: {} \;
- # XXX also: look for weird stuff, weird permissions, etc.
+ # Check for non-Postfix MTA remnants.
test -n "$check_shared_files" -a -f /usr/sbin/sendmail -a \
-f /usr/lib/sendmail && {
<p> This installs shared libraries in $<a href="postconf.5.html#shlib_directory">shlib_directory</a>, typically
/usr/lib/postfix or /usr/local/lib/postfix, with file names
libpostfix-<i>name</i>.so, where the <i>name</i> is a source-code
-directory name such as "util" or "global", and the <i>version</i>
-is the Postfix release version: <i>x.y.z</i> for stable releases,
-<i>x.y</i>-<i>date</i> for snapshot (development) releases, or
-<i>x.y</i>-<i>date</i>-nonprod for non-production releases. </p>
+directory name such as "util" or "global". </p>
<p> See section 4.3.3 "Customizing Postfix shared libraries and
database plugins" below for how to customize the Postfix shared-library
-location and version, including support to upgrade a running mail
-system. </p>
+location, including support to upgrade a running mail system safely.
+</p>
<h4><a name="dynamicmaps_enable"> 4.3.2 Turning on Postfix
database-plugin support </a></h4>
ter.cf</a>.proto.
<b><a href="postconf.5.html#shlib_directory">shlib_directory</a> (see 'postconf -d' output)</b>
- The location of Postfix shared libraries (libpostfix-*.so.*),
- and of Postfix database plugins that have a relative pathname in
- the dynamicmaps.cf file.
+ The location of Postfix shared libraries (libpostfix-*.so), and
+ the default location of Postfix database plugins (libpost-
+ fix-*.so) that have a relative pathname in the dynamicmaps.cf
+ file.
Other configuration parameters:
<b><a href="postconf.5.html#import_environment">import_environment</a> (see 'postconf -d' output)</b>
- The list of environment parameters that a Postfix process will
+ The list of environment parameters that a Postfix process will
import from a non-Postfix parent process.
<b><a href="postconf.5.html#syslog_facility">syslog_facility</a> (mail)</b>
The syslog facility of Postfix logging.
<b><a href="postconf.5.html#syslog_name">syslog_name</a> (see 'postconf -d' output)</b>
- The mail system name that is prepended to the process name in
- syslog records, so that "smtpd" becomes, for example, "post-
+ The mail system name that is prepended to the process name in
+ syslog records, so that "smtpd" becomes, for example, "post-
fix/smtpd".
Available in Postfix version 2.6 and later:
<b><a href="postconf.5.html#multi_instance_directories">multi_instance_directories</a> (empty)</b>
- An optional list of non-default Postfix configuration directo-
- ries; these directories belong to additional Postfix instances
- that share the Postfix executable files and documentation with
- the default Postfix instance, and that are started, stopped,
+ An optional list of non-default Postfix configuration directo-
+ ries; these directories belong to additional Postfix instances
+ that share the Postfix executable files and documentation with
+ the default Postfix instance, and that are started, stopped,
etc., together with the default Postfix instance.
<b><a href="postconf.5.html#multi_instance_wrapper">multi_instance_wrapper</a> (empty)</b>
- The pathname of a multi-instance manager command that the <a href="postfix.1.html"><b>post-</b></a>
- <a href="postfix.1.html"><b>fix</b>(1)</a> command invokes when the <a href="postconf.5.html#multi_instance_directories">multi_instance_directories</a>
+ The pathname of a multi-instance manager command that the <a href="postfix.1.html"><b>post-</b></a>
+ <a href="postfix.1.html"><b>fix</b>(1)</a> command invokes when the <a href="postconf.5.html#multi_instance_directories">multi_instance_directories</a>
parameter value is non-empty.
<b><a href="postconf.5.html#multi_instance_group">multi_instance_group</a> (empty)</b>
The optional instance name of this Postfix instance.
<b><a href="postconf.5.html#multi_instance_enable">multi_instance_enable</a> (no)</b>
- Allow this Postfix instance to be started, stopped, etc., by a
+ Allow this Postfix instance to be started, stopped, etc., by a
multi-instance manager.
<b>FILES</b>
- Prior to Postfix version 2.6, all of the following files were in <b>$<a href="postconf.5.html#config_directory">con</a>-</b>
+ Prior to Postfix version 2.6, all of the following files were in <b>$<a href="postconf.5.html#config_directory">con</a>-</b>
<b><a href="postconf.5.html#config_directory">fig_directory</a></b>. Some files are now in <b>$<a href="postconf.5.html#daemon_directory">daemon_directory</a></b> so that they can
be shared among multiple instances that run the same Postfix version.
- Use the command "<b>postconf <a href="postconf.5.html#config_directory">config_directory</a></b>" or "<b>postconf <a href="postconf.5.html#daemon_directory">daemon_direc</a>-</b>
+ Use the command "<b>postconf <a href="postconf.5.html#config_directory">config_directory</a></b>" or "<b>postconf <a href="postconf.5.html#daemon_directory">daemon_direc</a>-</b>
<b><a href="postconf.5.html#daemon_directory">tory</a></b>" to expand the names into their actual values.
$<a href="postconf.5.html#config_directory">config_directory</a>/<a href="postconf.5.html">main.cf</a>, Postfix configuration parameters
ter.cf</a>.proto.
<b><a href="postconf.5.html#shlib_directory">shlib_directory</a> (see 'postconf -d' output)</b>
- The location of Postfix shared libraries (libpostfix-*.so.*),
- and of Postfix database plugins that have a relative pathname in
- the dynamicmaps.cf file.
+ The location of Postfix shared libraries (libpostfix-*.so), and
+ the default location of Postfix database plugins (libpost-
+ fix-*.so) that have a relative pathname in the dynamicmaps.cf
+ file.
<b>FILES</b>
$<a href="postconf.5.html#meta_directory">meta_directory</a>/<a href="postconf.5.html">main.cf</a>.proto, stock configuration file
eval ${CC-gcc} ${CCARGS} -o makedefs.test makedefs.test.c || exit 1
parm_val=`./makedefs.test` || exit 1
rm -f makedefs.test makedefs.test.[co]
- case $parm_val in
- *'$'mail_version*|*'$'{mail_version}*|'$('mail_version')'*)
- parm_val=`expand_mail_version "$parm_val"` || exit 1
- eval ${parm_name}=\""\$parm_val"\"
- esac
- CCARGS="$CCARGS -D$parm_macro=\\\"$parm_val\\\""
+ eval ${parm_name}=\""\$parm_val"\"
+ #CCARGS="$CCARGS -D$parm_macro=\\\"$parm_val\\\""
;;
*) # this parameter was already checked above.
error "Can't happen in $0 - $parm_val is not an absolute path"
multiple Postfix instances, such as postfix-files, dynamicmaps.cf,
and the multi-instance template files main.cf.proto and master.cf.proto.
.IP "\fBshlib_directory (see 'postconf -d' output)\fR"
-The location of Postfix shared libraries (libpostfix-*.so.*),
-and of Postfix database plugins that have a relative pathname in
-the dynamicmaps.cf file.
+The location of Postfix shared libraries (libpostfix-*.so),
+and the default location of Postfix database plugins (libpostfix-*.so)
+that have a relative pathname in the dynamicmaps.cf file.
.PP
Other configuration parameters:
.IP "\fBimport_environment (see 'postconf -d' output)\fR"
multiple Postfix instances, such as postfix-files, dynamicmaps.cf,
and the multi-instance template files main.cf.proto and master.cf.proto.
.IP "\fBshlib_directory (see 'postconf -d' output)\fR"
-The location of Postfix shared libraries (libpostfix-*.so.*),
-and of Postfix database plugins that have a relative pathname in
-the dynamicmaps.cf file.
+The location of Postfix shared libraries (libpostfix-*.so),
+and the default location of Postfix database plugins (libpostfix-*.so)
+that have a relative pathname in the dynamicmaps.cf file.
.SH "FILES"
.na
.nf
exit 1;;
esac
- done
+done
# Save the installation parameters to main.cf even when they haven't
# changed from their current default. Defaults can change between
eval junk=\$$name
case "$junk" in
*"$mail_version"*)
- val=`echo "$junk" | sed "s/$mail_version/"'$mail_version/g'` || exit 1
+ case "$pattern" in
+ "") pattern=`echo "$mail_version" | sed 's/\./\\\\./g'` || exit 1
+ esac
+ val=`echo "$junk" | sed "s/$pattern/"'$mail_version/g'` || exit 1
eval ${name}='"$val"'
esac
done
# If Postfix is being installed locally from source code, do the
# post-install processing now.
+# The unexpansion above may have side effects on exported variables.
+# It does not matter because bin/postfix below will override them.
+
test -n "$install_root" || {
bin/postfix post-install $post_install_options || exit 1
}
<p> This installs shared libraries in $shlib_directory, typically
/usr/lib/postfix or /usr/local/lib/postfix, with file names
libpostfix-<i>name</i>.so, where the <i>name</i> is a source-code
-directory name such as "util" or "global", and the <i>version</i>
-is the Postfix release version: <i>x.y.z</i> for stable releases,
-<i>x.y</i>-<i>date</i> for snapshot (development) releases, or
-<i>x.y</i>-<i>date</i>-nonprod for non-production releases. </p>
+directory name such as "util" or "global". </p>
<p> See section 4.3.3 "Customizing Postfix shared libraries and
database plugins" below for how to customize the Postfix shared-library
void mail_params_init()
{
static const CONFIG_STR_TABLE first_str_defaults[] = {
+ /* $mail_version may appear in other parameters. */
+ VAR_MAIL_VERSION, DEF_MAIL_VERSION, &var_mail_version, 1, 0,
VAR_SYSLOG_FACILITY, DEF_SYSLOG_FACILITY, &var_syslog_facility, 1, 0,
VAR_INET_PROTOCOLS, DEF_INET_PROTOCOLS, &var_inet_protocols, 0, 0,
VAR_MULTI_CONF_DIRS, DEF_MULTI_CONF_DIRS, &var_multi_conf_dirs, 0, 0,
VAR_DEFAULT_PRIVS, DEF_DEFAULT_PRIVS, &var_default_privs, 1, 0,
VAR_ALIAS_DB_MAP, DEF_ALIAS_DB_MAP, &var_alias_db_map, 0, 0,
VAR_MAIL_RELEASE, DEF_MAIL_RELEASE, &var_mail_release, 1, 0,
- VAR_MAIL_VERSION, DEF_MAIL_VERSION, &var_mail_version, 1, 0,
VAR_DB_TYPE, DEF_DB_TYPE, &var_db_type, 1, 0,
VAR_HASH_QUEUE_NAMES, DEF_HASH_QUEUE_NAMES, &var_hash_queue_names, 1, 0,
VAR_RCPT_DELIM, DEF_RCPT_DELIM, &var_rcpt_delim, 0, 0,
* Patches change both the patchlevel and the release date. Snapshots have no
* patchlevel; they change the release date only.
*/
-#define MAIL_RELEASE_DATE "20140626"
+#define MAIL_RELEASE_DATE "20140627"
#define MAIL_VERSION_NUMBER "2.12"
#ifdef SNAPSHOT
/* multiple Postfix instances, such as postfix-files, dynamicmaps.cf,
/* and the multi-instance template files main.cf.proto and master.cf.proto.
/* .IP "\fBshlib_directory (see 'postconf -d' output)\fR"
-/* The location of Postfix shared libraries (libpostfix-*.so.*),
-/* and of Postfix database plugins that have a relative pathname in
-/* the dynamicmaps.cf file.
+/* The location of Postfix shared libraries (libpostfix-*.so),
+/* and the default location of Postfix database plugins (libpostfix-*.so)
+/* that have a relative pathname in the dynamicmaps.cf file.
/* .PP
/* Other configuration parameters:
/* .IP "\fBimport_environment (see 'postconf -d' output)\fR"
/* multiple Postfix instances, such as postfix-files, dynamicmaps.cf,
/* and the multi-instance template files main.cf.proto and master.cf.proto.
/* .IP "\fBshlib_directory (see 'postconf -d' output)\fR"
-/* The location of Postfix shared libraries (libpostfix-*.so.*),
-/* and of Postfix database plugins that have a relative pathname in
-/* the dynamicmaps.cf file.
+/* The location of Postfix shared libraries (libpostfix-*.so),
+/* and the default location of Postfix database plugins (libpostfix-*.so)
+/* that have a relative pathname in the dynamicmaps.cf file.
/* FILES
/* $meta_directory/main.cf.proto, stock configuration file
/* $meta_directory/master.cf.proto, stock configuration file
};
/*
- * XXX: We could really use a "postconf -E" to expand values in the
- * context of the target main.cf!
+ * Expand parameter values in the context of the target main.cf file.
*/
#define REQUEST_PARAM_COUNT 5 /* # of requested parameters */
cmd = argv_alloc(REQUEST_PARAM_COUNT + 3);
name = concatenate(var_command_dir, "/", "postconf", (char *) 0);
- argv_add(cmd, name, "-c", ip->config_dir,
+ argv_add(cmd, name, "-xc", ip->config_dir,
VAR_QUEUE_DIR, VAR_DATA_DIR,
VAR_MULTI_NAME, VAR_MULTI_GROUP, VAR_MULTI_ENABLE,
(char *) 0);
#include <vstring_vstream.h>
#include <dict.h>
#include <dict_lmdb.h>
+#include <dict_db.h>
DEFINE_DICT_LMDB_MAP_SIZE;
DEFINE_DICT_DB_CACHE_SIZE;