Skip to content

[7.x] Added check to avoid endless loop in MailManager::createTransport#32549

Merged
taylorotwell merged 5 commits intolaravel:7.xfrom
duxthefux:mail-transport-endless-loop-v7
Apr 26, 2020
Merged

[7.x] Added check to avoid endless loop in MailManager::createTransport#32549
taylorotwell merged 5 commits intolaravel:7.xfrom
duxthefux:mail-transport-endless-loop-v7

Conversation

@duxthefux
Copy link
Contributor

When upgrading to Laravel 7 I found out that a misconfiguration of the new mail.mailers.* config can lead to an endless loop in MailManager::createTransport() which is caused by an empty transport-key in mail.mailers.{ANY_MAILER}.

This happed to us when we were migrating or multi-tenant SMTP configuration to new mailers pattern and as we used driver instead of transport in the configuration ran into a memory overflow due to the described endless loop.

This MR adds a check, as well as tests for it, to ensure that transport-key in $config in MailManager::createTransport() is not empty, where not empty means unequal to null, "" and " ".

This MR points the user to the right place of misconfiguration and does not break any existing features.

@GrahamCampbell GrahamCampbell changed the title Added check to avoid endless loop in MailManager::createTransport [7.x] Added check to avoid endless loop in MailManager::createTransport Apr 26, 2020
@taylorotwell taylorotwell merged commit 9666b31 into laravel:7.x Apr 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants