Michael Tokarev: > A few years ago I implemented a new dict for Postfix, dict_fnmatch. > It is a shell-style pattern matcher with patterns placed _inline_, > right in the config file, without any additional files like > pcre/regex (the simplest dictionaries which does not use indexed > files) and others. > > The usage is quite simple but perhaps somewhat > ugly: > > check_client_access > fnmatch:*.example.com|*.example.org:554\sGo\saway
I don't think I have any new ideas with respect to this thread. Some (Linux) distributions ship Postfix maps as dynamically-linked modules, so you can always add a map type, even when it is not part of the vendor's Postfix source tree. Unfortunately those same distributions insist on frequently modifying themselves via an update mechanism, and that of course discourages the use of local extensions. The above notation exposes a bunch of special characters (backslashes and "|"), making it more of a pain to upgrade the main.cf parser without making fnmatch harder to use. I would not bundle CDB, SDBM or other infrastructure code with Postfix. This has nothing to do with who wrote the code. All code will have bugs, and I don't want to issue patches for them. The gain from fnmatch is a few less cycles for initialization, and a few less characters to type for configuration. It provides no functionality that isn't available with pcre or regexp. Wietse