Removing unneeded mode checking in SendmailTransport #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The mode checking and exception has been there since this class started in Swiftmailer:
swiftmailer/swiftmailer@de5f2f9#diff-ab3f44d17819352e5340cebcc66a104a2c60ae6a389cbc012d6d13625cd2b870R87
It's caused trouble in combination with environment specific scripts that capture or parse mail with overridden
ini_get('sendmail_path')like mailhog in my case or we use a custom script that eats mail in our staging environments.Here's more context and details around the problem:
https://www.drupal.org/project/symfony_mailer/issues/3277333#comment-14619079
https://www.drupal.org/project/swiftmailer/issues/3174215
I'm creating this PR against 6.1 but we are using
"symfony/mailer": "^5.3.0",in Drupal, not sure if this will get in 5.x, but maybe this will help future us 😅