Wietse Venema via Postfix-devel: > Richard Hansen via Postfix-devel: > > On 2025-06-11 22:26:43-04:00, Wietse Venema via Postfix-devel wrote: > > > An empty lookup result is generally not allowed in Postfix. It's > > > enforced in maps_find(), instead of in each indiividual dict_xxx.c > > > implementation. > > > > Gotcha. I think it would be worth mentioning this in DATABASE_README; I > > can draft something if you agree. > > Fine. > > > Would it be useful to add empty string checks to unionmap and pipemap? > > Or is that just more complexity for little value? > > This was an omission when I added union/pipe/etc map support, > at a time that Postfix was 15 years old. > > Principle: if we don't have an empty result check in every table, > then have it in the layer above (maps_find(), dict_union_lookup() > etc.). That will do for now.
[After the coffee has taken effect] The reason that empty values aren't universally forbidden is that some Postfix use cases require support for empty lookup results. One that comes to mind is the main.cf configuration dictionary in all programs, and the related dictionaries for master.cf -o parameter overrides in the postcohf command. There may be more. Thus, a more principled apporoach is to introduce a new flag DICT_FLAG_ALLOW_EMPTY, similar to DICT_FLAG_FOLD. It would be nice to enforce it centrally, like dict_utf8, but DICT_FLAG_FOLD wasn't done that way and it may be good enough. Wietse _______________________________________________ Postfix-devel mailing list -- postfix-devel@postfix.org To unsubscribe send an email to postfix-devel-le...@postfix.org