Description
Symfony version(s) affected
6.1.0
Description
I'm experiencing a strange behavior when trying to send transactionnal e-mails.
I use symfony/mailer 6.1.*
& symfony/sendinblue-mailer 6.1.*
, I configured sendinblue+api
transport.
Some of my transationnal e-mails throw this fatal error:
Fatal error: escapeshellarg(): Argument exceeds the allowed length of 8192 bytes in C:\www\deposit\vendor\symfony\http-client\DataCollector\HttpClientDataCollector.php on line 194
When using another transport (e.g. smtp, sendmail), I don't have this error. It seems normal as HTTPClient are not involved in these cases.
My email is 28.7KB weight.
It's look like it's a BC break of Symfony 6.1 as https://github.com/symfony/http-client/blob/6.1/DataCollector/HttpClientDataCollector.php changed to introduce usage of escapeshellarg
. I understand it's more secure, but it introduces limitation to send e-mails through API.
How to reproduce
Send a large e-mail with an API transport, e.g. sendinblue.
Possible Solution
As workarround, it's possible to use 3rd-party-provider+smtp
instead of 3rd-party-provider+api
transport (but with loss of functionnalities, for instance tags).
Additional Context
Found out that
php -r "escapeshellarg(str_repeat('a', 8000));"
does not throw the error.
php -r "escapeshellarg(str_repeat('a', 9000));"
throws the error.