From d5d7245c6df11c9cd1842f8eae0a5caaedc288848910d7a4f7ef5377bc78cf6c Mon Sep 17 00:00:00 2001 From: Peter Varkoly Date: Mon, 4 Jan 2021 12:20:02 +0000 Subject: [PATCH] - Set default lmd to default db. Convert btree tables to lmdb too. This package is without bdb support. That's why convert must be done without any suse release condition. o remove patch postfix-no-btree.patch o add set-default-db-type.patch OBS-URL: https://build.opensuse.org/package/show/server:mail/postfix?expand=0&rev=398 --- convert-bdb-to-lmdb.sh | 3 ++ postfix-no-btree.patch | 20 --------- postfix.changes | 9 +++++ postfix.spec | 4 +- set-default-db-type.patch | 85 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 98 insertions(+), 23 deletions(-) delete mode 100644 postfix-no-btree.patch create mode 100644 set-default-db-type.patch diff --git a/convert-bdb-to-lmdb.sh b/convert-bdb-to-lmdb.sh index 94ccf76..7a10e16 100644 --- a/convert-bdb-to-lmdb.sh +++ b/convert-bdb-to-lmdb.sh @@ -2,6 +2,9 @@ if grep -q "hash:" /etc/postfix/{main.cf,master.cf}; then sed -i 's/hash:/lmdb:/g' /etc/postfix/{main.cf,master.cf} fi +if grep -q "btree:" /etc/postfix/{main.cf,master.cf}; then + sed -i 's/btree:/lmdb:/g' /etc/postfix/{main.cf,master.cf} +fi for i in $( find /etc/postfix/ -name "*.db" ) do mv $i $i-back diff --git a/postfix-no-btree.patch b/postfix-no-btree.patch deleted file mode 100644 index 8226776..0000000 --- a/postfix-no-btree.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- src/global/mail_params.h.orig 2020-05-09 17:51:27.000000000 +0200 -+++ src/global/mail_params.h 2020-12-25 21:04:11.428544623 +0100 -@@ -2826,7 +2826,7 @@ extern int var_vrfy_pend_limit; - extern char *var_verify_service; - - #define VAR_VERIFY_MAP "address_verify_map" --#define DEF_VERIFY_MAP "btree:$data_directory/verify_cache" -+#define DEF_VERIFY_MAP "lmdb:$data_directory/verify_cache" - extern char *var_verify_map; - - #define VAR_VERIFY_POS_EXP "address_verify_positive_expire_time" -@@ -3594,7 +3594,7 @@ extern char *var_multi_cntrl_cmds; - * postscreen(8) - */ - #define VAR_PSC_CACHE_MAP "postscreen_cache_map" --#define DEF_PSC_CACHE_MAP "btree:$data_directory/postscreen_cache" -+#define DEF_PSC_CACHE_MAP "lmdb:$data_directory/postscreen_cache" - extern char *var_psc_cache_map; - - #define VAR_SMTPD_SERVICE "smtpd_service_name" diff --git a/postfix.changes b/postfix.changes index 370bfdf..0ed888f 100644 --- a/postfix.changes +++ b/postfix.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Mon Jan 4 12:17:03 UTC 2021 - Peter Varkoly + +- Set default lmd to default db. Convert btree tables to lmdb too. + This package is without bdb support. That's why convert must be done + without any suse release condition. + o remove patch postfix-no-btree.patch + o add set-default-db-type.patch + ------------------------------------------------------------------- Fri Dec 25 20:32:04 UTC 2020 - Arjen de Korte diff --git a/postfix.spec b/postfix.spec index d6b3fb4..7626cb0 100644 --- a/postfix.spec +++ b/postfix.spec @@ -81,7 +81,7 @@ Patch7: %{name}-ssl-release-buffers.patch Patch8: %{name}-vda-v14-3.0.3.patch Patch9: fix-postfix-script.patch Patch10: %{name}-avoid-infinit-loop-if-no-permission.patch -Patch11: %{name}-no-btree.patch +Patch11: set-default-db-type.patch BuildRequires: ca-certificates BuildRequires: cyrus-sasl-devel #BuildRequires: db-devel @@ -496,10 +496,8 @@ if [ ${1:-0} -gt 1 ]; then if [ "$(%{_sbindir}/postconf -h daemon_directory)" != "%{pf_daemon_directory}" ]; then %{_sbindir}/postconf daemon_directory=%{pf_daemon_directory} fi -%if 0%{?suse_version} >= 1520 #Replace berkely db /usr/lib/postfix/bin/convert-bdb-to-lmdb.sh -%endif fi %service_add_post %{name}.service diff --git a/set-default-db-type.patch b/set-default-db-type.patch new file mode 100644 index 0000000..53cb724 --- /dev/null +++ b/set-default-db-type.patch @@ -0,0 +1,85 @@ +--- src/util/sys_defs.h.orig 2021-01-04 13:12:06.272285413 +0100 ++++ src/util/sys_defs.h 2021-01-04 13:12:38.412720371 +0100 +@@ -51,7 +51,7 @@ + #define HAS_FSYNC + #define HAS_DB + #define HAS_SA_LEN +-#define NATIVE_DB_TYPE "hash" ++#define NATIVE_DB_TYPE "lmdb" + #if (defined(__NetBSD_Version__) && __NetBSD_Version__ >= 104250000) + #define ALIAS_DB_MAP DEF_DB_TYPE ":/etc/mail/aliases" /* sendmail 8.10 */ + #endif +@@ -232,7 +232,7 @@ + #define HAS_FSYNC + #define HAS_DB + #define HAS_SA_LEN +-#define NATIVE_DB_TYPE "hash" ++#define NATIVE_DB_TYPE "lmdb" + #define ALIAS_DB_MAP DEF_DB_TYPE ":/etc/aliases" + #define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0) + #define ROOT_PATH "/bin:/usr/bin:/sbin:/usr/sbin" +@@ -289,7 +289,7 @@ + #define HAS_FSYNC + /* might be set by makedef */ + #ifdef HAS_DB +-#define NATIVE_DB_TYPE "hash" ++#define NATIVE_DB_TYPE "lmdb" + #define ALIAS_DB_MAP DEF_DB_TYPE ":/etc/aliases" + #else + #define HAS_DBM +@@ -761,7 +761,7 @@ + #define DEF_MAILBOX_LOCK "fcntl, dotlock" /* RedHat >= 4.x */ + #define HAS_FSYNC + #define HAS_DB +-#define NATIVE_DB_TYPE "hash" ++#define NATIVE_DB_TYPE "lmdb" + #define ALIAS_DB_MAP DEF_DB_TYPE ":/etc/aliases" + #ifndef NO_NIS + #define HAS_NIS +@@ -841,7 +841,7 @@ + #define DEF_MAILBOX_LOCK "dotlock" /* verified RedHat 3.03 */ + #define HAS_FSYNC + #define HAS_DB +-#define NATIVE_DB_TYPE "hash" ++#define NATIVE_DB_TYPE "lmdb" + #define ALIAS_DB_MAP DEF_DB_TYPE ":/etc/aliases" + #ifndef NO_NIS + #define HAS_NIS +@@ -874,7 +874,7 @@ + #define DEF_MAILBOX_LOCK "fcntl, dotlock" /* RedHat >= 4.x */ + #define HAS_FSYNC + #define HAS_DB +-#define NATIVE_DB_TYPE "hash" ++#define NATIVE_DB_TYPE "lmdb" + #define ALIAS_DB_MAP DEF_DB_TYPE ":/etc/aliases" + #ifndef NO_NIS + #define HAS_NIS +@@ -1199,7 +1199,7 @@ + #define INTERNAL_LOCK MYFLOCK_STYLE_FCNTL + #define DEF_MAILBOX_LOCK "fcntl, dotlock" + #define HAS_FSYNC +-#define NATIVE_DB_TYPE "hash" ++#define NATIVE_DB_TYPE "lmdb" + #define ALIAS_DB_MAP DEF_DB_TYPE ":/etc/aliases" + /* Uncomment the following line if you have NIS package installed */ + /* #define HAS_NIS */ +--- src/global/mail_params.h.orig 2020-05-09 17:51:27.000000000 +0200 ++++ src/global/mail_params.h 2020-12-25 21:04:11.428544623 +0100 +@@ -2826,7 +2826,7 @@ extern int var_vrfy_pend_limit; + extern char *var_verify_service; + + #define VAR_VERIFY_MAP "address_verify_map" +-#define DEF_VERIFY_MAP "btree:$data_directory/verify_cache" ++#define DEF_VERIFY_MAP "lmdb:$data_directory/verify_cache" + extern char *var_verify_map; + + #define VAR_VERIFY_POS_EXP "address_verify_positive_expire_time" +@@ -3594,7 +3594,7 @@ extern char *var_multi_cntrl_cmds; + * postscreen(8) + */ + #define VAR_PSC_CACHE_MAP "postscreen_cache_map" +-#define DEF_PSC_CACHE_MAP "btree:$data_directory/postscreen_cache" ++#define DEF_PSC_CACHE_MAP "lmdb:$data_directory/postscreen_cache" + extern char *var_psc_cache_map; + + #define VAR_SMTPD_SERVICE "smtpd_service_name"