diff --git a/postfix/HISTORY b/postfix/HISTORY index 14f0b5aae..5e88964fd 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -19919,3 +19919,107 @@ Apologies for any names omitted. Cleanup: INFO action in access(5) tables, for consistency with header/body_checks. Viktor Dukhovni. Files: smtpd/smtpd_check.c, proto/access. + +20140619 + + Cleanup: process LaMont Jones feedback for shared-library + and database-plugin builds. Changes: 1) move non-executable + files from $daemon_directory to the default $config_directory + (postfix-files*, dynamicmaps.cf*, main.cf.proto/master.cf.proto + for multi-instance support); 2) add foo.so -> foo.so.version + symlinks; 3) change $shlib_directory and $plugin_directory + defaults to /usr/lib/postfix to reduce sprawl. Files: + conf/main.cf.proto, conf/master.cf.proto, conf/postfix-files.proto, + conf/post-install, conf/postmulti-script, makedefs, + postfix-install, proto/INSTALL.html, global/dynamicmaps.c, + global/dynamicmaps.h, global/mail_dict.c, global/mail_params.h, + postmulti/postmulti.c. + + Bugfix (introduced: 2001): qmqpd null pointer bug when it + logs a lost connection while not in a mail transaction. + Reported by Michal Adamek. File: qmqpd/qmqpd.c. + + Cleanup: filter non-printable characters in X509 subject + or issuer names. Viktor Dukhovni. File: tls/tls_server.c. + +20140620 + + Cleanup: for compliance with file system policies, some + files have been moved from $daemon-directory to the directory + specified with the new meta_directory parameter which has + the same default value as config_directory. This change + affects non-executable files that are shared among multiple + Postfix instances, such as postfix-files, dynamicmaps.cf, + and multi-instance template files. + + For backwards compatibility with Postfix 2.6..2.11, specify + "meta_directory = $daemon_directory" in main.cf before + installing Postfix, or specify "meta_directory = /path/name" + on the "make makefiles", "make install" or "make upgrade" + command line. + + Files: Makefile.in, RELEASE_NOTES, conf/post-install, + conf/postfix-files.proto, conf/postmulti-script, makedefs, + mantools/postlink, postfix-install, proto/INSTALL.html, + proto/postconf.proto, global/mail_params.c, global/mail_params.h, + postfix/postfix.c, postmulti/postmulti.c. + + Feature: check_xxx_a_access (for xxx in client, reverse_client, + helo, sender, recipient) implements access control on all + A and AAAA IP addresses for the client hostname, helo + parameter, sender domain or recipient domain. Some spam has + sender domains with the same IP address but different MX + hosts. Files: global/mail_params.h, smtpd/smtpd_check.c, + proto/postconf.proto. + +20140622 + + Cleanup: eliminated plugin_directory to reduce configuration + parameter sprawl. Files: Makefile.in, RELEASE_NOTES, + conf/post-install, conf/postfix-files.proto, conf/postfix-script, + conf/postmulti-script, makedefs, mantools/postlink, + postfix-install, proto/INSTALL.html, proto/postconf.proto, + global/Makefile.in, global/mail_dict.c, global/mail_params.c, + global/mail_params.h, global/mail_version.h, postfix/postfix.c, + postmulti/postmulti.c, smtpd/smtpd_check.c, util/Makefile.in. + +20140623 + + Cleanup: eliminated the use of Postfix release versions as + file name suffixes for shared libraries, database plugins + and dynamicmaps.cf. The shared-library version suffixes + were fighting against assumptions and conventions in run-time + linkers, including the assumption that ABIs are preserved + from one version to the next. The Postfix version can now + be embedded in the shlib_directory parameter. As this is + sufficient to permit upgrade of a running Postfix system + without risking that old binaries will link against newer + shared objects, we no longer need a version suffix for + dynamicmaps.cf. Files: Makefile.in, RELEASE_NOTES, + conf/postfix-files.proto, makedefs, proto/INSTALL.html, + proto/postconf.proto, global/mail_params.h, global/mail_version.h, + +20140624 + + Cleanup: the commands "make (makefiles|install|upgrade|package) + parameter=value" now replace the string MAIL_VERSION in a + configuration parameter value with the Postfix release + version. Unfortunately, the more obvious approach, a + parameter value with the unexpanded '$mail_version', produces + inconsistent results with different make implementations. + Files: makedefs, Makefile.in, postfix-install, proto/INSTALL.html, + proto/PACKAGE_README.html + + Cleanup: postmulti now requires "postmulti -e init" before + accepting other multi-instance requests. Viktor Dukhovni. + File: conf/postmulti-script. + +20140625 + + Kludge: moved dict_db_cache_size away from dict_db.c in + preparation for Berkeley DB database plugin support (a + similar kludge was implemented for LMDB). Files: + util/dict_db.[hc], util/dict_test.c, global/mail_params.c. + + Cleanup: don't leak build directory information via SHLIB_ENV + in makedefs.out. Files: Makefile.in, conf/postfix-files. diff --git a/postfix/INSTALL b/postfix/INSTALL index 951721231..4a935cb59 100644 --- a/postfix/INSTALL +++ b/postfix/INSTALL @@ -155,55 +155,69 @@ Postfix shared-library and database plugin support exists for recent versions of Linux, FreeBSD and MacOS X. Shared-library builds may become the default at some point in the future. +Overview of topics: + + * 4.3.1 Turning on Postfix shared-library support + * 4.3.2 Turning on Postfix database-plugin support + * 4.3.3 Customizing Postfix shared libraries and database plugins + * 4.4.4 Tips for distribution maintainers + +Note: directories with Postfix shared libraries or database plugins should +contain only postfix-related files. Postfix shared libraries and database +plugins should not be installed in a "public" system directory such as /usr/lib +or /usr/local/lib. Linking Postfix shared-library or database-plugin files into +non-Postfix programs is not supported. Postfix shared libraries and database +plugins implement a Postfix-internal API that changes without maintaining +compatibility. + +4.3.1 Turning on Postfix shared-library support + Postfix can be built with Postfix shared libraries (files typically named -libpostfix-*.so.*). Postfix shared libraries add minor run-time overhead and +libpostfix-*.so). Postfix shared libraries add minor run-time overhead and result in significantly-smaller Postfix executable files. Specify "shared=yes" on the "make makefiles" command line to build Postfix with shared-library support. $ make makefiles shared=yes ...other arguments... - $ make makefiles shared=no ...other arguments... $ make -This defaults to installing shared libraries in /usr/local/lib, typically with -names like libpostfix-name.so.version, where the name is a source-code -directory name such as "util" or "global", and the version is the Postfix -version: x.y.z for stable releases, x.y-date for snapshot (development) -releases, or x.y-date-nonprod for non-production releases. +(Specify "make makefiles shared=no" to explicitly disable Postfix shared- +library support). -To override the default location or shared-library version, specify, for -example: +This installs shared libraries in $shlib_directory, typically, /usr/lib/ +postfix/version or /usr/local/lib/postfix/version, with names like 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. - $ make makefiles shared=yes shlib_directory=/usr/lib \ - SHLIB_VERSION=1 ...other arguments... +See section 4.3.3 "Customizing Postfix shared libraries and database plugins" +below for how to customize the Postfix shared-library location and version. -You can change the shlib_directory setting after Postfix is built, with "make -install" or "make upgrade". However, you may have to run ldconfig if you change -shlib_directory after Postfix is built and install the libpostfix-*.so.* files -in a non-system directory. No ldconfig is needed if you keep the libpostfix- -*.so.* files in the compiled-in default $shlib_directory location. +4.3.2 Turning on Postfix database-plugin support Additionally, Postfix can be built to support dynamic loading of Postfix -database clients with the Debian-style dynamicmaps feature. Postfix 2.12 -supports dynamic loading of cdb:, ldap:, lmdb:, mysql:, pcre:, pgsql:, sdbm:, -and sqlite: database clients. Dynamic loading is useful when you distribute or -install pre-compiled Postfix packages. +database clients (database plugins) with the Debian-style dynamicmaps feature. +Postfix 2.12 supports dynamic loading of cdb:, ldap:, lmdb:, mysql:, pcre:, +pgsql:, sdbm:, and sqlite: database clients. Dynamic loading is useful when you +distribute or install pre-compiled Postfix packages. Specify "dynamicmaps=yes" on the "make makefiles" command line to build Postfix -with support to dynamically load Postfix database clients (database plugins) -with the Debian-style dynamicmaps feature. +with support to dynamically load Postfix database clients with the Debian-style +dynamicmaps feature. $ make makefiles dynamicmaps=yes ...other arguments... - $ make makefiles dynamicmaps=no ...other arguments... $ make -This implicitly enables shared-library support, and defaults to installing -dynamicmaps.cf and database plugins in /usr/libexec/postfix. Database plugins -are typically named postfix-type.so.version where the type is a database type -such as "cdb" or "ldap", and where the version is the same as for Postfix -shared libraries. The installed dynamicmaps.cf configuration file is given a -suffix with the same version. +(Specify "make makefiles dynamicmaps=no" to explicitly disable Postfix +database-plugin support). + +This implicitly enables shared-library support, installs the configuration file +dynamicmaps.cf in $meta_directory (usually, /etc/postfix or /usr/local/etc/ +postfix), and installs database plugins in $shlib_directory (see above). +Database plugins are named postfix-type.so where the type is a database type +such as "cdb" or "ldap". NOTE: The Postfix 2.12 build procedure expects that you specify database library dependencies with variables named AUXLIBS_CDB, AUXLIBS_LDAP, etc. @@ -217,50 +231,115 @@ suffix with the same version. dependencies. And that was exactly what dynamic database client loading was meant to avoid. -To override the default location or shared-library version, specify, for +See the next section for how to customize the location and version of Postfix +database plugins and the location of the file dynamicmaps.cf. + +4.3.3 Customizing Postfix shared libraries and database plugins + +Customizing the location of Postfix shared libraries and database plugins + +As a reminder, the directories with Postfix shared libraries or database +plugins should contain only Postfix-related files. Linking these files into +other programs is not supported. + +To override the default location of Postfix shared libraries and database +plugins specify, for example: + + $ make makefiles shared=yes shlib_directory=/usr/local/lib/postfix ... + +If you intend to upgrade Postfix without stopping the mail system, then you +should append the Postfix release version to the shlib_directory pathname, to +eliminate the possibility that programs from the old Postfix version will link +with files from the new Postfix version. For example: + + $ make makefiles shared=yes \ + shlib_directory=/usr/local/lib/postfix/MAIL_VERSION ... + +The command "make makefiles name=value..." will replace the string MAIL_VERSION +in a configuration parameter value with the Postfix release version. Do not try +to specify something like $mail_version on this command line. This produces +inconsistent results with different versions of the make(1) command. + +You can change the shlib_directory setting after Postfix is built, with "make +install" or "make upgrade". However, you may have to run ldconfig if you change +shlib_directory after Postfix is built (the symptom is that Postfix programs +fail because the run-time linker cannot find the files libpostfix-*.so). No +ldconfig command is needed if you keep the files libpostfix-*.so in the +compiled-in default $shlib_directory location. + + # make upgrade shlib_directory=/usr/local/lib/postfix ... + # make install shlib_directory=/usr/local/lib/postfix ... + +To append the Postfix release version to the pathname if you intend to upgrade +Postfix without stopping the mail system: + + # make upgrade shlib_directory=/usr/local/lib/postfix/MAIL_VERSION ... + # make install shlib_directory=/usr/local/lib/postfix/MAIL_VERSION ... + +See also the comments above for appending MAIL_VERSION with the "make +makefiles" command. + +Customizing the location of dynamicmaps.cf and other files + +The meta_directory parameter has the same default setting as the +config_directory parameter, typically /etc/postfix or /usr/local/etc/postfix. + +You can override the default meta_directory location at compile time or after +Postfix is built. To override the default location at compile time specify, for example: - % make makefiles dynamicmaps=yes plugin_directory=/usr/lib/postfix \ - SHLIB_VERSION=1 ... + % make makefiles meta_directory=/usr/libexec/postfix ... -You can also override the plugin_directory setting after Postfix is built, with -"make install" or "make upgrade". In this case, there is no need to run the -ldconfig command. +Here is a tip if you want to make a pathname dependent on the Postfix release +version: the command "make makefiles name=value..." will replace the string +MAIL_VERSION in a configuration parameter value with the Postfix release +version. Do not try to specify something like $mail_version on this command +line. This produces inconsistent results with different versions of the make(1) +command. -Tips for distribution maintainers: +You can override the meta_directory setting after Postfix is built, with "make +install" or "make upgrade". - * The postfix-install procedure creates a compatibility symlink - dynamicmaps.cf -> dynamicmaps.cf.version (as well as a symlink - dynamicmaps.cf.d -> dynamicmaps.cf.version.d; more on that below). It is - therefore safe to use "unversioned" configuration file names when - installing or deinstalling a database plugin. However, Postfix itself will - use the "versioned" names, to allow minor upgrades to happen without having - to stop Postfix. + # make upgrade meta_directory=/usr/libexec/postfix ... + # make install meta_directory=/usr/libexec/postfix ... - * The configuration file dynamicmaps.cf.version will automatically include - files under the directory dynamicmaps.cf.d.version, just like the - configuration file postfix-files will automatically include files under the - directory postfix-files.d. Thanks to this, you don't have to edit postfix- - files or dynamicmaps.cf, when installing or deinstalling a database plugin - package. Instead, each plugin can have its own configuration file. +As with the command "make makefiles, the command "make install/upgrade +name=value..." will replace the string MAIL_VERSION in a configuration +parameter value with the Postfix release version. Do not try to specify +something like $mail_version on this command line. This produces inconsistent +results with different versions of the make(1) command. - * The plugin_directory setting provides the default directory for shared- - library objects with a relative pathname in the file - dynamicmaps.cf.version. +4.4.4 Tips for distribution maintainers - * Each configuration file under the directory dynamicmaps.cf.d.version must - have a name that ends in ".cf" and must have the same format as the file - dynamicmaps.cf.version. + * The shlib_directory parameter setting also provides the default directory + for database plugin files with a relative pathname in the file + dynamicmaps.cf. - * The directory dynamicmaps.cf.d.version is the default directory for shared- - library objects with a relative pathname in the files - dynamicmaps.cf.d.version/*.cf. Thus, the directory dynamicmaps.cf.d.version - may contain both configuration files and shared-library object files. - Hence, the requirement that configuration file names must end in ".cf". + * The meta_directory parameter specifies the location of the files + dynamicmaps.cf, postfix-files, and some multi-instance template files. The + meta_directory parameter has the same default value as the config_directory + parameter (typically, /etc/postfix or /usr/local/etc/postfix). For + backwards compatibility with Postfix 2.6 .. 2.11, specify "meta_directory = + $daemon_directory" in main.cf before installing or upgrading Postfix, or + specify "meta_directory = /path/name" on the "make makefiles", "make + install" or "make upgrade" command line. + + * The configuration file dynamicmaps.cf will automatically include files + under the directory dynamicmaps.cf.d, just like the configuration file + postfix-files will automatically include files under the directory postfix- + files.d. Thanks to this, you can install or deinstall a database plugin + package without having to edit postfix-files or dynamicmaps.cf. Instead, + you give that plugin its own configuration files dynamicmaps.cf.d and + postfix-files.d, and you add or remove those configuration files along with + the database plugin shared object. + + * Each configuration file under the directory dynamicmaps.cf.d must have the + same format as the configuration file dynamicmaps.cf. There is no + requirement that these configuration file *names* have a specific format. * Each configuration file under the directory postfix-files.d must have the same format as the configuration file postfix-files. There is no - requirement that these configuration file names have a specific format. + requirement that these configuration file *names* have a specific format. 4.4 - Building with optional features @@ -306,6 +385,12 @@ directory other than /etc/postfix, use: $ make makefiles config_directory=/some/where ...other arguments... $ make +The command "make makefiles name=value ..." will replace the string +MAIL_VERSION in a configuration parameter value with the Postfix release +version. Do not try to specify something like $mail_version on this command +line. This produces inconsistent results with different versions of the make(1) +command. + Parameters whose defaults can be specified in this way are listed below. See the postconf(5) manpage for a description (command: "nroff -man man/man5/ postconf.5 | less"). @@ -329,9 +414,9 @@ postconf.5 | less"). |_____________________|____________________| |manpage_directory |/usr/local/man | |_____________________|____________________| - |newaliases_path |/usr/bin/newaliases | + |meta_directory |/etc/postfix | |_____________________|____________________| - |plugin_directory |/usr/libexec/postfix| + |newaliases_path |/usr/bin/newaliases | |_____________________|____________________| |queue_directory |/var/spool/postfix | |_____________________|____________________| @@ -339,7 +424,7 @@ postconf.5 | less"). |_____________________|____________________| |sendmail_path |/usr/sbin/sendmail | |_____________________|____________________| - |shlib_directory |/usr/local/lib | + |shlib_directory |/usr/lib/postfix | |_____________________|____________________| 4.5.2 - All Postfix versions @@ -402,7 +487,7 @@ The following is an extensive list of names and values. |Name/Value |Description | |______________________________|______________________________________________| | |Specifies one or more non-default object | -| |libraries. Postfix 2,12 and later specify some| +| |libraries. Postfix 2.12 and later specify some| | |of their database library dependencies with | |AUXLIBS="object_library..." |AUXLIBS_CDB, AUXLIBS_LDAP, AUXLIBS_LMDB, | | |AUXLIBS_MYSQL, AUXLIBS_PCRE, AUXLIBS_PGSQL, | @@ -474,12 +559,6 @@ The following is an extensive list of names and values. |OPT=optimization_level |The default is -O. Specify OPT= to turn off | | |optimization. | |______________________________|______________________________________________| -| |Specifies a non-default Postfix shared-library| -| |version number. The default is to use the | -|SHLIB_VERSION=version |Postfix version: X.Y.Z for stable releases, | -| |X.Y-DATE for snapshot releases, X.Y-DATE- | -| |nonprod for non-production releases. | -|______________________________|______________________________________________| | |Specifies non-default gcc compiler warning | |WARN="warning_flags..." |options for use when "make" is invoked in a | | |source subdirectory only. | @@ -627,6 +706,16 @@ following commands as the super-user: file from a previous installation. If the file does not exist, use interactive installation ("make install") instead. + * If you specify name=value arguments on the "make install" or "make upgrade" + command line, then these will take precedence over compiled-in default + settings or main.cf settings. + + The command "make install/upgrade name=value ..." will replace the string + MAIL_VERSION in a configuration parameter value with the Postfix release + version. Do not try to specify something like $mail_version on this command + line. This produces inconsistent results with different versions of the + make(1) command. + 6.4 - Configure Postfix Proceed to the section on how you wish to run Postfix on your particular diff --git a/postfix/Makefile.in b/postfix/Makefile.in index 9ff608a98..ee0a68ee2 100644 --- a/postfix/Makefile.in +++ b/postfix/Makefile.in @@ -1,6 +1,6 @@ SHELL = /bin/sh WARN = -Wmissing-prototypes -Wformat -Wno-comment -OPTS = 'CC=$(CC)' +OPTS = 'WARN=$(WARN)' DIRS = src/util src/global src/dns src/tls src/xsasl src/milter src/master \ src/postfix src/fsstone src/smtpstone \ src/sendmail src/error src/pickup src/cleanup src/smtpd src/local \ @@ -12,20 +12,22 @@ DIRS = src/util src/global src/dns src/tls src/xsasl src/milter src/master \ src/postmulti src/postscreen src/dnsblog src/tlsproxy \ src/posttls-finger MANDIRS = proto man html -LIBEXEC = libexec/post-install libexec/postfix-files libexec/postfix-script \ - libexec/postfix-wrapper libexec/main.cf libexec/master.cf \ - libexec/postmulti-script -PLUGINS = plugins/dynamicmaps.cf.$(SHLIB_VERSION) -EXPAND = sed -e "s;\$${LIB_PREFIX};$(LIB_PREFIX);" \ - -e "s;\$${LIB_SUFFIX};$(LIB_SUFFIX);" \ - -e "s;\$${SHLIB_VERSION};$(SHLIB_VERSION);" +LIBEXEC = libexec/post-install libexec/postfix-script libexec/postfix-wrapper \ + libexec/postmulti-script libexec/post-install +PLUGINS = meta/dynamicmaps.cf +META = meta/main.cf.proto meta/master.cf.proto meta/postfix-files \ + meta/makedefs.out $(PLUGINS) +EXPAND = sed -e "s;\$${LIB_PREFIX};$(LIB_PREFIX);" \ + -e "s;\$${LIB_SUFFIX};$(LIB_SUFFIX);" +SHLIB_DIR_OVERRIDE = \ + $${shlib_directory:-`$(SHLIB_ENV) bin/postconf -dhx shlib_directory`} default: update -# While generating the top-level Makefile, we must get the PLUGIN_DIR +# While generating the top-level Makefile, we must get the PLUGIN_LD # setting directly from the latest makedefs.out result. -makefiles Makefiles: +makefiles Makefiles conf/makedefs.out: (echo "# Do not edit -- this file documents how Postfix was built for your machine."; $(SHELL) makedefs) >makedefs.tmp set +e; if cmp makedefs.tmp conf/makedefs.out; then rm makedefs.tmp; \ else mv makedefs.tmp conf/makedefs.out; fi >/dev/null 2>/dev/null @@ -33,11 +35,11 @@ makefiles Makefiles: (set -e; echo "[$$i]"; cd $$i; rm -f Makefile; \ $(MAKE) -f Makefile.in Makefile MAKELEVEL=) || exit 1; \ done - set -- `grep '^PLUGIN_DIR' conf/makedefs.out`; \ + @set -- `grep '^PLUGIN_LD' conf/makedefs.out`; \ rm -f Makefile; (cat conf/makedefs.out; \ case "$$3" in \ - /*) cat Makefile.in;; \ - *) grep -v '^PLUGINS' Makefile.in;; \ + ""|":") grep -v '^PLUGINS' Makefile.in;; \ + *) cat Makefile.in;; \ esac) >Makefile update printfck tests root_tests: @@ -45,31 +47,33 @@ update printfck tests root_tests: (set -e; echo "[$$i]"; cd $$i; $(MAKE) $(OPTS) $@ MAKELEVEL=) || exit 1; \ done -update: $(LIBEXEC) $(PLUGINS) - -libexec/makedefs.out: conf/makedefs.out - rm -f $@ && ln -f $? $@ +update: $(META) $(LIBEXEC) libexec/post-install: conf/post-install rm -f $@ && ln -f $? $@ -libexec/postfix-files: conf/postfix-files conf/makedefs.out Makefile +# Censor out build directory information. + +meta/makedefs.out: conf/makedefs.out + grep -v SHLIB_ENV $? > $@ + +meta/postfix-files: conf/postfix-files conf/makedefs.out Makefile rm -f $@ - (if [ "${SHLIB_DIR}" = "no" -o "${SHLIB_DIR}" = "" ]; then \ + (if [ "${SHLIB_DIR_OVERRIDE}" = "no" -o "${SHLIB_DIR}" = "" ]; then \ sed -e '/^\$$shlib_directory/d' \ - -e '/^\$$plugin_directory/d' conf/postfix-files; \ - elif [ "${PLUGIN_DIR}" = "no" -o "${PLUGIN_DIR}" = "" ]; then \ - sed -e '/^\$$plugin_directory/d' conf/postfix-files | $(EXPAND); \ + -e '/dynamicmaps.cf/d' conf/postfix-files; \ + elif [ "${PLUGIN_LD}" = "" ]; then \ + sed -e '/dynamicmaps.cf/d' \ + -e '/^\$$shlib_directory\/\$${LIB_PREFIX}/d' \ + conf/postfix-files | $(EXPAND); \ else \ $(EXPAND) conf/postfix-files | awk -F: ' \ BEGIN { \ count = split("'"$(DEFINED_MAP_TYPES)"'", names, " "); \ for (n = 1; n <= count; n++) \ - have["$$plugin_directory/$(LIB_PREFIX)" names[n] \ + have["$$shlib_directory/$(LIB_PREFIX)" names[n] \ "$(LIB_SUFFIX)"] = 1; } \ - /^[$$]plugin_directory.dynamicmaps/ { \ - print; next } \ - /^[$$]plugin_directory.$(LIB_PREFIX)/ { \ + /^[$$]shlib_directory.$(LIB_PREFIX)/ { \ if (have[$$1]) print; next } \ { print } \ '; \ @@ -83,16 +87,16 @@ libexec/postfix-script: conf/postfix-script libexec/postfix-wrapper: conf/postfix-wrapper rm -f $@ && ln -f $? $@ -libexec/main.cf: conf/main.cf +meta/main.cf.proto: conf/main.cf rm -f $@ && ln -f $? $@ -libexec/master.cf: conf/master.cf +meta/master.cf.proto: conf/master.cf rm -f $@ && ln -f $? $@ libexec/postmulti-script: conf/postmulti-script rm -f $@ && ln -f $? $@ -plugins/dynamicmaps.cf.$(SHLIB_VERSION): conf/dynamicmaps.cf Makefile +meta/dynamicmaps.cf: conf/dynamicmaps.cf Makefile rm -f $@ && $(EXPAND) conf/dynamicmaps.cf | $(AWK) ' \ BEGIN { split("'"$(DEFINED_MAP_TYPES)"'", map_types); \ for (n in map_types) has_type[map_types[n]] = n } \ @@ -107,26 +111,27 @@ manpages: printfck: update -# The build-time shlib_directory/plugin_directory settings must take -# precedence over the installed main.cf settings, otherwise we can't -# update an installed system from dynamicmaps=yes<->dynamicmaps=no -# or from shared=yes<->shared=no. +# The build-time shlib_directory setting must take precedence over +# the installed main.cf settings, otherwise we can't update an +# installed system from dynamicmaps=yes<->dynamicmaps=no or from +# shared=yes<->shared=no. install: update - $(SHLIB_ENV) shlib_directory=${SHLIB_DIR} plugin_directory=$(PLUGIN_DIR) \ - $(SHELL) postfix-install + $(SHLIB_ENV) shlib_directory=$(SHLIB_DIR_OVERRIDE) $(SHELL) \ + postfix-install package: update - $(SHLIB_ENV) shlib_directory=${SHLIB_DIR} plugin_directory=$(PLUGIN_DIR) \ - $(SHELL) postfix-install -package + $(SHLIB_ENV) shlib_directory=$(SHLIB_DIR_OVERRIDE) $(SHELL) \ + postfix-install -package upgrade: update - $(SHLIB_ENV) shlib_directory=${SHLIB_DIR} plugin_directory=$(PLUGIN_DIR) \ - $(SHELL) postfix-install -non-interactive + $(SHLIB_ENV) shlib_directory=$(SHLIB_DIR_OVERRIDE) $(SHELL) \ + postfix-install -non-interactive + non-interactive-package: update - $(SHLIB_ENV) shlib_directory=${SHLIB_DIR} plugin_directory=$(PLUGIN_DIR) \ - $(SHELL) postfix-install -non-interactive -package + $(SHLIB_ENV) shlib_directory=$(SHLIB_DIR_OVERRIDE) $(SHELL) \ + postfix-install -non-interactive -package depend clean: set -e; for i in $(DIRS); do \ @@ -144,9 +149,9 @@ tidy: clean cp Makefile.init Makefile rm -f README_FILES/RELEASE_NOTES ln -s ../RELEASE_NOTES README_FILES - rm -f bin/[!CRS]* lib/[!CRS]* include/[!CRS]* libexec/[!CRS]* plugins/[!CRS]* \ - src/*/libpostfix-*.so.* src/*/libpostfix-*.dylib.* \ - src/*/postfix-*.so.* src/*/postfix-*.dylib.* \ + rm -f bin/[!CRS]* lib/[!CRS]* include/[!CRS]* libexec/[!CRS]* \ + src/*/libpostfix-*.so src/*/libpostfix-*.dylib \ + src/*/postfix-*.so src/*/postfix-*.dylib \ junk */junk */*/junk \ *core */*core */*/*core \ .nfs* */.nfs* */*/.nfs* \ @@ -160,7 +165,7 @@ tidy: clean *.bak */*.bak */*/*.bak \ make.err */make.err */*/make.err \ *.gmon */*.gmon */*/*.gmon \ - conf/main.cf.default conf/bounce.cf.default + conf/main.cf.default conf/bounce.cf.default meta/* find . -type s -print | xargs rm -f find . -type d -print | xargs chmod 755 find . -type f -print | xargs chmod a+r diff --git a/postfix/README_FILES/INSTALL b/postfix/README_FILES/INSTALL index 18d60aa6f..d195d015f 100644 --- a/postfix/README_FILES/INSTALL +++ b/postfix/README_FILES/INSTALL @@ -155,55 +155,69 @@ Postfix shared-library and database plugin support exists for recent versions of Linux, FreeBSD and MacOS X. Shared-library builds may become the default at some point in the future. +Overview of topics: + + * 4.3.1 Turning on Postfix shared-library support + * 4.3.2 Turning on Postfix database-plugin support + * 4.3.3 Customizing Postfix shared libraries and database plugins + * 4.4.4 Tips for distribution maintainers + +Note: directories with Postfix shared libraries or database plugins should +contain only postfix-related files. Postfix shared libraries and database +plugins should not be installed in a "public" system directory such as /usr/lib +or /usr/local/lib. Linking Postfix shared-library or database-plugin files into +non-Postfix programs is not supported. Postfix shared libraries and database +plugins implement a Postfix-internal API that changes without maintaining +compatibility. + +44..33..11 TTuurrnniinngg oonn PPoossttffiixx sshhaarreedd--lliibbrraarryy ssuuppppoorrtt + Postfix can be built with Postfix shared libraries (files typically named -libpostfix-*.so.*). Postfix shared libraries add minor run-time overhead and +libpostfix-*.so). Postfix shared libraries add minor run-time overhead and result in significantly-smaller Postfix executable files. Specify "shared=yes" on the "make makefiles" command line to build Postfix with shared-library support. $ make makefiles shared=yes ...other arguments... - $ make makefiles shared=no ...other arguments... $ make -This defaults to installing shared libraries in /usr/local/lib, typically with -names like libpostfix-name.so.version, where the name is a source-code -directory name such as "util" or "global", and the version is the Postfix -version: x.y.z for stable releases, x.y-date for snapshot (development) -releases, or x.y-date-nonprod for non-production releases. +(Specify "make makefiles shared=no" to explicitly disable Postfix shared- +library support). -To override the default location or shared-library version, specify, for -example: +This installs shared libraries in $shlib_directory, typically, /usr/lib/ +postfix/version or /usr/local/lib/postfix/version, with names like 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. - $ make makefiles shared=yes shlib_directory=/usr/lib \ - SHLIB_VERSION=1 ...other arguments... +See section 4.3.3 "Customizing Postfix shared libraries and database plugins" +below for how to customize the Postfix shared-library location and version. -You can change the shlib_directory setting after Postfix is built, with "make -install" or "make upgrade". However, you may have to run ldconfig if you change -shlib_directory after Postfix is built and install the libpostfix-*.so.* files -in a non-system directory. No ldconfig is needed if you keep the libpostfix- -*.so.* files in the compiled-in default $shlib_directory location. +44..33..22 TTuurrnniinngg oonn PPoossttffiixx ddaattaabbaassee--pplluuggiinn ssuuppppoorrtt Additionally, Postfix can be built to support dynamic loading of Postfix -database clients with the Debian-style dynamicmaps feature. Postfix 2.12 -supports dynamic loading of cdb:, ldap:, lmdb:, mysql:, pcre:, pgsql:, sdbm:, -and sqlite: database clients. Dynamic loading is useful when you distribute or -install pre-compiled Postfix packages. +database clients (database plugins) with the Debian-style dynamicmaps feature. +Postfix 2.12 supports dynamic loading of cdb:, ldap:, lmdb:, mysql:, pcre:, +pgsql:, sdbm:, and sqlite: database clients. Dynamic loading is useful when you +distribute or install pre-compiled Postfix packages. Specify "dynamicmaps=yes" on the "make makefiles" command line to build Postfix -with support to dynamically load Postfix database clients (database plugins) -with the Debian-style dynamicmaps feature. +with support to dynamically load Postfix database clients with the Debian-style +dynamicmaps feature. $ make makefiles dynamicmaps=yes ...other arguments... - $ make makefiles dynamicmaps=no ...other arguments... $ make -This implicitly enables shared-library support, and defaults to installing -dynamicmaps.cf and database plugins in /usr/libexec/postfix. Database plugins -are typically named postfix-type.so.version where the type is a database type -such as "cdb" or "ldap", and where the version is the same as for Postfix -shared libraries. The installed dynamicmaps.cf configuration file is given a -suffix with the same version. +(Specify "make makefiles dynamicmaps=no" to explicitly disable Postfix +database-plugin support). + +This implicitly enables shared-library support, installs the configuration file +dynamicmaps.cf in $meta_directory (usually, /etc/postfix or /usr/local/etc/ +postfix), and installs database plugins in $shlib_directory (see above). +Database plugins are named postfix-type.so where the type is a database type +such as "cdb" or "ldap". NOTE: The Postfix 2.12 build procedure expects that you specify database library dependencies with variables named AUXLIBS_CDB, AUXLIBS_LDAP, etc. @@ -217,50 +231,115 @@ suffix with the same version. dependencies. And that was exactly what dynamic database client loading was meant to avoid. -To override the default location or shared-library version, specify, for +See the next section for how to customize the location and version of Postfix +database plugins and the location of the file dynamicmaps.cf. + +44..33..33 CCuussttoommiizziinngg PPoossttffiixx sshhaarreedd lliibbrraarriieess aanndd ddaattaabbaassee pplluuggiinnss + +CCuussttoommiizziinngg tthhee llooccaattiioonn ooff PPoossttffiixx sshhaarreedd lliibbrraarriieess aanndd ddaattaabbaassee pplluuggiinnss + +As a reminder, the directories with Postfix shared libraries or database +plugins should contain only Postfix-related files. Linking these files into +other programs is not supported. + +To override the default location of Postfix shared libraries and database +plugins specify, for example: + + $ make makefiles shared=yes shlib_directory=/usr/local/lib/postfix ... + +If you intend to upgrade Postfix without stopping the mail system, then you +should append the Postfix release version to the shlib_directory pathname, to +eliminate the possibility that programs from the old Postfix version will link +with files from the new Postfix version. For example: + + $ make makefiles shared=yes \ + shlib_directory=/usr/local/lib/postfix/MAIL_VERSION ... + +The command "make makefiles name=value..." will replace the string MAIL_VERSION +in a configuration parameter value with the Postfix release version. Do not try +to specify something like $mail_version on this command line. This produces +inconsistent results with different versions of the make(1) command. + +You can change the shlib_directory setting after Postfix is built, with "make +install" or "make upgrade". However, you may have to run ldconfig if you change +shlib_directory after Postfix is built (the symptom is that Postfix programs +fail because the run-time linker cannot find the files libpostfix-*.so). No +ldconfig command is needed if you keep the files libpostfix-*.so in the +compiled-in default $shlib_directory location. + + # make upgrade shlib_directory=/usr/local/lib/postfix ... + # make install shlib_directory=/usr/local/lib/postfix ... + +To append the Postfix release version to the pathname if you intend to upgrade +Postfix without stopping the mail system: + + # make upgrade shlib_directory=/usr/local/lib/postfix/MAIL_VERSION ... + # make install shlib_directory=/usr/local/lib/postfix/MAIL_VERSION ... + +See also the comments above for appending MAIL_VERSION with the "make +makefiles" command. + +CCuussttoommiizziinngg tthhee llooccaattiioonn ooff ddyynnaammiiccmmaappss..ccff aanndd ootthheerr ffiilleess + +The meta_directory parameter has the same default setting as the +config_directory parameter, typically /etc/postfix or /usr/local/etc/postfix. + +You can override the default meta_directory location at compile time or after +Postfix is built. To override the default location at compile time specify, for example: - % make makefiles dynamicmaps=yes plugin_directory=/usr/lib/postfix \ - SHLIB_VERSION=1 ... + % make makefiles meta_directory=/usr/libexec/postfix ... -You can also override the plugin_directory setting after Postfix is built, with -"make install" or "make upgrade". In this case, there is no need to run the -ldconfig command. +Here is a tip if you want to make a pathname dependent on the Postfix release +version: the command "make makefiles name=value..." will replace the string +MAIL_VERSION in a configuration parameter value with the Postfix release +version. Do not try to specify something like $mail_version on this command +line. This produces inconsistent results with different versions of the make(1) +command. -Tips for distribution maintainers: +You can override the meta_directory setting after Postfix is built, with "make +install" or "make upgrade". - * The postfix-install procedure creates a compatibility symlink - dynamicmaps.cf -> dynamicmaps.cf.version (as well as a symlink - dynamicmaps.cf.d -> dynamicmaps.cf.version.d; more on that below). It is - therefore safe to use "unversioned" configuration file names when - installing or deinstalling a database plugin. However, Postfix itself will - use the "versioned" names, to allow minor upgrades to happen without having - to stop Postfix. + # make upgrade meta_directory=/usr/libexec/postfix ... + # make install meta_directory=/usr/libexec/postfix ... - * The configuration file dynamicmaps.cf.version will automatically include - files under the directory dynamicmaps.cf.d.version, just like the - configuration file postfix-files will automatically include files under the - directory postfix-files.d. Thanks to this, you don't have to edit postfix- - files or dynamicmaps.cf, when installing or deinstalling a database plugin - package. Instead, each plugin can have its own configuration file. +As with the command "make makefiles, the command "make install/upgrade +name=value..." will replace the string MAIL_VERSION in a configuration +parameter value with the Postfix release version. Do not try to specify +something like $mail_version on this command line. This produces inconsistent +results with different versions of the make(1) command. - * The plugin_directory setting provides the default directory for shared- - library objects with a relative pathname in the file - dynamicmaps.cf.version. +44..44..44 TTiippss ffoorr ddiissttrriibbuuttiioonn mmaaiinnttaaiinneerrss - * Each configuration file under the directory dynamicmaps.cf.d.version must - have a name that ends in ".cf" and must have the same format as the file - dynamicmaps.cf.version. + * The shlib_directory parameter setting also provides the default directory + for database plugin files with a relative pathname in the file + dynamicmaps.cf. - * The directory dynamicmaps.cf.d.version is the default directory for shared- - library objects with a relative pathname in the files - dynamicmaps.cf.d.version/*.cf. Thus, the directory dynamicmaps.cf.d.version - may contain both configuration files and shared-library object files. - Hence, the requirement that configuration file names must end in ".cf". + * The meta_directory parameter specifies the location of the files + dynamicmaps.cf, postfix-files, and some multi-instance template files. The + meta_directory parameter has the same default value as the config_directory + parameter (typically, /etc/postfix or /usr/local/etc/postfix). For + backwards compatibility with Postfix 2.6 .. 2.11, specify "meta_directory = + $daemon_directory" in main.cf before installing or upgrading Postfix, or + specify "meta_directory = /path/name" on the "make makefiles", "make + install" or "make upgrade" command line. + + * The configuration file dynamicmaps.cf will automatically include files + under the directory dynamicmaps.cf.d, just like the configuration file + postfix-files will automatically include files under the directory postfix- + files.d. Thanks to this, you can install or deinstall a database plugin + package without having to edit postfix-files or dynamicmaps.cf. Instead, + you give that plugin its own configuration files dynamicmaps.cf.d and + postfix-files.d, and you add or remove those configuration files along with + the database plugin shared object. + + * Each configuration file under the directory dynamicmaps.cf.d must have the + same format as the configuration file dynamicmaps.cf. There is no + requirement that these configuration file *names* have a specific format. * Each configuration file under the directory postfix-files.d must have the same format as the configuration file postfix-files. There is no - requirement that these configuration file names have a specific format. + requirement that these configuration file *names* have a specific format. 44..44 -- BBuuiillddiinngg wwiitthh ooppttiioonnaall ffeeaattuurreess @@ -306,6 +385,12 @@ directory other than /etc/postfix, use: $ make makefiles config_directory=/some/where ...other arguments... $ make +The command "make makefiles name=value ..." will replace the string +MAIL_VERSION in a configuration parameter value with the Postfix release +version. Do not try to specify something like $mail_version on this command +line. This produces inconsistent results with different versions of the make(1) +command. + Parameters whose defaults can be specified in this way are listed below. See the postconf(5) manpage for a description (command: "nroff -man man/man5/ postconf.5 | less"). @@ -329,9 +414,9 @@ postconf.5 | less"). |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |manpage_directory |/usr/local/man | |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | - |newaliases_path |/usr/bin/newaliases | + |meta_directory |/etc/postfix | |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | - |plugin_directory |/usr/libexec/postfix| + |newaliases_path |/usr/bin/newaliases | |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |queue_directory |/var/spool/postfix | |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | @@ -339,7 +424,7 @@ postconf.5 | less"). |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |sendmail_path |/usr/sbin/sendmail | |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | - |shlib_directory |/usr/local/lib | + |shlib_directory |/usr/lib/postfix | |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | 44..55..22 -- AAllll PPoossttffiixx vveerrssiioonnss @@ -402,7 +487,7 @@ The following is an extensive list of names and values. |NNaammee//VVaalluuee |DDeessccrriippttiioonn | |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | | |Specifies one or more non-default object | -| |libraries. Postfix 2,12 and later specify some| +| |libraries. Postfix 2.12 and later specify some| | |of their database library dependencies with | |AUXLIBS="object_library..." |AUXLIBS_CDB, AUXLIBS_LDAP, AUXLIBS_LMDB, | | |AUXLIBS_MYSQL, AUXLIBS_PCRE, AUXLIBS_PGSQL, | @@ -474,12 +559,6 @@ The following is an extensive list of names and values. |OPT=optimization_level |The default is -O. Specify OPT= to turn off | | |optimization. | |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | -| |Specifies a non-default Postfix shared-library| -| |version number. The default is to use the | -|SHLIB_VERSION=version |Postfix version: X.Y.Z for stable releases, | -| |X.Y-DATE for snapshot releases, X.Y-DATE- | -| |nonprod for non-production releases. | -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | | |Specifies non-default gcc compiler warning | |WARN="warning_flags..." |options for use when "make" is invoked in a | | |source subdirectory only. | @@ -627,6 +706,16 @@ following commands as the super-user: file from a previous installation. If the file does not exist, use interactive installation ("make install") instead. + * If you specify name=value arguments on the "make install" or "make upgrade" + command line, then these will take precedence over compiled-in default + settings or main.cf settings. + + The command "make install/upgrade name=value ..." will replace the string + MAIL_VERSION in a configuration parameter value with the Postfix release + version. Do not try to specify something like $mail_version on this command + line. This produces inconsistent results with different versions of the + make(1) command. + 66..44 -- CCoonnffiigguurree PPoossttffiixx Proceed to the section on how you wish to run Postfix on your particular diff --git a/postfix/README_FILES/PACKAGE_README b/postfix/README_FILES/PACKAGE_README index d90078337..898ec95f0 100644 --- a/postfix/README_FILES/PACKAGE_README +++ b/postfix/README_FILES/PACKAGE_README @@ -57,6 +57,12 @@ installation parameters on the command line: With Postfix versions before 2.2 you must invoke the post-install script directly (% sshh ppoosstt--iinnssttaallll --nnoonn--iinntteerraaccttiivvee iinnssttaallll__rroooott......). +With Postfix 2.12 and later, the command "make package name=value ..." will +replace the string MAIL_VERSION in a configuration parameter value with the +Postfix release version. Do not try to specify something like $mail_version on +this command line. This produces inconsistent results with different versions +of the make(1) command. + BBeeggiinn SSeeccuurriittyy AAlleerrtt WWhheenn bbuuiillddiinngg aann aarrcchhiivvee ffoorr ddiissttrriibbuuttiioonn,, bbee ssuurree ttoo aarrcchhiivvee oonnllyy ffiilleess aanndd diff --git a/postfix/RELEASE_NOTES b/postfix/RELEASE_NOTES index 7db5b309e..e50d7d3c9 100644 --- a/postfix/RELEASE_NOTES +++ b/postfix/RELEASE_NOTES @@ -16,10 +16,18 @@ specifies the release date of a stable release or snapshot release. If you upgrade from Postfix 2.10 or earlier, read RELEASE_NOTES-2.11 before proceeding. -Notes for distribution maintainers (20140530) ---------------------------------------------- +Notes for distribution maintainers +---------------------------------- -The Postfix build/install procedure has changed. +The Postfix build/install procedure has changed to support Postfix +shared libraries and database plugins. + +[Update 20140625: As a result of maintainer feedback, 1) the Postfix +release version is no longer used as a filename suffix for Postfix +shared libraries, database plugins or dynamicmaps.cf; 2) non-executable +files have been moved away from $daemon_directory to $meta_directory +(usually, /etc/postfix). The release notes below for 20140530 have +been updated accordingly.] To avoid massive frustration due to broken patches, PLEASE BUILD POSTFIX FIRST WITHOUT APPLYING ANY PATCHES. Follow the INSTALL @@ -33,6 +41,22 @@ Maintainers may also benefit from the makedefs documentation (mantools/srctoman - makedefs | nroff -man | less) with information about build options that are not described in the INSTALL instructions. +Incompatible changes with snapshot 20140625 +=========================================== + +For compliance with file system policies, some files have been moved +from $daemon_directory to the directory specified with the new +meta_directory configuration parameter which has the same default +value as the config_directory parameter. This change affects +non-executable files that are shared between multiple Postfix +instances such as postfix-files, dynamicmaps.cf, and multi-instance +template files. + +For backwards compatibility with Postfix 2.6 .. 2.11, specify +"meta_directory = $daemon_directory" in main.cf before installing +or upgrading Postfix, or specify "meta_directory = /path/name" on +the "make makefiles", "make install" or "make upgrade" command line. + Incompatible changes with snapshot 20140618 =========================================== @@ -139,11 +163,11 @@ of Linux, FreeBSD, MacOS X, and for the ancient Solaris 9. To support Postfix shared libraries and dynamically-loadable database clients, the Postfix build procedure had to be changed (specifically, -the makedefs and Makefile.in files, and the scripts that install -or update Postfix). These changes are introduced early in the -annual Postfix development cycle to give down-stream maintainers -sufficient time to prepare their build systems for the next stable -Postfix release. +the files makedefs and Makefile.in, and the files postfix-install +and post-install that install or update Postfix). These changes +are introduced early in the annual Postfix development cycle to +give down-stream maintainers sufficient time to prepare their build +systems for the next stable Postfix release in 2015. Building with Postfix shared libraries and database plugins ----------------------------------------------------------- @@ -151,18 +175,19 @@ Building with Postfix shared libraries and database plugins Please see the INSTALL section "Building with Postfix shared libraries and database plugins" for fine-tuning details. -To build with Postfix shared libraries (libpostfix-*.so.*), use: +To build with Postfix shared libraries (files named libpostfix-*.so), +use: % make makefiles shared=yes ...other arguments... To build with dynamicmaps.cf support and dynamically-loadable -database clients (postfix-*.so.*), use: +database clients (files named postfix-*.so), use: % make makefiles dynamicmaps=yes ...other arguments... -This implicitly enables support for libpostfix-*.so.* shared -libraries. Postfix 2.12 supports dynamic loading for CDB, LDAP, -LMDB, MYSQL, PCRE, PGSQL, SDBM, and SQLITE database clients. +This implicitly enables support for Postfix shared libraries. Postfix +2.12 supports dynamic loading for CDB, LDAP, LMDB, MYSQL, PCRE, +PGSQL, SDBM, and SQLITE database clients. NOTE: The Postfix 2.12 build procedure expects that you specify database library dependencies with variables named AUXLIBS_CDB, @@ -184,22 +209,28 @@ Besides changes to the Postfix "build" system as described above, the user-visible changes with respect to Debian are: - The new shlib_directory parameter specifies the location of the - libpostfix-*.so.* shared-library files. You can change the location - of these files after Postfix is built. However, you may have to - run ldconfig if you move the libpostfix-*.so.* files to a non-system - directory. No ldconfig is needed if you keep the libpostfix-*.so.* - files in the compiled-in default $shlib_directory location. + libpostfix-*.so shared-library files and the postfix-*.so database + plugins. You can change the location of these files after Postfix + is built. However, you may have to run ldconfig if you change the + libpostfix-*.so location. No ldconfig is needed if you keep the + libpostfix-*.so files in the compiled-in default $shlib_directory + location. -- The new plugin_directory parameter specifies the location of the - dynamicmaps.cf database plugin configuration file and of any - postfix-*.so.* plugins with a relative pathname. The dynamicmaps.cf - location is not hard-coded to /etc, because the file is shared - among all Postfix instances just like postfix-files and other - files. Files in /etc are meant to be instance-specific. +- The new meta_directory parameter specifies the location of the + file dynamicmaps.cf and some other non-executable files. The + meta_directory parameter has the same default value as the + config_directory parameter, so this is backwards compatible with + Debian (but the default setting may be changed at compile time). -- Postfix supports the directory dynamicmaps.cf.d. in addition to - the file dynamicmaps.cf. Maintainers can one configuration file - per database plugin, which simplifies installation and removal. +- Postfix supports the directory dynamicmaps.cf.d in addition to + the file dynamicmaps.cf. Maintainers can use one configuration + file per database plugin, which simplifies installation and + removal of individual plugins. + +- Likewise, Postfix supports the directory postfix-files.d in + addition to the file postfix-files, Again, maintainers can use + one configuration file per database plugin, which simplifies + installation and removal of individual plugins. Major changes with snapshot 20140321 ==================================== diff --git a/postfix/conf/post-install b/postfix/conf/post-install index 58ef79634..f81f6b91d 100644 --- a/postfix/conf/post-install +++ b/postfix/conf/post-install @@ -40,8 +40,8 @@ # Arguments # .IP create-missing # Create missing queue directories with ownerships and permissions -# according to the contents of $daemon_directory/postfix-files -# and optionally in $daemon_directory/postfix-files.d/*, using +# according to the contents of $meta_directory/postfix-files +# and optionally in $meta_directory/postfix-files.d/*, using # the mail_owner and setgid_group parameter settings from the # command line, process environment or from the installed # main.cf file. @@ -49,8 +49,8 @@ # This is required at Postfix start-up time. # .IP set-permissions # Set all file/directory ownerships and permissions according to the -# contents of $daemon_directory/postfix-files and optionally -# in $daemon_directory/postfix-files.d/*, using the mail_owner +# contents of $meta_directory/postfix-files and optionally +# in $meta_directory/postfix-files.d/*, using the mail_owner # and setgid_group parameter settings from the command line, # process environment or from the installed main.cf file. # Implies create-missing. @@ -60,8 +60,8 @@ # settings after Postfix is already installed. # .IP upgrade-permissions # Update ownership and permission of existing files/directories as -# specified in $daemon_directory/postfix-files and optionally -# in $daemon_directory/postfix-files.d/*, using the mail_owner +# specified in $meta_directory/postfix-files and optionally +# in $meta_directory/postfix-files.d/*, using the mail_owner # and setgid_group parameter settings from the command line, # process environment or from the installed main.cf file. # Implies create-missing. @@ -176,16 +176,20 @@ # .IP readme_directory # The directory for the Postfix README files. # .IP shlib_directory -# The directory for the Postfix shared-library files. -# .IP plugin_directory -# The directory for the Postfix dynamicmaps.cf database plugin -# configuration file, and files referenced by that file. +# The directory for the Postfix shared-library files, and for +# the Postfix dabatase plugin files with a relative pathname +# in the file dynamicmaps.cf. +# .IP meta_directory +# The directory for non-executable files that are shared +# among multiple Postfix instances, such as postfix-files, +# dynamicmaps.cf, as well as the multi-instance template files +# main.cf.proto and master.cf.proto. # SEE ALSO # postfix-install(1) Postfix primary installation script. # FILES # $config_directory/main.cf, Postfix installation parameters. -# $daemon_directory/postfix-files, installation control file. -# $daemon_directory/postfix-files.d/*, optional control files. +# $meta_directory/postfix-files, installation control file. +# $meta_directory/postfix-files.d/*, optional control files. # $config_directory/install.cf, obsolete configuration file. # LICENSE # .ad @@ -210,7 +214,7 @@ debug=: MOST_PARAMETERS="command_directory daemon_directory data_directory html_directory mail_owner mailq_path manpage_directory newaliases_path queue_directory readme_directory sample_directory - sendmail_path setgid_group shlib_directory plugin_directory" + sendmail_path setgid_group shlib_directory meta_directory" NON_SHARED="config_directory queue_directory data_directory" USAGE="Usage: $0 [name=value] command @@ -292,8 +296,8 @@ do esac done -test -f $daemon_directory/postfix-files || { - echo $0: Error: $daemon_directory/postfix-files is not a file. 1>&2 +test -f $meta_directory/postfix-files || { + echo $0: Error: $meta_directory/postfix-files is not a file. 1>&2 exit 1 } @@ -366,7 +370,8 @@ case $setgid_group in esac for path in "$daemon_directory" "$command_directory" "$queue_directory" \ - "$sendmail_path" "$newaliases_path" "$mailq_path" "$manpage_directory" + "$sendmail_path" "$newaliases_path" "$mailq_path" "$manpage_directory" \ + "$meta_directory" do case "$path" in /*) ;; @@ -374,7 +379,7 @@ do esac done -for path in "$html_directory" "$readme_directory" "$shlib_directory" "$plugin_directory" +for path in "$html_directory" "$readme_directory" "$shlib_directory" do case "$path" in /*) ;; @@ -444,15 +449,15 @@ test -n "$override" && { "sample_directory = $sample_directory" \ "readme_directory = $readme_directory" \ "shlib_directory = $shlib_directory" \ - "plugin_directory = $plugin_directory" \ + "meta_directory = $meta_directory" \ || exit 1 } -# Use file/directory status information in $daemon_directory/postfix-files. +# Use file/directory status information in $meta_directory/postfix-files. test -n "$create" && { - postfix_files_d=$daemon_directory/postfix-files.d - for postfix_file in $daemon_directory/postfix-files \ + postfix_files_d=$meta_directory/postfix-files.d + for postfix_file in $meta_directory/postfix-files \ `test -d $postfix_files_d && { find $postfix_files_d -type f | sort; }` do exec <$postfix_file || exit 1 diff --git a/postfix/conf/postfix-files b/postfix/conf/postfix-files index 2b333e006..b259bca8c 100644 --- a/postfix/conf/postfix-files +++ b/postfix/conf/postfix-files @@ -66,25 +66,27 @@ $queue_directory/public:d:$mail_owner:$setgid_group:710:uc $queue_directory/pid:d:root:-:755:uc $queue_directory/saved:d:$mail_owner:-:700:ucr $queue_directory/trace:d:$mail_owner:-:700:ucr -# Update shared libraries before daemon or command-line programs. +# Update shared libraries and plugins before daemon or command-line programs. $shlib_directory/lib${LIB_PREFIX}util${LIB_SUFFIX}:f:root:-:755 $shlib_directory/lib${LIB_PREFIX}global${LIB_SUFFIX}:f:root:-:755 $shlib_directory/lib${LIB_PREFIX}dns${LIB_SUFFIX}:f:root:-:755 $shlib_directory/lib${LIB_PREFIX}tls${LIB_SUFFIX}:f:root:-:755 $shlib_directory/lib${LIB_PREFIX}master${LIB_SUFFIX}:f:root:-:755 -# Update database plugins before daemon or command-line programs. -$plugin_directory/${LIB_PREFIX}cdb${LIB_SUFFIX}:f:root:-:755 -$plugin_directory/${LIB_PREFIX}ldap${LIB_SUFFIX}:f:root:-:755 -$plugin_directory/${LIB_PREFIX}lmdb${LIB_SUFFIX}:f:root:-:755 -$plugin_directory/${LIB_PREFIX}mysql${LIB_SUFFIX}:f:root:-:755 -$plugin_directory/${LIB_PREFIX}pcre${LIB_SUFFIX}:f:root:-:755 -$plugin_directory/${LIB_PREFIX}pgsql${LIB_SUFFIX}:f:root:-:755 -$plugin_directory/${LIB_PREFIX}sdbm${LIB_SUFFIX}:f:root:-:755 -$plugin_directory/${LIB_PREFIX}sqlite${LIB_SUFFIX}:f:root:-:755 -$plugin_directory/dynamicmaps.cf.${SHLIB_VERSION}:f:root:-:644: -$plugin_directory/dynamicmaps.cf.${SHLIB_VERSION}.d:d:root:-:755: -$plugin_directory/dynamicmaps.cf:l:dynamicmaps.cf.${SHLIB_VERSION}:-:: -$plugin_directory/dynamicmaps.cf.d:l:dynamicmaps.cf.${SHLIB_VERSION}.d:-:: +$shlib_directory/${LIB_PREFIX}cdb${LIB_SUFFIX}:f:root:-:755 +$shlib_directory/${LIB_PREFIX}ldap${LIB_SUFFIX}:f:root:-:755 +$shlib_directory/${LIB_PREFIX}lmdb${LIB_SUFFIX}:f:root:-:755 +$shlib_directory/${LIB_PREFIX}mysql${LIB_SUFFIX}:f:root:-:755 +$shlib_directory/${LIB_PREFIX}pcre${LIB_SUFFIX}:f:root:-:755 +$shlib_directory/${LIB_PREFIX}pgsql${LIB_SUFFIX}:f:root:-:755 +$shlib_directory/${LIB_PREFIX}sdbm${LIB_SUFFIX}:f:root:-:755 +$shlib_directory/${LIB_PREFIX}sqlite${LIB_SUFFIX}:f:root:-:755 +$meta_directory/dynamicmaps.cf.d:d:root:-:755 +$meta_directory/dynamicmaps.cf:f:root:-:644 +$meta_directory/main.cf.proto:f:root:-:644 +$meta_directory/makedefs.out:f:root:-:644 +$meta_directory/master.cf.proto:f:root:-:644 +$meta_directory/postfix-files.d:d:root:-:755 +$meta_directory/postfix-files:f:root:-:644 $daemon_directory/anvil:f:root:-:755 $daemon_directory/bounce:f:root:-:755 $daemon_directory/cleanup:f:root:-:755 @@ -92,17 +94,17 @@ $daemon_directory/discard:f:root:-:755 $daemon_directory/dnsblog:f:root:-:755 $daemon_directory/error:f:root:-:755 $daemon_directory/flush:f:root:-:755 -#$daemon_directory/lmtp:f:root:-:755 $daemon_directory/local:f:root:-:755 -$daemon_directory/main.cf:f:root:-:644 -$daemon_directory/master.cf:f:root:-:644 +$daemon_directory/main.cf:f:root:-:644:o +$daemon_directory/master.cf:f:root:-:644:o $daemon_directory/master:f:root:-:755 $daemon_directory/oqmgr:f:root:-:755 $daemon_directory/pickup:f:root:-:755 $daemon_directory/pipe:f:root:-:755 $daemon_directory/post-install:f:root:-:755 -$daemon_directory/postfix-files:f:root:-:644 -$daemon_directory/postfix-files.d:d:root:-:755 +# In case meta_directory == daemon_directory. +#$daemon_directory/postfix-files:f:root:-:644:o +#$daemon_directory/postfix-files.d:d:root:-:755:o $daemon_directory/postfix-script:f:root:-:755 $daemon_directory/postfix-wrapper:f:root:-:755 $daemon_directory/postmulti-script:f:root:-:755 @@ -150,10 +152,8 @@ $config_directory/header_checks:f:root:-:644:p1 $config_directory/install.cf:f:root:-:644:o $config_directory/main.cf.default:f:root:-:644:1 $config_directory/main.cf:f:root:-:644:p -$config_directory/makedefs.out:f:root:-:644:1 $config_directory/master.cf:f:root:-:644:p $config_directory/pcre_table:f:root:-:644:o -$config_directory/postfix-files:f:root:-:644:o $config_directory/regexp_table:f:root:-:644:o $config_directory/relocated:f:root:-:644:p1 $config_directory/tcp_table:f:root:-:644:o diff --git a/postfix/conf/postfix-script b/postfix/conf/postfix-script index 790161fec..be2187691 100644 --- a/postfix/conf/postfix-script +++ b/postfix/conf/postfix-script @@ -71,13 +71,10 @@ no) ;; exit 1 } esac -case $plugin_directory in -no) ;; - *) cd $plugin_directory || { - $FATAL no Postfix plugin directory $plugin_directory! - exit 1 - } -esac +cd $meta_directory || { + $FATAL no Postfix meta directory $meta_directory! + exit 1 +} cd $queue_directory || { $FATAL no Postfix queue directory $queue_directory! exit 1 @@ -259,10 +256,10 @@ check-warn) test -n "$check_shared_files" && { todo="$daemon_directory $todo" test "$shlib_directory" = "no" || todo="$shlib_directory $todo" - test "$plugin_directory" = "no" || todo="$plugin_directory $todo" + todo="$meta_directory $todo" } - for dir in $todo + for dir in `echo "$todo" | tr ' ' '\12' | sort -u` do ls -lLd $dir | (grep " root " >/dev/null || $WARN not owned by root: $dir) @@ -277,7 +274,6 @@ check-warn) todo="$daemon_directory/* $todo" test "$shlib_directory" = "no" || todo="$shlib_directory/libpostfix* $todo" - # plugin_directory/* is checked by dynamicmaps routines. } find $todo ! -user root \ @@ -287,7 +283,7 @@ check-warn) test -n "$check_shared_files" && todo="$daemon_directory/. $todo" # FIXME don't scan non-Postfix files under /usr/local/lib. test "$shlib_directory" = "no" || - todo="$shlib_directory/libpostfix* $todo" + todo="$shlib_directory/libpostfix* $shlib_directory/postfix* $todo" find $todo \ \( -perm -020 -o -perm -002 \) -type f \ diff --git a/postfix/conf/postmulti-script b/postfix/conf/postmulti-script index 4d1a9feb4..349c8941d 100644 --- a/postfix/conf/postmulti-script +++ b/postfix/conf/postmulti-script @@ -14,6 +14,8 @@ umask 022 # MAIL_CONFIG - config_directory of primary instance # command_directory - From primary instance # daemon_directory - From primary instance +# meta_directory - From primary instance +# shlib_directory - From primary instance # config_directroy - config_directory of target instance # queue_directory - queue_directory of target instance # data_directory - data_directory of target instance @@ -30,6 +32,8 @@ umask 022 : ${MAIL_CONFIG:?"do not invoke this command directly"} : ${command_directory:?"do not invoke this command directly"} : ${daemon_directory:?"do not invoke this command directly"} +: ${meta_directory:?"do not invoke this command directly"} +: ${shlib_directory:?"do not invoke this command directly"} USAGE="$0 -e create|destroy|import|deport|enable|disable|assign|init" usage() { echo "$0: Error: Usage: $USAGE" >&2; exit 1; } @@ -109,6 +113,17 @@ init) exit $? ;; esac +# Backport note: "-x" requires 2.10 or later, and is not essential here. +# +wrapper=`postconf -hx multi_instance_wrapper` || exit 1 +enable=`postconf -hx multi_instance_enable` || exit 1 + +test -n "$wrapper" || + fatal "multi_instance_wrapper is empty, run 'postmulti -e init' first." + +test "$enable" = "yes" || + fatal "multi_instance_enable!=yes, run 'postmulti -e init' first." + : ${config_directory:?"Invalid empty target instance config_directory"} case $action in @@ -138,7 +153,7 @@ create|import) tmpdir=$config_directory/.tmp (umask 077; mkdir -p $tmpdir) || exit 1 - cp -p $daemon_directory/main.cf $tmpdir/main.cf || exit 1 + cp -p $meta_directory/main.cf.proto $tmpdir/main.cf || exit 1 # Shared install parameters are cloned from user-specified values in # the default instance, but only if explicitly set there. Otherwise, @@ -147,6 +162,7 @@ create|import) SHARED_PARAMETERS=" command_directory daemon_directory + meta_directory mail_owner setgid_group sendmail_path @@ -157,7 +173,6 @@ create|import) sample_directory readme_directory shlib_directory - plugin_directory " shift $# # Needed on SunOS where bare "set --" is NOP! @@ -185,7 +200,7 @@ create|import) "$@" || exit 1 - cp -p $daemon_directory/master.cf $tmpdir/master.cf || exit 1 + cp -p $meta_directory/master.cf.proto $tmpdir/master.cf || exit 1 mv $tmpdir/main.cf $config_directory/main.cf || exit 1 mv $tmpdir/master.cf $config_directory/master.cf || exit 1 rmdir $tmpdir 2>/dev/null diff --git a/postfix/html/INSTALL.html b/postfix/html/INSTALL.html index 2072a22f1..5c35d0367 100644 --- a/postfix/html/INSTALL.html +++ b/postfix/html/INSTALL.html @@ -236,8 +236,37 @@ $ make recent versions of Linux, FreeBSD and MacOS X. Shared-library builds may become the default at some point in the future.
+Overview of topics:
+ +Note: directories with Postfix shared libraries or database +plugins should contain only postfix-related files. Postfix shared +libraries and database plugins should not be installed in a "public" +system directory such as /usr/lib or /usr/local/lib. Linking Postfix +shared-library or database-plugin files into non-Postfix programs +is not supported. Postfix shared libraries and database plugins +implement a Postfix-internal API that changes without maintaining +compatibility.
+ +Postfix can be built with Postfix shared libraries (files -typically named libpostfix-*.so.*). Postfix shared libraries +typically named libpostfix-*.so). Postfix shared libraries add minor run-time overhead and result in significantly-smaller Postfix executable files.
@@ -247,63 +276,57 @@ build Postfix with shared-library support.-$ make makefiles shared=yes ...other arguments... -$ make makefiles shared=no ...other arguments... $ make
This defaults to installing shared libraries in /usr/local/lib, -typically with names like libpostfix-name.so.version, -where the name is a source-code directory name such as "util" -or "global", and the version is the Postfix version: -x.y.z for stable releases, x.y-date for snapshot -(development) releases, or x.y-date-nonprod for -non-production releases.
+(Specify "make makefiles shared=no" to explicitly disable Postfix +shared-library support).
-To override the default location or shared-library version, -specify, for example:
+This installs shared libraries in $shlib_directory, typically, +/usr/lib/postfix/version or /usr/local/lib/postfix/version, +with names like 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.
--+-$ make makefiles shared=yes shlib_directory=/usr/lib \ - SHLIB_VERSION=1 ...other arguments... --
See section 4.3.3 "Customizing Postfix shared libraries and +database plugins" below for how to customize the Postfix shared-library +location and version. -
You can change the shlib_directory setting after Postfix is -built, with "make install" or "make upgrade". However, you may have -to run ldconfig if you change shlib_directory after Postfix is built -and install the libpostfix-*.so.* files in a non-system directory. -No ldconfig is needed if you keep the libpostfix-*.so.* files in -the compiled-in default $shlib_directory location.
+Additionally, Postfix can be built to support dynamic loading -of Postfix database clients with the Debian-style dynamicmaps -feature. Postfix 2.12 supports dynamic loading of cdb:, ldap:, -lmdb:, mysql:, pcre:, pgsql:, sdbm:, and sqlite: database clients. -Dynamic loading is useful when you distribute or install pre-compiled -Postfix packages.
+of Postfix database clients (database plugins) with the Debian-style +dynamicmaps feature. Postfix 2.12 supports dynamic loading of cdb:, +ldap:, lmdb:, mysql:, pcre:, pgsql:, sdbm:, and sqlite: database +clients. Dynamic loading is useful when you distribute or install +pre-compiled Postfix packages.Specify "dynamicmaps=yes" on the "make makefiles" command line to build Postfix with support to dynamically load Postfix database -clients (database plugins) with the Debian-style dynamicmaps feature. +clients with the Debian-style dynamicmaps feature.
-$ make makefiles dynamicmaps=yes ...other arguments... -$ make makefiles dynamicmaps=no ...other arguments... $ make
This implicitly enables shared-library support, and defaults -to installing dynamicmaps.cf and database plugins in /usr/libexec/postfix. -Database plugins are typically named postfix-type.so.version -where the type is a database type such as "cdb" or "ldap", -and where the version is the same as for Postfix shared -libraries. The installed dynamicmaps.cf configuration file is given -a suffix with the same version.
+(Specify "make makefiles dynamicmaps=no" to explicitly disable +Postfix database-plugin support).
+ +This implicitly enables shared-library support, installs the +configuration file dynamicmaps.cf in $meta_directory (usually, +/etc/postfix or /usr/local/etc/postfix), and installs database +plugins in $shlib_directory (see above). Database plugins are named +postfix-type.so where the type is a database type +such as "cdb" or "ldap".
@@ -322,60 +345,155 @@ database client loading was meant to avoid.-
To override the default location or shared-library version, -specify, for example:
+See the next section for how to customize the location and +version of Postfix database plugins and the location of the file +dynamicmaps.cf.
+ +As a reminder, the directories with Postfix shared libraries +or database plugins should contain only Postfix-related files. +Linking these files into other programs is not supported.
+ +To override the default location of Postfix shared libraries +and database plugins specify, for example:
--% make makefiles dynamicmaps=yes plugin_directory=/usr/lib/postfix \ - SHLIB_VERSION=1 ... +$ make makefiles shared=yes shlib_directory=/usr/local/lib/postfix ...
You can also override the plugin_directory setting after Postfix -is built, with "make install" or "make upgrade". In this case, there -is no need to run the ldconfig command.
+If you intend to upgrade Postfix without stopping the mail +system, then you should append the Postfix release version to the +shlib_directory pathname, to eliminate the possibility that programs +from the old Postfix version will link with files from the new +Postfix version. For example:
-Tips for distribution maintainers: +
++ ++$ make makefiles shared=yes \ + shlib_directory=/usr/local/lib/postfix/MAIL_VERSION ... ++
The command "make makefiles name=value..." will replace the +string MAIL_VERSION in a configuration parameter value with the +Postfix release version. Do not try to specify something like +$mail_version on this command line. This produces inconsistent +results with different versions of the make(1) command.
+ +You can change the shlib_directory setting after Postfix is +built, with "make install" or "make upgrade". However, you may have +to run ldconfig if you change shlib_directory after Postfix is built +(the symptom is that Postfix programs fail because the run-time +linker cannot find the files libpostfix-*.so). No ldconfig command +is needed if you keep the files libpostfix-*.so in the compiled-in +default $shlib_directory location.
+ +++ ++# make upgrade shlib_directory=/usr/local/lib/postfix ... +# make install shlib_directory=/usr/local/lib/postfix ... ++
To append the Postfix release version to the pathname if you +intend to upgrade Postfix without stopping the mail system:
+ +++ ++# make upgrade shlib_directory=/usr/local/lib/postfix/MAIL_VERSION ... +# make install shlib_directory=/usr/local/lib/postfix/MAIL_VERSION ... ++
See also the comments above for appending MAIL_VERSION with +the "make makefiles" command.
+ +The meta_directory parameter has the same default setting as +the config_directory parameter, typically /etc/postfix or +/usr/local/etc/postfix.
+ +You can override the default meta_directory location at compile +time or after Postfix is built. To override the default location +at compile time specify, for example:
+ +++ ++% make makefiles meta_directory=/usr/libexec/postfix ... ++
Here is a tip if you want to make a pathname dependent on the +Postfix release version: the command "make makefiles name=value..." +will replace the string MAIL_VERSION in a configuration parameter +value with the Postfix release version. Do not try to specify +something like $mail_version on this command line. This produces +inconsistent results with different versions of the make(1) command. +
+ +You can override the meta_directory setting after Postfix is +built, with "make install" or "make upgrade".
+ +++ ++# make upgrade meta_directory=/usr/libexec/postfix ... +# make install meta_directory=/usr/libexec/postfix ... ++
As with the command "make makefiles, the command "make +install/upgrade name=value..." will replace the string MAIL_VERSION +in a configuration parameter value with the Postfix release version. +Do not try to specify something like $mail_version on this command +line. This produces inconsistent results with different versions +of the make(1) command.
+ +The postfix-install procedure creates a compatibility -symlink dynamicmaps.cf -> dynamicmaps.cf.version (as well -as a symlink dynamicmaps.cf.d -> dynamicmaps.cf.version.d; -more on that below). It is therefore safe to use "unversioned" -configuration file names when installing or deinstalling a database -plugin. However, Postfix itself will use the "versioned" names, to -allow minor upgrades to happen without having to stop Postfix.
+The shlib_directory parameter setting also provides the +default directory for database plugin files with a relative pathname +in the file dynamicmaps.cf.
-The configuration file dynamicmaps.cf.version will -automatically include files under the directory -dynamicmaps.cf.d.version, just like the configuration file -postfix-files will automatically include files under the directory -postfix-files.d. Thanks to this, you don't have to edit postfix-files -or dynamicmaps.cf, when installing or deinstalling a database plugin -package. Instead, each plugin can have its own configuration file. -
+The meta_directory parameter specifies the location of the +files dynamicmaps.cf, postfix-files, and some multi-instance template +files. The meta_directory parameter has the same default value as +the config_directory parameter (typically, /etc/postfix or +/usr/local/etc/postfix). For backwards compatibility with Postfix +2.6 .. 2.11, specify "meta_directory = $daemon_directory" in main.cf +before installing or upgrading Postfix, or specify "meta_directory += /path/name" on the "make makefiles", "make install" or "make +upgrade" command line.
-The plugin_directory setting provides the default directory -for shared-library objects with a relative pathname in the file -dynamicmaps.cf.version. +
The configuration file dynamicmaps.cf will automatically +include files under the directory dynamicmaps.cf.d, just like the +configuration file postfix-files will automatically include files +under the directory postfix-files.d. Thanks to this, you can install +or deinstall a database plugin package without having to edit +postfix-files or dynamicmaps.cf. Instead, you give that plugin its +own configuration files dynamicmaps.cf.d and postfix-files.d, and +you add or remove those configuration files along with the database +plugin shared object.
-Each configuration file under the directory -dynamicmaps.cf.d.version must have a name that ends in ".cf" -and must have the same format as the file dynamicmaps.cf.version. -
- -The directory dynamicmaps.cf.d.version is the default -directory for shared-library objects with a relative pathname in -the files dynamicmaps.cf.d.version/*.cf. Thus, the directory -dynamicmaps.cf.d.version may contain both configuration files -and shared-library object files. Hence, the requirement that -configuration file names must end in ".cf".
+Each configuration file under the directory dynamicmaps.cf.d +must have the same format as the configuration file dynamicmaps.cf. +There is no requirement that these configuration file *names* have a +specific format.
Each configuration file under the directory postfix-files.d must have the same format as the configuration file postfix-files. -There is no requirement that these configuration file names have a +There is no requirement that these configuration file *names* have a specific format.
The command "make makefiles name=value ..." will replace the +string MAIL_VERSION in a configuration parameter value with the +Postfix release version. Do not try to specify something like +$mail_version on this command line. This produces inconsistent +results with different versions of the make(1) command.
+Parameters whose defaults can be specified in this way are listed below. See the postconf(5) manpage for a description (command: "nroff -man man/man5/postconf.5 | less").
@@ -471,9 +595,9 @@ listed below. See the postconf(5) manpage for a deIf you specify name=value arguments on the "make install" +or "make upgrade" command line, then these will take precedence +over compiled-in default settings or main.cf settings.
+ +The command "make install/upgrade name=value ..." will replace +the string MAIL_VERSION in a configuration parameter value with the +Postfix release version. Do not try to specify something like +$mail_version on this command line. This produces inconsistent +results with different versions of the make(1) command.
+With Postfix 2.12 and later, the command "make package name=value +..." will replace the string MAIL_VERSION in a configuration parameter +value with the Postfix release version. Do not try to specify +something like $mail_version on this command line. This produces +inconsistent results with different versions of the make(1) command. +
+When building an archive for distribution, be sure to diff --git a/postfix/html/postconf.5.html b/postfix/html/postconf.5.html index 9ebfa0ffa..5c3873c3c 100644 --- a/postfix/html/postconf.5.html +++ b/postfix/html/postconf.5.html @@ -6198,6 +6198,27 @@ and body_checks.
This feature is available in Postfix 2.3 and later.
+ + +The location of non-executable files that are shared among +multiple Postfix instances, such as postfix-files, dynamicmaps.cf, +and the multi-instance template files main.cf.proto and master.cf.proto. +This directory should contain only Postfix-related files. Typically, +the meta_directory parameter has the same default as the config_directory +parameter (/etc/postfix or /usr/local/etc/postfix).
+ +For backwards compatibility with Postfix versions 2.6..2.11, +specify "meta_directory = $daemon_directory" in main.cf before +installing or upgrading Postfix, or specify "meta_directory = +/path/name" on the "make makefiles", "make install" or "make upgrade" +command line.
+ +This feature is available in Postfix 2.12 and later.
+ +This feature is available in Postfix 2.3 and later.
- - -The location of the Postfix dynamicmaps.cf database plugin -configuration file, and of database plugins with a relative pathname. -This is set to "no" when Postfix database plugin support is disabled -at compile time.
- -This feature is available in Postfix 2.12 and later.
- -The location of Postfix shared libraries (libpostfix-*.so.*). -This parameter defaults to "no" when Postfix shared libraries are -disabled at compile time.
+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. The +shlib_directory parameter defaults to "no" when Postfix shared +libraries and database plugins are disabled at compile time, otherwise +it typically defaults to /usr/lib/postfix or /usr/local/lib/postfix. +
-NOTE: You can change the location of these files after Postfix -is built. However, you may have to run ldconfig if you move the -libpostfix-*.so.* files to a non-system directory. No ldconfig is -needed if you keep the libpostfix-*.so.* files in the compiled-in -default $shlib_directory location.
+Notes:
+ +The directory specified with shlib_directory should contain +only Postfix-related files. Postfix shared libraries and database +plugins should not be installed in a "public" system directory such +as /usr/lib or /usr/local/lib. Linking Postfix shared-library files +or database plugins into non-Postfix programs is not supported. +Postfix shared libraries and database plugins implement a +Postfix-internal API that changes without maintaining compatibility. +
+ +You can change the shlib_directory value after Postfix is +built. However, you may have to run ldconfig or equivalent to prevent +Postfix programs from failing because the libpostfix-*.so files are +not found. No ldconfig command is needed if you keep the libpostfix-*.so +files in the compiled-in default $shlib_directory location.
+ +This feature is available in Postfix 2.12 and later.
@@ -13002,6 +13029,14 @@ Postfix version 2.5). This feature is available with Postfix version parent domains, client IP address, or networks obtained by stripping least significant octets. See the access(5) manual page for details.Overview of topics:
+ +Note: directories with Postfix shared libraries or database +plugins should contain only postfix-related files. Postfix shared +libraries and database plugins should not be installed in a "public" +system directory such as /usr/lib or /usr/local/lib. Linking Postfix +shared-library or database-plugin files into non-Postfix programs +is not supported. Postfix shared libraries and database plugins +implement a Postfix-internal API that changes without maintaining +compatibility.
+ +Postfix can be built with Postfix shared libraries (files -typically named libpostfix-*.so.*). Postfix shared libraries +typically named libpostfix-*.so). Postfix shared libraries add minor run-time overhead and result in significantly-smaller Postfix executable files.
@@ -247,63 +276,57 @@ build Postfix with shared-library support.-$ make makefiles shared=yes ...other arguments... -$ make makefiles shared=no ...other arguments... $ make
This defaults to installing shared libraries in /usr/local/lib, -typically with names like libpostfix-name.so.version, -where the name is a source-code directory name such as "util" -or "global", and the version is the Postfix version: -x.y.z for stable releases, x.y-date for snapshot -(development) releases, or x.y-date-nonprod for -non-production releases.
+(Specify "make makefiles shared=no" to explicitly disable Postfix +shared-library support).
-To override the default location or shared-library version, -specify, for example:
+This installs shared libraries in $shlib_directory, typically, +/usr/lib/postfix/version or /usr/local/lib/postfix/version, +with names like 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.
--+-$ make makefiles shared=yes shlib_directory=/usr/lib \ - SHLIB_VERSION=1 ...other arguments... --
See section 4.3.3 "Customizing Postfix shared libraries and +database plugins" below for how to customize the Postfix shared-library +location and version. -
You can change the shlib_directory setting after Postfix is -built, with "make install" or "make upgrade". However, you may have -to run ldconfig if you change shlib_directory after Postfix is built -and install the libpostfix-*.so.* files in a non-system directory. -No ldconfig is needed if you keep the libpostfix-*.so.* files in -the compiled-in default $shlib_directory location.
+Additionally, Postfix can be built to support dynamic loading -of Postfix database clients with the Debian-style dynamicmaps -feature. Postfix 2.12 supports dynamic loading of cdb:, ldap:, -lmdb:, mysql:, pcre:, pgsql:, sdbm:, and sqlite: database clients. -Dynamic loading is useful when you distribute or install pre-compiled -Postfix packages.
+of Postfix database clients (database plugins) with the Debian-style +dynamicmaps feature. Postfix 2.12 supports dynamic loading of cdb:, +ldap:, lmdb:, mysql:, pcre:, pgsql:, sdbm:, and sqlite: database +clients. Dynamic loading is useful when you distribute or install +pre-compiled Postfix packages.Specify "dynamicmaps=yes" on the "make makefiles" command line to build Postfix with support to dynamically load Postfix database -clients (database plugins) with the Debian-style dynamicmaps feature. +clients with the Debian-style dynamicmaps feature.
-$ make makefiles dynamicmaps=yes ...other arguments... -$ make makefiles dynamicmaps=no ...other arguments... $ make
This implicitly enables shared-library support, and defaults -to installing dynamicmaps.cf and database plugins in /usr/libexec/postfix. -Database plugins are typically named postfix-type.so.version -where the type is a database type such as "cdb" or "ldap", -and where the version is the same as for Postfix shared -libraries. The installed dynamicmaps.cf configuration file is given -a suffix with the same version.
+(Specify "make makefiles dynamicmaps=no" to explicitly disable +Postfix database-plugin support).
+ +This implicitly enables shared-library support, installs the +configuration file dynamicmaps.cf in $meta_directory (usually, +/etc/postfix or /usr/local/etc/postfix), and installs database +plugins in $shlib_directory (see above). Database plugins are named +postfix-type.so where the type is a database type +such as "cdb" or "ldap".
@@ -322,60 +345,155 @@ database client loading was meant to avoid.-
To override the default location or shared-library version, -specify, for example:
+See the next section for how to customize the location and +version of Postfix database plugins and the location of the file +dynamicmaps.cf.
+ +As a reminder, the directories with Postfix shared libraries +or database plugins should contain only Postfix-related files. +Linking these files into other programs is not supported.
+ +To override the default location of Postfix shared libraries +and database plugins specify, for example:
--% make makefiles dynamicmaps=yes plugin_directory=/usr/lib/postfix \ - SHLIB_VERSION=1 ... +$ make makefiles shared=yes shlib_directory=/usr/local/lib/postfix ...
You can also override the plugin_directory setting after Postfix -is built, with "make install" or "make upgrade". In this case, there -is no need to run the ldconfig command.
+If you intend to upgrade Postfix without stopping the mail +system, then you should append the Postfix release version to the +shlib_directory pathname, to eliminate the possibility that programs +from the old Postfix version will link with files from the new +Postfix version. For example:
-Tips for distribution maintainers: +
++ ++$ make makefiles shared=yes \ + shlib_directory=/usr/local/lib/postfix/MAIL_VERSION ... ++
The command "make makefiles name=value..." will replace the +string MAIL_VERSION in a configuration parameter value with the +Postfix release version. Do not try to specify something like +$mail_version on this command line. This produces inconsistent +results with different versions of the make(1) command.
+ +You can change the shlib_directory setting after Postfix is +built, with "make install" or "make upgrade". However, you may have +to run ldconfig if you change shlib_directory after Postfix is built +(the symptom is that Postfix programs fail because the run-time +linker cannot find the files libpostfix-*.so). No ldconfig command +is needed if you keep the files libpostfix-*.so in the compiled-in +default $shlib_directory location.
+ +++ ++# make upgrade shlib_directory=/usr/local/lib/postfix ... +# make install shlib_directory=/usr/local/lib/postfix ... ++
To append the Postfix release version to the pathname if you +intend to upgrade Postfix without stopping the mail system:
+ +++ ++# make upgrade shlib_directory=/usr/local/lib/postfix/MAIL_VERSION ... +# make install shlib_directory=/usr/local/lib/postfix/MAIL_VERSION ... ++
See also the comments above for appending MAIL_VERSION with +the "make makefiles" command.
+ +The meta_directory parameter has the same default setting as +the config_directory parameter, typically /etc/postfix or +/usr/local/etc/postfix.
+ +You can override the default meta_directory location at compile +time or after Postfix is built. To override the default location +at compile time specify, for example:
+ +++ ++% make makefiles meta_directory=/usr/libexec/postfix ... ++
Here is a tip if you want to make a pathname dependent on the +Postfix release version: the command "make makefiles name=value..." +will replace the string MAIL_VERSION in a configuration parameter +value with the Postfix release version. Do not try to specify +something like $mail_version on this command line. This produces +inconsistent results with different versions of the make(1) command. +
+ +You can override the meta_directory setting after Postfix is +built, with "make install" or "make upgrade".
+ +++ ++# make upgrade meta_directory=/usr/libexec/postfix ... +# make install meta_directory=/usr/libexec/postfix ... ++
As with the command "make makefiles, the command "make +install/upgrade name=value..." will replace the string MAIL_VERSION +in a configuration parameter value with the Postfix release version. +Do not try to specify something like $mail_version on this command +line. This produces inconsistent results with different versions +of the make(1) command.
+ +The postfix-install procedure creates a compatibility -symlink dynamicmaps.cf -> dynamicmaps.cf.version (as well -as a symlink dynamicmaps.cf.d -> dynamicmaps.cf.version.d; -more on that below). It is therefore safe to use "unversioned" -configuration file names when installing or deinstalling a database -plugin. However, Postfix itself will use the "versioned" names, to -allow minor upgrades to happen without having to stop Postfix.
+The shlib_directory parameter setting also provides the +default directory for database plugin files with a relative pathname +in the file dynamicmaps.cf.
-The configuration file dynamicmaps.cf.version will -automatically include files under the directory -dynamicmaps.cf.d.version, just like the configuration file -postfix-files will automatically include files under the directory -postfix-files.d. Thanks to this, you don't have to edit postfix-files -or dynamicmaps.cf, when installing or deinstalling a database plugin -package. Instead, each plugin can have its own configuration file. -
+The meta_directory parameter specifies the location of the +files dynamicmaps.cf, postfix-files, and some multi-instance template +files. The meta_directory parameter has the same default value as +the config_directory parameter (typically, /etc/postfix or +/usr/local/etc/postfix). For backwards compatibility with Postfix +2.6 .. 2.11, specify "meta_directory = $daemon_directory" in main.cf +before installing or upgrading Postfix, or specify "meta_directory += /path/name" on the "make makefiles", "make install" or "make +upgrade" command line.
-The plugin_directory setting provides the default directory -for shared-library objects with a relative pathname in the file -dynamicmaps.cf.version. +
The configuration file dynamicmaps.cf will automatically +include files under the directory dynamicmaps.cf.d, just like the +configuration file postfix-files will automatically include files +under the directory postfix-files.d. Thanks to this, you can install +or deinstall a database plugin package without having to edit +postfix-files or dynamicmaps.cf. Instead, you give that plugin its +own configuration files dynamicmaps.cf.d and postfix-files.d, and +you add or remove those configuration files along with the database +plugin shared object.
-Each configuration file under the directory -dynamicmaps.cf.d.version must have a name that ends in ".cf" -and must have the same format as the file dynamicmaps.cf.version. -
- -The directory dynamicmaps.cf.d.version is the default -directory for shared-library objects with a relative pathname in -the files dynamicmaps.cf.d.version/*.cf. Thus, the directory -dynamicmaps.cf.d.version may contain both configuration files -and shared-library object files. Hence, the requirement that -configuration file names must end in ".cf".
+Each configuration file under the directory dynamicmaps.cf.d +must have the same format as the configuration file dynamicmaps.cf. +There is no requirement that these configuration file *names* have a +specific format.
Each configuration file under the directory postfix-files.d must have the same format as the configuration file postfix-files. -There is no requirement that these configuration file names have a +There is no requirement that these configuration file *names* have a specific format.
The command "make makefiles name=value ..." will replace the +string MAIL_VERSION in a configuration parameter value with the +Postfix release version. Do not try to specify something like +$mail_version on this command line. This produces inconsistent +results with different versions of the make(1) command.
+Parameters whose defaults can be specified in this way are listed below. See the postconf(5) manpage for a description (command: "nroff -man man/man5/postconf.5 | less").
@@ -471,9 +595,9 @@ listed below. See the postconf(5) manpage for a descriptionIf you specify name=value arguments on the "make install" +or "make upgrade" command line, then these will take precedence +over compiled-in default settings or main.cf settings.
+ +The command "make install/upgrade name=value ..." will replace +the string MAIL_VERSION in a configuration parameter value with the +Postfix release version. Do not try to specify something like +$mail_version on this command line. This produces inconsistent +results with different versions of the make(1) command.
+With Postfix 2.12 and later, the command "make package name=value +..." will replace the string MAIL_VERSION in a configuration parameter +value with the Postfix release version. Do not try to specify +something like $mail_version on this command line. This produces +inconsistent results with different versions of the make(1) command. +
+ When building an archive for distribution, be sure to
diff --git a/postfix/proto/postconf.proto b/postfix/proto/postconf.proto
index 79e9581f0..2af63381b 100644
--- a/postfix/proto/postconf.proto
+++ b/postfix/proto/postconf.proto
@@ -4982,6 +4982,14 @@ Postfix version 2.5). This feature is available with Postfix version
parent domains, client IP address, or networks obtained by stripping
least significant octets. See the access(5) manual page for details.
+
The location of Postfix shared libraries (libpostfix-*.so.*). -This parameter defaults to "no" when Postfix shared libraries are -disabled at compile time.
+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. The +shlib_directory parameter defaults to "no" when Postfix shared +libraries and database plugins are disabled at compile time, otherwise +it typically defaults to /usr/lib/postfix or /usr/local/lib/postfix. +
-NOTE: You can change the location of these files after Postfix -is built. However, you may have to run ldconfig if you move the -libpostfix-*.so.* files to a non-system directory. No ldconfig is -needed if you keep the libpostfix-*.so.* files in the compiled-in -default $shlib_directory location.
+Notes:
+ +The directory specified with shlib_directory should contain +only Postfix-related files. Postfix shared libraries and database +plugins should not be installed in a "public" system directory such +as /usr/lib or /usr/local/lib. Linking Postfix shared-library files +or database plugins into non-Postfix programs is not supported. +Postfix shared libraries and database plugins implement a +Postfix-internal API that changes without maintaining compatibility. +
+ +You can change the shlib_directory value after Postfix is +built. However, you may have to run ldconfig or equivalent to prevent +Postfix programs from failing because the libpostfix-*.so files are +not found. No ldconfig command is needed if you keep the libpostfix-*.so +files in the compiled-in default $shlib_directory location.
+ +This feature is available in Postfix 2.12 and later.
-%PARAM plugin_directory see 'postconf -d' output +%PARAM meta_directory see 'postconf -d' output -The location of the Postfix dynamicmaps.cf database plugin -configuration file, and of database plugins with a relative pathname. -This is set to "no" when Postfix database plugin support is disabled -at compile time.
+The location of non-executable files that are shared among +multiple Postfix instances, such as postfix-files, dynamicmaps.cf, +and the multi-instance template files main.cf.proto and master.cf.proto. +This directory should contain only Postfix-related files. Typically, +the meta_directory parameter has the same default as the config_directory +parameter (/etc/postfix or /usr/local/etc/postfix).
+ +For backwards compatibility with Postfix versions 2.6..2.11, +specify "meta_directory = $daemon_directory" in main.cf before +installing or upgrading Postfix, or specify "meta_directory = +/path/name" on the "make makefiles", "make install" or "make upgrade" +command line.
This feature is available in Postfix 2.12 and later.
diff --git a/postfix/src/global/Makefile.in b/postfix/src/global/Makefile.in index 16e62a6a5..9bbbdb514 100644 --- a/postfix/src/global/Makefile.in +++ b/postfix/src/global/Makefile.in @@ -118,7 +118,6 @@ TESTPROG= domain_list dot_lockfile mail_addr_crunch mail_addr_find \ LIBS = ../../lib/lib$(LIB_PREFIX)util$(LIB_SUFFIX) LIB_DIR = ../../lib INC_DIR = ../../include -PLG_DIR= ../../plugins PLUGIN_MAP_SO = $(LIB_PREFIX)ldap$(LIB_SUFFIX) $(LIB_PREFIX)mysql$(LIB_SUFFIX) \ $(LIB_PREFIX)pgsql$(LIB_SUFFIX) $(LIB_PREFIX)sqlite$(LIB_SUFFIX) \ $(LIB_PREFIX)lmdb$(LIB_SUFFIX) $(LIB_PREFIX)cdb$(LIB_SUFFIX) \ @@ -182,11 +181,11 @@ plugin_map_so_update: $(PLUGIN_MAP_SO) do \ for type in $(DEFINED_MAP_TYPES); do \ case $$i in $(LIB_PREFIX)$$type$(LIB_SUFFIX)) \ - cmp -s $$i $(PLG_DIR)/$$i 2>/dev/null || cp $$i $(PLG_DIR); \ + cmp -s $$i $(LIB_DIR)/$$i 2>/dev/null || cp $$i $(LIB_DIR); \ continue 2;; \ esac; \ done; \ - rm -f $(PLG_DIR)/$$i; \ + rm -f $(LIB_DIR)/$$i; \ done dot_lockfile: $(LIB) $(LIBS) diff --git a/postfix/src/global/dynamicmaps.c b/postfix/src/global/dynamicmaps.c index 544661620..358aa6077 100644 --- a/postfix/src/global/dynamicmaps.c +++ b/postfix/src/global/dynamicmaps.c @@ -6,7 +6,7 @@ /* SYNOPSIS /* #include