Multiple config.php files - How it's supposed to work?

In the docs Configuration Parameters is written :

You can add arbitrary files ending with .config.php in the config/ directory, for example you could place your email server configuration in email.config.php. This allows you to easily create and manage custom configurations, or to divide a large complex configuration file into a set of smaller files. These custom files are not overwritten by Nextcloud, and the values in these files take precedence over config.php .

So I wanted to store the email config in email.config.php.

But: After one creates email.config.php this config is copied to config.php. You can watch this by “watch grep mail_ config.php” in a second terminal while creating email.config.php.

That wouldn’t bother me. Nevertheless the changes you make via the gui are only writen to config.php. email.config.php is not altered. So you have two different version of the mail config. No way to check which is used and may run into trouble, when the config is changed in the gui. Or?

That’s - imho - not according to the behaviour described in the docs.

I only tested this with the mail_ parameters. Are there other config.php parametes that could be changed via the gui (admin settings) that would lead to the same problem of inconsistent *.config.php parameters?

(Nextcloud Version: Latest&Greatest. In case you want to know.)

simply: no.

in the moment (or shortly after) when i create email.config.php the settings will be copied to config.php. not by me. by some “nextcloud php magic”.

that’s nasty. imho. because one don’t expect this. (and the reason i’m using email.config.php is that i can’t remove settings from config.php with my ansible playbook.)

i didn’t check what happens if i remove the mail_-config again from config.php. maybe it will appear again by the same magic.

but i assume it will be written again to config.php when i change the settings in the admin section in the web frontend. my changes here were never written to email.config.php.

and that would be again nasty to people trying to fix email config in the web frontend while nextcloud is taking the settings from email.config.php and not telling them.

or?