barbushin / php-imap

Manage mailboxes, filter/get/delete emails in PHP (supports IMAP/POP3/NNTP)
MIT License
1.65k stars 459 forks source link

[BUG] Processing ENCBINARY encoding returned base64 string #711

Open wking0702 opened 1 year ago

wking0702 commented 1 year ago

In the \PhpImap\DataPartInfo::decodeAfterFetch method, the "imap_binary" function is used when processing ENCBINARY encoding. But "imap_binary" returns "base64 string" (details: https://www.php.net/manual/en/function.imap-binary.php).

Bug in this possition: src/PhpImap/DataPartInfo.php#L98

For test: run code print imap_binary("Plain text"); and print base64_decode(imap_binary("Plain text"));

Please fix this bug.