symfony / swiftmailer-bundle

Symfony Swiftmailer Bundle
https://symfony.com/swiftmailer-bundle
MIT License
1.56k stars 151 forks source link

[Configuration] Using env() for encryption throws an exception #170

Closed vudaltsov closed 7 years ago

vudaltsov commented 7 years ago
swiftmailer:
    transport:  '%env(MAILER_TRANSPORT)%'
    host:       '%env(MAILER_HOST)%'
    port:       '%env(MAILER_PORT)%'
    encryption: '%env(MAILER_ENCRYPTION)%'
    username:   '%env(MAILER_USER)%'
    password:   '%env(MAILER_PASS)%'

This config throws a The "%env(MAILER_ENCRYPTION)%" encryption is not supported exception.

This happens because of the ->ifNotInArray(array('tls', 'ssl', null)) check. ContainerBuilder::resolveEnvPlaceholders happens later.

marcosfad commented 3 years ago

Was this issue solved? I'm still having troubles with this. A quick solution would be to allow 'tcp' as option. This is how the protocol is set, wenn null is given.

OskarStark commented 3 years ago

Can you please open a new issue and fill the issue template? thanks