-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Mailer][Mailgun] Mailgun transport silently ignore any attachments with non-ascii characters in its name #42586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@faizanakram99 #41651 similar? |
@zspine Not sure tbh. Emails are sent while attachments with non-ascii characters in its filename are ignored (no errors whatsoever). For now I used symfony string component to fix it. // ....
use Symfony\Component\Mime\Email;
use function Symfony\Component\String\u;
// ....
$message = new Email();
// ....
$message->attach(
$attachmentHandle,
u($filename)->ascii()->toString(),
$mimeType,
); |
@faizanakram99 I haven't tested but it's definitely seems like a bug! |
FYI. Found something similar in unrelated repositories' issue queue.
As I can understand, it seems to be related how the filenames are encoded in request's body. |
Open for a PR and check the filenames via I think adding symfony/string as a dependency to mailgun mailer is a bit overkill for this case. WDYT @nicolas-grekas ? |
This might be similar to #41249 |
Hey, thanks for your report! |
Symfony version(s) affected: 5.3.6
Description
Mailgun transport silently ignore any attachments with non-ascii characters in its name like Confirmación cliente. If I remove ó from filename, it works as expected.
Not that with smtp transport, it work fine.
NOTE: It used to work fine with swift-mailer-bundle with mailgun transport.
How to reproduce
Here is a reproducer.
https://github.com/faizanakram99/symfony-mailer-mailgun-bug-reproducer
Possible Solution
Additional context
I guess the actual problem might be in symfony/http-client , considering it works with smtp transport
The text was updated successfully, but these errors were encountered: