From: Wietse Z Venema
Note: Berkeley DB version 4 is not supported by Postfix versions -before 2.0.
-This document describes:
+% make makefiles CCARGS="-DHAS_DB -I/usr/local/BerkeleyDB/include" \ - AUXLIBS="-L/usr/local/BerkeleyDB/lib -ldb" + AUXLIBS_DB="-L/usr/local/BerkeleyDB/lib -ldb" % make
Note: Postfix version 3.12 and later use AUXLIBS_DB. With earlier +versions, use AUXLIBS instead.
+If your Berkeley DB shared library is in a directory that the RUN-TIME linker does not know about, add a "-Wl,-R,/path/to/directory" option after "-ldb".
@@ -110,11 +110,14 @@ linker does not know about, add a "-Wl,-R,/path/to/directory" option after+% make makefiles CCARGS="-DHAS_DB -I/usr/local/BerkeleyDB/include" \ - AUXLIBS="-R/usr/local/BerkeleyDB/lib -L/usr/local/BerkeleyDB/lib -ldb" + AUXLIBS_DB="-R/usr/local/BerkeleyDB/lib -L/usr/local/BerkeleyDB/lib -ldb" % make
Note: Postfix version 3.12 and later use AUXLIBS_DB. With earlier +versions, use AUXLIBS instead.
+The exact pathnames depend on the Berkeley DB version, and on how it was installed.
@@ -143,11 +146,14 @@ use a variant of the following commands:+-% make makefiles CCARGS=-I/usr/include/db3 AUXLIBS=-ldb3 +% make makefiles CCARGS=-I/usr/include/db3 AUXLIBS_DB=-ldb3 % make
Note: Postfix version 3.12 and later use AUXLIBS_DB. With earlier +versions, use AUXLIBS instead.
+Warning: the file format produced by Berkeley DB version 1 is not compatible with that of versions 2 and 3 (versions 2 and 3 have the same format). If you switch between DB versions, then you may @@ -235,10 +241,13 @@ undefined reference to `pthread_mutex_trylock'
+-% make makefiles .... AUXLIBS="... -lpthread" +% make makefiles .... AUXLIBS_DB="... -lpthread"
Note: Postfix version 3.12 and later use AUXLIBS_DB. With earlier +versions, use AUXLIBS instead.
+More information is available at https://www.oracle.com/database/technologies/related/berkeleydb.html.
diff --git a/postfix/html/postalias.1.html b/postfix/html/postalias.1.html index 20799a080..5c4e311e1 100644 --- a/postfix/html/postalias.1.html +++ b/postfix/html/postalias.1.html @@ -38,7 +38,7 @@ POSTALIAS(1) POSTALIAS(1) substitutions. In a database file, postalias(1) stores keys in the external (quoted) - form. Historically, Postfix versions 3.10 and earlier stored the inter- + form. Historically, Postfix versions 3.11 and earlier store the inter- nal (unquoted) form. This was not consistent with postmap(1) behavior. For backwards compatibility, Postfix programs will search with the legacy internal form only if the preferred external form is not found, diff --git a/postfix/makedefs b/postfix/makedefs index 2b9242d44..96f22ccef 100644 --- a/postfix/makedefs +++ b/postfix/makedefs @@ -646,7 +646,9 @@ EOF SYSTYPE=LINUX$RELEASE_MAJOR case "$CCARGS" in *-DNO_DB*) ;; - *-DHAS_DB*) ;; + *-DHAS_DB*) case "$AUXLIBS_DB" in + "") AUXLIBS_DB=-ldb;; + esac;; *) if [ -f /usr/include/db.h ] then : we are all set @@ -662,7 +664,7 @@ EOF echo "See: https://www.postfix.org/NON_BERKELEYDB_README.html#build-conf" 1>&2 exit 1 fi - SYSLIBS="-ldb" + AUXLIBS_DB="-ldb" ;; esac for name in nsl resolv @@ -701,7 +703,7 @@ EOF echo "Alternatively, build with CCARGS=\"-NO_DB ...\"" 1>&2 exit 1 fi - SYSLIBS="-ldb" + AUXLIBS_DB="-ldb" ;; esac for name in nsl resolv @@ -745,14 +747,14 @@ HP-UX.B.10.*) SYSTYPE=HPUX10 CCARGS="$CCARGS -DNO_SNPRINTF" if [ -f /usr/lib/libdb.a ]; then CCARGS="$CCARGS -DHAS_DB" - SYSLIBS=-ldb + AUXLIBS_DB=-ldb fi ;; HP-UX.B.11.*) SYSTYPE=HPUX11 SYSLIBS=-lnsl if [ -f /usr/lib/libdb.a ]; then CCARGS="$CCARGS -DHAS_DB" - SYSLIBS="$SYSLIBS -ldb" + AUXLIBS_DB="-ldb" fi ;; ReliantUNIX-?.5.43) SYSTYPE=ReliantUnix543 @@ -1262,8 +1264,26 @@ ${WARN='-Wall -Wno-comment -Wformat -Wimplicit -Wmissing-prototypes \ # and we don't try to figure out which awk versions have tolower(). # The following was validated in 2014 on FreeBSD/Linux and Solaris 9. +# But first, find out if sys_defs.h may contain '#define HAS_DB'. +# Historically, this was how Postfix builds "knew" BDB was supported. +trap 'rm -f makedefs.test makedefs.test.[co]' 0 1 2 3 15 + cat >makedefs.test.c <<'EOF' +#include "src/util/sys_defs.h" +#includeNote: Berkeley DB version 4 is not supported by Postfix versions -before 2.0.
-This document describes:
+% make makefiles CCARGS="-DHAS_DB -I/usr/local/BerkeleyDB/include" \ - AUXLIBS="-L/usr/local/BerkeleyDB/lib -ldb" + AUXLIBS_DB="-L/usr/local/BerkeleyDB/lib -ldb" % make
Note: Postfix version 3.12 and later use AUXLIBS_DB. With earlier +versions, use AUXLIBS instead.
+If your Berkeley DB shared library is in a directory that the RUN-TIME linker does not know about, add a "-Wl,-R,/path/to/directory" option after "-ldb".
@@ -110,11 +110,14 @@ linker does not know about, add a "-Wl,-R,/path/to/directory" option after+% make makefiles CCARGS="-DHAS_DB -I/usr/local/BerkeleyDB/include" \ - AUXLIBS="-R/usr/local/BerkeleyDB/lib -L/usr/local/BerkeleyDB/lib -ldb" + AUXLIBS_DB="-R/usr/local/BerkeleyDB/lib -L/usr/local/BerkeleyDB/lib -ldb" % make
Note: Postfix version 3.12 and later use AUXLIBS_DB. With earlier +versions, use AUXLIBS instead.
+The exact pathnames depend on the Berkeley DB version, and on how it was installed.
@@ -143,11 +146,14 @@ use a variant of the following commands:+-% make makefiles CCARGS=-I/usr/include/db3 AUXLIBS=-ldb3 +% make makefiles CCARGS=-I/usr/include/db3 AUXLIBS_DB=-ldb3 % make
Note: Postfix version 3.12 and later use AUXLIBS_DB. With earlier +versions, use AUXLIBS instead.
+Warning: the file format produced by Berkeley DB version 1 is not compatible with that of versions 2 and 3 (versions 2 and 3 have the same format). If you switch between DB versions, then you may @@ -235,10 +241,13 @@ undefined reference to `pthread_mutex_trylock'
+-% make makefiles .... AUXLIBS="... -lpthread" +% make makefiles .... AUXLIBS_DB="... -lpthread"
Note: Postfix version 3.12 and later use AUXLIBS_DB. With earlier +versions, use AUXLIBS instead.
+More information is available at https://www.oracle.com/database/technologies/related/berkeleydb.html.
diff --git a/postfix/src/global/mail_params.c b/postfix/src/global/mail_params.c index f715124aa..d7079dd2a 100644 --- a/postfix/src/global/mail_params.c +++ b/postfix/src/global/mail_params.c @@ -797,7 +797,6 @@ void mail_params_init() VAR_POSTLOG_SERVICE, DEF_POSTLOG_SERVICE, &var_postlog_service, 1, 0, VAR_DNSSEC_PROBE, DEF_DNSSEC_PROBE, &var_dnssec_probe, 0, 0, VAR_KNOWN_TCP_PORTS, DEF_KNOWN_TCP_PORTS, &var_known_tcp_ports, 0, 0, - VAR_SERVNAME, DEF_SERVNAME, &var_servname, 0, 0, 0, }; static const CONFIG_BOOL_TABLE first_bool_defaults[] = { diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index 5fa1d0ffb..a1393289d 100644 --- a/postfix/src/global/mail_version.h +++ b/postfix/src/global/mail_version.h @@ -20,7 +20,7 @@ * Patches change both the patchlevel and the release date. Snapshots have no * patchlevel; they change the release date only. */ -#define MAIL_RELEASE_DATE "20260312" +#define MAIL_RELEASE_DATE "20260316" #define MAIL_VERSION_NUMBER "3.12" #ifdef SNAPSHOT diff --git a/postfix/src/postalias/postalias.c b/postfix/src/postalias/postalias.c index eec322f4f..ccbd61aac 100644 --- a/postfix/src/postalias/postalias.c +++ b/postfix/src/postalias/postalias.c @@ -35,8 +35,8 @@ /* information with $\fInumber\fR substitutions. /* /* In a database file, \fBpostalias\fR(1) stores keys in the external -/* (quoted) form. Historically, Postfix versions 3.10 and earlier -/* stored the internal (unquoted) form. This was not consistent +/* (quoted) form. Historically, Postfix versions 3.11 and earlier +/* store the internal (unquoted) form. This was not consistent /* with \fBpostmap\fR(1) behavior. For backwards compatibility, /* Postfix programs will search with the legacy internal form only /* if the preferred external form is not found, and the internal diff --git a/postfix/src/postconf/postconf_builtin.c b/postfix/src/postconf/postconf_builtin.c index e0902862b..0a88bb8fa 100644 --- a/postfix/src/postconf/postconf_builtin.c +++ b/postfix/src/postconf/postconf_builtin.c @@ -466,7 +466,7 @@ void pcf_register_builtin_parameters(const char *procname, pid_t pid) PCF_PARAM_TABLE_ENTER(pcf_param_table, pcf_adhoc_procname.name, PCF_PARAM_FLAG_BUILTIN | PCF_PARAM_FLAG_READONLY, (void *) &pcf_adhoc_procname, pcf_conv_str_parameter); - pcf_adhoc_servname.defval = mystrdup(""); + pcf_adhoc_servname.defval = mystrdup(DEF_SERVNAME); PCF_PARAM_TABLE_ENTER(pcf_param_table, pcf_adhoc_servname.name, PCF_PARAM_FLAG_BUILTIN | PCF_PARAM_FLAG_READONLY, (void *) &pcf_adhoc_servname, pcf_conv_str_parameter); diff --git a/postfix/src/util/Makefile.in b/postfix/src/util/Makefile.in index 770dd7734..b7157beb2 100644 --- a/postfix/src/util/Makefile.in +++ b/postfix/src/util/Makefile.in @@ -53,7 +53,7 @@ OBJS = alldig.o allprint.o argv.o argv_split.o attr_clnt.o attr_print0.o \ attr_print64.o attr_print_plain.o attr_scan0.o attr_scan64.o \ attr_scan_plain.o auto_clnt.o base64_code.o basename.o binhash.o \ chroot_uid.o cidr_match.o clean_env.o close_on_exec.o concatenate.o \ - ctable.o dict.o dict_alloc.o dict_cidr.o dict_db.o \ + ctable.o dict.o dict_alloc.o dict_cidr.o \ dict_dbm.o dict_debug.o dict_env.o dict_ht.o dict_ni.o dict_nis.o \ dict_nisplus.o dict_open.o dict_regexp.o \ dict_static.o dict_tcp.o dict_unix.o dir_forest.o doze.o dummy_read.o \ @@ -93,7 +93,7 @@ OBJS = alldig.o allprint.o argv.o argv_split.o attr_clnt.o attr_print0.o \ split_qnameval.o argv_attr_print.o argv_attr_scan.o dict_file.o \ msg_logger.o logwriter.o unix_dgram_connect.o unix_dgram_listen.o \ byte_mask.o known_tcp_ports.o argv_split_at.o dict_stream.o \ - sane_strtol.o hash_fnv.o ldseed.o mkmap_db.o mkmap_dbm.o \ + sane_strtol.o hash_fnv.o ldseed.o mkmap_dbm.o \ mkmap_fail.o mkmap_open.o inet_prefix_top.o inet_addr_sizes.o \ quote_for_json.o mystrerror.o sane_sockaddr_to_hostaddr.o \ normalize_ws.o valid_uri_scheme.o clean_ascii_cntrl_space.o \ @@ -103,7 +103,7 @@ OBJS = alldig.o allprint.o argv.o argv_split.o attr_clnt.o attr_print0.o \ # When hard-linking these, makedefs sets NON_PLUGIN_MAP_OBJ=$(MAP_OBJ), # otherwise it sets the PLUGIN_* macros. MAP_OBJ = dict_pcre.o dict_cdb.o dict_lmdb.o dict_sdbm.o slmdb.o \ - mkmap_cdb.o mkmap_lmdb.o mkmap_sdbm.o + mkmap_cdb.o mkmap_lmdb.o mkmap_sdbm.o dict_db.o mkmap_db.o HDRS = argv.h attr.h attr_clnt.h auto_clnt.h base64_code.h binhash.h \ chroot_uid.h cidr_match.h clean_env.h connect.h ctable.h dict.h \ dict_cdb.h dict_cidr.h dict_db.h dict_dbm.h dict_debug.h dict_env.h \ @@ -160,7 +160,8 @@ TESTPROG= dict_open dup2_pass_on_exec events exec_command fifo_open \ normalize_v4mapped_addr_test ossl_digest_test dict_pipe_test \ dict_union_test PLUGIN_MAP_SO = $(LIB_PREFIX)pcre$(LIB_SUFFIX) $(LIB_PREFIX)lmdb$(LIB_SUFFIX) \ - $(LIB_PREFIX)cdb$(LIB_SUFFIX) $(LIB_PREFIX)sdbm$(LIB_SUFFIX) + $(LIB_PREFIX)cdb$(LIB_SUFFIX) $(LIB_PREFIX)sdbm$(LIB_SUFFIX) \ + $(LIB_PREFIX)db$(LIB_SUFFIX) HTABLE_FIX = NORANDOMIZE=1 LIB_DIR = ../../lib INC_DIR = ../../include @@ -203,6 +204,10 @@ $(LIB_PREFIX)sdbm$(LIB_SUFFIX): mkmap_sdbm.o dict_sdbm.o $(PLUGIN_LD) $(SHLIB_RPATH) -o $@ mkmap_sdbm.o \ dict_sdbm.o $(AUXLIBS_SDBM) +$(LIB_PREFIX)db$(LIB_SUFFIX): mkmap_db.o dict_db.o + $(PLUGIN_LD) $(SHLIB_RPATH) -o $@ mkmap_db.o \ + dict_db.o $(AUXLIBS_DB) + update: $(LIB_DIR)/$(LIB) $(HDRS) $(PLUGIN_MAP_SO_UPDATE) \ $(PLUGIN_MAP_OBJ_UPDATE) -for i in $(HDRS); \ diff --git a/postfix/src/util/dict_open.c b/postfix/src/util/dict_open.c index 05e4175c7..d7fab9141 100644 --- a/postfix/src/util/dict_open.c +++ b/postfix/src/util/dict_open.c @@ -397,10 +397,6 @@ static const DICT_OPEN_INFO dict_open_info[] = { #ifdef HAS_DBM DICT_TYPE_DBM, dict_dbm_open, mkmap_dbm_open, #endif -#ifdef HAS_DB - DICT_TYPE_HASH, dict_hash_open, mkmap_hash_open, - DICT_TYPE_BTREE, dict_btree_open, mkmap_btree_open, -#endif #ifdef HAS_NIS DICT_TYPE_NIS, dict_nis_open, 0, #endif @@ -423,6 +419,10 @@ static const DICT_OPEN_INFO dict_open_info[] = { DICT_TYPE_UNION, dict_union_open, 0, DICT_TYPE_INLINE, dict_inline_open, 0, #ifndef USE_DYNAMIC_MAPS +#ifdef HAS_DB + DICT_TYPE_HASH, dict_hash_open, mkmap_hash_open, + DICT_TYPE_BTREE, dict_btree_open, mkmap_btree_open, +#endif #ifdef HAS_PCRE DICT_TYPE_PCRE, dict_pcre_open, 0, #endif diff --git a/postfix/src/util/sys_defs.h b/postfix/src/util/sys_defs.h index 93a83b64d..e14b2ef8e 100644 --- a/postfix/src/util/sys_defs.h +++ b/postfix/src/util/sys_defs.h @@ -51,7 +51,7 @@ #define DEF_MAILBOX_LOCK "flock, dotlock" #define HAS_SUN_LEN #define HAS_FSYNC -#define HAS_DB +#define HAS_DB 1 #define HAS_SA_LEN #define NATIVE_DB_TYPE "hash" #if (defined(__NetBSD_Version__) && __NetBSD_Version__ >= 104250000) @@ -232,7 +232,7 @@ #define DEF_MAILBOX_LOCK "flock, dotlock" #define HAS_SUN_LEN #define HAS_FSYNC -#define HAS_DB +#define HAS_DB 1 #define HAS_SA_LEN #define NATIVE_DB_TYPE "hash" #define ALIAS_DB_MAP "$default_database_type:/etc/aliases" @@ -774,7 +774,7 @@ extern int initgroups(const char *, int); #define INTERNAL_LOCK MYFLOCK_STYLE_FLOCK #define DEF_MAILBOX_LOCK "fcntl, dotlock" /* RedHat >= 4.x */ #define HAS_FSYNC -#define HAS_DB +#define HAS_DB 1 #define NATIVE_DB_TYPE "hash" #define ALIAS_DB_MAP "$default_database_type:/etc/aliases" #ifndef NO_NIS @@ -850,7 +850,7 @@ extern int initgroups(const char *, int); #define INTERNAL_LOCK MYFLOCK_STYLE_FLOCK #define DEF_MAILBOX_LOCK "dotlock" /* verified RedHat 3.03 */ #define HAS_FSYNC -#define HAS_DB +#define HAS_DB 1 #define NATIVE_DB_TYPE "hash" #define ALIAS_DB_MAP "$default_database_type:/etc/aliases" #ifndef NO_NIS @@ -883,7 +883,7 @@ extern int initgroups(const char *, int); #define INTERNAL_LOCK MYFLOCK_STYLE_FCNTL #define DEF_MAILBOX_LOCK "fcntl, dotlock" /* RedHat >= 4.x */ #define HAS_FSYNC -#define HAS_DB +#define HAS_DB 1 #define NATIVE_DB_TYPE "hash" #define ALIAS_DB_MAP "$default_database_type:/etc/aliases" #ifndef NO_NIS