On 12/01/2026 00:35, Wietse Venema via Postfix-users wrote:
Wietse Venema via Postfix-users:
John Fawcett via Postfix-users:
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?
The content of /file/name has the same syntax as mynetworks etc.
That should be mydestination, of course.

It must recursively support /file/name, pipemap{} or unionmap{}
inside /file/name, pipemap{} or unionmap{}. I do not expect that
people will use multiple nesting levels, but they can if needed.

Viktor has informed me that Perl regular expressions support recursion
so they should be able to deal with pipemap{} or unionmap{} inside
pipemap{} or unionmap{}. I expect to have time for that after
releasing Postfix 3.11.0.

If that does not work out, then I can still to build on new code
in the proxymap daemon that can dump a list tables that are referenced
in proxy_read_maps, proxy_write_maps, and smtpd_restrcition_classes.
That code is currently used only for testing.

That code was released over the weekend and needs to mature a bit
before it can be part of Postfix 3.11.

        Wietse
_______________________________________________
Postfix-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Hi

I took a go at writing a shell script external to Postfix that can check the Postfix configuration and report on actions that are needed for the unsupported map types. It has a few shortcomings, like being a bit verbose and not particularly fast. A known limitation is that it doesn't correctly identify cache maps that are set to a variable that then expands to the map. That could be solved, but let's see if the approach is generally useful first.

It can be run on the pre-migrated system and on the migrated system as a check.

It doesn't really parse the main.cf and master.cf syntax, but is based on pattern matching with the assumption that maps are:

    maptype:/path/filename

and filenames are

    /path/filename

and it doesn't enter into the logic of which parameters can accept filenames and which can't. It just deals with filenames it finds.

Further work needs to be done on identifying the earliest version of Postfix it can run on (i.e. that contains the postconf features it relies on) and including a check to stop it running on earlier versions.

John

Attachment: dbmig_check.sh
Description: application/shellscript

_______________________________________________
Postfix-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to