Open cjwnz opened 2 years ago
Hi @cjwnz , could You please send the email with problematic content on base64 to the following email address:
javanile.develop@gmail.com
I'll run test directly to the problematic email
Done. We also can't extract the mime_type the way it was working with original imap functions. Instead of 'image/png' we get 'ANSUhEUgAAANwAAAEeCAYAAADhDXuKAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAA B3RJTUUH5gYHFis7wY5UqQAAIABJREFUeJzs' for example
Thanks
imap2_fetchmime is returning an encoded string instead of plain text where we expect to extract "Content-Type:"
Hi @cjwnz , could you please test our new version https://github.com/javanile/php-imap2/releases/tag/0.1.9
imap2_fetchmime has now been fixed - thank you! However, there is still an issue with imap2_fetchbody returning incorrect value (0) for encoding. See below.
Output of imap2_fetchmime:
Content-Type: image/png; name="boy.png"
Content-Description: boy.png
Content-Disposition: attachment; filename="boy.png"; size=92415;
creation-date="Thu, 15 Sep 2022 21:03:37 GMT";
modification-date="Thu, 15 Sep 2022 21:03:40 GMT"
Content-Transfer-Encoding: base64 <==== Data is Base 64 encoded
Output of imap2_fetchbody:
[type] => 0
[encoding] => 0 <==== Expecting value for ENCBASE64
[ifsubtype] => 1
[subtype] => png
[ifdescription] => 1
[description] => boy.png
[ifid] => 0
[lines] => 0
[bytes] => 126246
[ifdisposition] => 0
[ifdparameters] => 0
[ifparameters] => 1
[parameters] => Array
(
[0] => stdClass Object
(
[attribute] => name
[value] => boy.png
sorry correction above - bug is return value from imap2_fetchstructure, not imap2_fetchbody
@cjwnz try my patch in PR https://github.com/javanile/php-imap2/pull/12
The encoding flag returned by imap2_fetchstructure is wrong for encoded images. It is returning zero when the image is in fact base 64 encoded.
Ref: line #133 of BodyStructure.php
Please fix this asap. Thanks.