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.
I was looking into writing a script to do this. I was puzzled by
"recursively" for the file flattening. Does this mean that mydestination
can refer to a file and then within that file there can be a reference
to another file and so on?
I had originally started from the documentation and had only deduced
that there was one level of file flattening.For example under
mydestination https://www.postfix.org/postconf.5.html#mydestination: "A
"/file/name" pattern is replaced by its contents;"
Also I was not sure about "looking inside" pipemap and unionmap. I was
assuming from the example here
https://www.postfix.org/DATABASE_README.html "pipemap
<https://www.postfix.org/DATABASE_README.html#types>:{/type_1 :name_1 ,
..., type_n :name_n /}". that I would find all the referenced tables
within the parameter value itself, without looking into files. Can
pipemap and unionmap actually reference files and do those need to be
recursively interpreted too?
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 [email protected]
_______________________________________________
Postfix-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]