How to do multi-environment app config (config/app.php)? I'm trying to setup different mail settings per environment. Here is my mail component that I'm defining in config/app.php:

'components' =&gt; [
    'mailer' =&gt; function() {
        // Get the stored email settings
        $settings = Craft::$app-&gt;systemSettings-&gt;getEmailSettings();

        // Override the transport adapter class
        $settings-&gt;transportType = craft\mail\transportadapters\Smtp::class;

        // Override the transport adapter settings
        $settings-&gt;transportSettings = [
            'host'              =&gt; 'localhost',
            'port'              =&gt; '1025',
            'useAuthentication' =&gt; false,
            'encryptionMethod'  =&gt; null,
            'timeout'           =&gt; '10',
        ];

        return craft\helpers\MailerHelper::createMailer($settings);
    },
],


How do I ensure this only applies to development environments? Multi-environment doesn't seem to work like it does for config/general.php and there's no multi-environment example in the relevant documentation. Brandon's Github comment here suggests that this is possible. Thanks.
To get this to work, have a look at the format of the general.php config file. 

The key is to include the '*'=&gt;[] at the start.