On 05/01/2026 18:25, Wietse Venema via Postfix-users wrote:
Phil Stracchino via Postfix-users:
I wonder whether the appropriate solution here is a standalone one-time
migration tool to be run preemptively by the user BEFORE losing access
to BDB. It could look for .db files and scan config files for the names
of those it finds, as well as scanning known config files for expected
entries containing hash: or btree: types.
Am I underthinking this?
This may sound like the option that requires 100% robust parsing,
but that is not necessarily the case.
Pass 1: scan parameter settings in main.cf and master.cf, recureively
flatten the content of /file/name in mydestination etc., look
for anything that smells like name:stuff, and look inside into
pipemap:{...}, unionmap:{...}, and { name:stuff options...},
and make a list of hash: and btree: maps in the list. Also
maintain a superset of all the possible proxy_read_maps and
proxy_write_maps values.
Pass 2: intersect the hash: and btree: maps in the result from pass
1 with existing pathnames in the file system.
Pass 3: generate recommendations:
- A table that exists as /path/to/file and /path/to/file.db
should be re-indexed and configured as $default_database_type
(it should also match the proxy_read_maps superset)
- A table that exists only as /path/to/file.db should be
configured as $default_cache_db_type (not re-indexed)
(it should also match the proxy_write_maps superset)
The output from pass 3 is left up to the administrator.
Re-run the tool until it produces no more output.
This takes more than a few hundred lines of code but it also
does cover more.
Wietse
_______________________________________________
Postfix-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]
I would personally favour this kind of approach than a daemon that needs
to run permanently afterwards to solve a temporary issue, even if it
means manual steps to do once off.
In theory the code that parses the config already exists, though
admittedly maybe not all in one convenient place, else postfix would not
be able to learn about the files it needs to open at run time.
The search of the configuration could actually be limited to those
parameters that can accept tables. That may actually be a complication
though, rather than looking through everything.
John
_______________________________________________
Postfix-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]