Skip to content

Special chars in base64 encoded html body is not decoded correctly #572

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

Open
ETES-Stuttgart opened this issue Apr 14, 2025 · 0 comments
Open
Labels
bug Something isn't working validating

Comments

@ETES-Stuttgart
Copy link

ETES-Stuttgart commented Apr 14, 2025

Used config
the default config.

Code to Reproduce
Using the following raw test-message:

Return-Path: <[email protected]>
Content-Type: multipart/related;
	boundary="_634c13df-7dd6-4dba-a18b-f4da6e4aa3dd_"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: base64 encoded html body is not decoded correctly
From: [email protected]
To: [email protected]
Date: Wed, 22 Jan 2025 18:08:13 -0000
Message-ID: <[email protected]>

--_634c13df-7dd6-4dba-a18b-f4da6e4aa3dd_
Content-Transfer-Encoding: base64
Content-Type: text/html

c29tZSBzcGVjaWFsIGNoYXJzOiDimb/DpMO8w7Y=
--_634c13df-7dd6-4dba-a18b-f4da6e4aa3dd_

and the follwing test case:

public function testIssueEmail() {
    $filename = implode(DIRECTORY_SEPARATOR, [__DIR__, "..", "messages", "the-raw-message.eml"]);
    $message = Message::fromFile($filename);

    self::assertSame("some special chars: ♿äüö", $message->getHTMLBody());
}

Fails, because the html body is some special chars: �äßÜ.

In our fork of php-imap, we've also added this test case.

Expected behavior
The html body to be some special chars: ♿äüö

Desktop:

  • OS: Manjaro
  • PHP: 8.4
  • laravel-imap version 6.1.0
@Webklex Webklex added bug Something isn't working validating labels Apr 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working validating
Projects
None yet
Development

No branches or pull requests

2 participants