config.php: How to override the Mailer settings in Shopware 5.2.7?

Hello,

I’m using Shopware 5.2.7 with Mailer Settings for sendgrid.com, which works fine.

For local development I’d like to override the mail settings with config.php with settings as seen here for instance. But if I add a “mail” block with the following settings, it simply gets ignored by Shopware.

// Make sure no email is sent to the outside world
'mail' => [
    'type' => 'file',
    'path' => $this->DocPath().'mails'
],

How can I override the Mailer settings in Shopware 5.2.7?

Thanks a bunch!

Edit: Changed config_local.php to config.php for easier understanding. 

according to shopware/Kernel.php at 5.2 · shopware/shopware · GitHub shopware reads config.php and config_dev.php. i could not find any mention of config_local.php in shopware source code.
 

See Configuring Multiple Shopware Environments

Setting an Apache environment variable like this

SetEnv SHOPWARE_ENV local

will override config.php with the content of config_[ENVIRONMENT].php (in this example: config_local.php)