Skip to content
This repository has been archived by the owner on Feb 6, 2022. It is now read-only.

Custom sendmail command is not being processed if there are no link to .env file #244

Closed
ArchieDoe opened this issue Apr 26, 2018 · 2 comments

Comments

@ArchieDoe
Copy link

In config/packages/swiftmailer.yaml next config

swiftmailer:
    transport: 'sendmail'
    command: '/usr/bin/msmtp -t -i'

will not be interpreted properly: command property will be omitted.

This happens because of next code:

if ($usedEnvs && !$disableDelivery) {
    // Factory sets here.
}

In case of configuration above $usedEnvs is always empty, which requires to store some information in .env file.

@kojidev
Copy link

kojidev commented Feb 1, 2019

I agree that condition is rather odd.
The whole SwiftmailerExtension and SwiftmailerTransportFactory are quite difficult to understand. At one point we are checking that that there's no env vars and configuring transport using a factory, otherwise we use configureMailerTransport method, which seemingly does the same.

UPD.: Here's a guy suffers from the same weird design: #217, so and I did.

@Toflar
Copy link
Contributor

Toflar commented Jun 18, 2019

I just had the same issue and imho it's not even related to environment vars. The command is just ignored completely. You may check my PR (#286) and provide feedback if that fixes it for you.

@fabpot fabpot closed this as completed Jun 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants