diff --git a/postfix/HISTORY b/postfix/HISTORY index 5dfd81eda..7445e5e9f 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -26338,7 +26338,7 @@ Apologies for any names omitted. 20220403 (Rolled back because there was too much collateral damage) - Cleanup: milter_hader_checks maps are now opened before the + Cleanup: milter_header_checks maps are now opened before the cleanup server enters the chroot jail. Files: cleanup/cleanup.h, cleanup/cleanup_init.c, cleanup/cleanup_milter.c, global/header_body_checks.c, global/header_body_checks.h, @@ -26363,10 +26363,10 @@ Apologies for any names omitted. The text was based on an early Postfix implementation. File: proto/postconf.proto. - Cleanup: milter_hader_checks maps are now opened before the - cleanup server enters the chroot jail. Files: cleanup/cleanup.h, - cleanup/cleanup_init.c, cleanup/cleanup_milter.c, - cleanup/cleanup_state.c. + Cleanup (problem introduced: Postfix 2.7): milter_header_checks + maps are now opened before the cleanup server enters the + chroot jail. Files: cleanup/cleanup.h, cleanup/cleanup_init.c, + cleanup/cleanup_milter.c, cleanup/cleanup_state.c. 20220407 @@ -26378,9 +26378,10 @@ Apologies for any names omitted. 20220415 - Cleanup: with dynamic map loading enabled, an attempt to - create a map with "postmap regexp:path" would result in a - bogus error message "Is the postfix-regexp package installed?" - instead of "unsupported map type for this operation". - Implemented a workaround for all map types including regexp - that have no 'bulk create' support. File: global mkmap_open.c. + Cleanup (problem introduced: Postfix 3.0): with dynamic map + loading enabled, an attempt to create a map with "postmap + regexp:path" would result in a bogus error message "Is the + postfix-regexp package installed?" instead of "unsupported + map type for this operation". This happened with all built-in + map types (static, cidr, etc.) that have no 'bulk create' + support. File: global/dynamicmaps.c. diff --git a/postfix/src/global/dynamicmaps.c b/postfix/src/global/dynamicmaps.c index 55d622aa2..f0213d39d 100644 --- a/postfix/src/global/dynamicmaps.c +++ b/postfix/src/global/dynamicmaps.c @@ -168,11 +168,23 @@ static MKMAP_OPEN_FN dymap_mkmap_lookup(const char *dict_type) * All errors are fatal. If the postmap(1) or postalias(1) command can't * create the requested database, then graceful degradation is not * useful. + * + * Fix 20220416: if this dictionary type is registered for some non-mkmap + * purpose, then don't talk nonsense about a missing package. */ - if ((dp = (DYMAP_INFO *) htable_find(dymap_info, dict_type)) == 0) + if ((dp = (DYMAP_INFO *) htable_find(dymap_info, dict_type)) == 0) { + ARGV *types = dict_mapnames(); + char **cpp; + + for (cpp = types->argv; *cpp; cpp++) { + if (strcmp(dict_type, *cpp) == 0) + msg_fatal("unsupported dictionary type: %s does not support " + "bulk-mode creation.", dict_type); + } msg_fatal("unsupported dictionary type: %s. " "Is the postfix-%s package installed?", dict_type, dict_type); + } if (!dp->mkmap_name) msg_fatal("unsupported dictionary type: %s does not support " "bulk-mode creation.", dict_type); diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index 73534c62a..265c54037 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 "20220415" +#define MAIL_RELEASE_DATE "20220416" #define MAIL_VERSION_NUMBER "3.8" #ifdef SNAPSHOT diff --git a/postfix/src/global/mkmap_open.c b/postfix/src/global/mkmap_open.c index 1fd566015..9d15eec30 100644 --- a/postfix/src/global/mkmap_open.c +++ b/postfix/src/global/mkmap_open.c @@ -101,39 +101,6 @@ #include #include - /* - * Workaround for map types that have no 'bulk create' support, for example - * regexp. When dynamic map loading is enabled, an attempt to create a map - * with "postmap regexp:/path" would result in a bogus error message with - * "Is the postfix-regexp package installed?" instead of the expected - * "unsupported map type for this operation: regexp". The workaround is to - * provide explicit definitions for mkmap_open() so that it knows what map - * types exist without a 'bulk create' open function. - * - * The solution is to merge the {maptype, function} tables that are currently - * managed separately by mkmap_open() (for bulk-mode map create operations) - * and by dict_open() (for all other operations). That change would be too - * invasive for a stable release. - */ -#ifdef USE_DYNAMIC_MAPS -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#endif - /* Global library. */ #include "mkmap.h" @@ -170,32 +137,6 @@ static const MKMAP_OPEN_INFO mkmap_open_info[] = { DICT_TYPE_BTREE, mkmap_btree_open, #endif DICT_TYPE_FAIL, mkmap_fail_open, -#ifdef USE_DYNAMIC_MAPS /* Begin workaround */ - DICT_TYPE_ENVIRON, 0, - DICT_TYPE_HT, 0, - DICT_TYPE_UNIX, 0, - DICT_TYPE_TCP, 0, -#ifdef HAS_NIS - DICT_TYPE_NIS, 0, -#endif -#ifdef HAS_NISPLUS - DICT_TYPE_NISPLUS, 0, -#endif -#ifdef HAS_NETINFO - DICT_TYPE_NETINFO, 0, -#endif -#ifdef HAS_POSIX_REGEXP - DICT_TYPE_REGEXP, 0, -#endif - DICT_TYPE_STATIC, 0, - DICT_TYPE_CIDR, 0, - DICT_TYPE_THASH, 0, - DICT_TYPE_SOCKMAP, 0, - DICT_TYPE_PIPE, 0, - DICT_TYPE_RANDOM, 0, - DICT_TYPE_UNION, 0, - DICT_TYPE_INLINE, 0, -#endif /* End workaround */ 0, }; @@ -311,10 +252,9 @@ MKMAP *mkmap_open(const char *type, const char *path, mkmap_open_register(type, open_fn); mp = (MKMAP_OPEN_INFO *) htable_find(mkmap_open_hash, type); } + if (mp == 0) + msg_fatal("unsupported map type for this operation: %s", type); } - if (mp == 0 || mp->before_open == 0) - msg_fatal("unsupported map type for this operation: %s", type); - if (msg_verbose) msg_info("open %s %s", type, path);