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,
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
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.
* 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);
* 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
#include <mymalloc.h>
#include <stringops.h>
- /*
- * 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 <dict_env.h>
-#include <dict_ht.h>
-#include <dict_unix.h>
-#include <dict_tcp.h>
-#include <dict_nis.h>
-#include <dict_nisplus.h>
-#include <dict_ni.h>
-#include <dict_regexp.h>
-#include <dict_static.h>
-#include <dict_cidr.h>
-#include <dict_thash.h>
-#include <dict_sockmap.h>
-#include <dict_pipe.h>
-#include <dict_random.h>
-#include <dict_union.h>
-#include <dict_inline.h>
-#endif
-
/* Global library. */
#include "mkmap.h"
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,
};
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);