php-imap icon indicating copy to clipboard operation
php-imap copied to clipboard

Missing email bodies (v2), with example to reproduce

Open peanut24 opened this issue 4 years ago • 3 comments

Hi @Webklex

webklex/laravel-imap version 2.4 webklex/php-imap version 2.5

I'm still trying to get this v2 to prod, was doing some final tests and then ran into a situation where the email bodies were not identified by v2.

After a bit of "what the hell is happening", I realised that it was only for emails sent from Spark (https://sparkmailapp.com), and only on v2, for v1 the body was identified and could be retrieved.

The email in question displays properly in gmail, as well as when using v1 to retrieve it, it seems to only be on v2. I was able to reproduce this with the below email (Had to change extension from .eml to .txt as GitHub doesn't allow uploading .eml)

dump3.txt

When running

  $messages = $inbox->query()
            ->whereSubject("a normal email, nothing fancy here")
            ->setFetchBody(true)
            ->since(now()->subDay())
            ->limit(1)
            ->get();

I get the following:

  • First dump is the subject line
  • Second dump is the result of $message->getHTMLBody() - which is null
  • Third dump is the actual message just getting dumped. You can see there only one key text which is just an empty string

image

In gmail, the email appears as:

image

Could you please see if you can reproduce this with the provided example?

Thanks

peanut24 avatar Feb 24 '21 07:02 peanut24

@Webklex were you able to reproduce this one?

peanut24 avatar Mar 01 '21 04:03 peanut24

I am also facing same (empty body) issue while using sparkmail

afrazahmmad avatar Jul 08 '21 11:07 afrazahmmad

Hi @peanut24 @afrazahmmad , please give v3.0.0-alpha a try. The default boundary regex used to detect the message parts in a multi-part message has been changed and can now also be modified via the config options.boundary parameter inside your configuration.

Best regards,

Webklex avatar Nov 04 '21 16:11 Webklex