Skip to content
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

V5.0 = Empty Response #362

Closed
FortuneV13 opened this issue Jan 19, 2023 · 12 comments
Closed

V5.0 = Empty Response #362

FortuneV13 opened this issue Jan 19, 2023 · 12 comments

Comments

@FortuneV13
Copy link

Using the latest version I am now getting:

Command failed to process:
Causes:
    - Empty response

When accessing:
$messages = $folder->messages()->all()->get();

It was fine on version: 4.1

@FortuneV13 FortuneV13 changed the title Latest Version Latest Version = Empty Response Jan 19, 2023
@FortuneV13 FortuneV13 changed the title Latest Version = Empty Response V5.0 = Empty Response Jan 19, 2023
@Guite
Copy link
Contributor

Guite commented Jan 23, 2023

Can confirm this issue. Downgrading to 4.x for the moment.

@freescout-helpdesk
Copy link
Contributor

freescout-helpdesk commented Jan 26, 2023

Same here.

@zajinx
Copy link

zajinx commented Feb 2, 2023

same error

@victorr99
Copy link

I can also confirm this issue. I'm getting empty responses everywhere when using version v5.0.0.

@vagkaefer
Copy link

Same error here, Downgrading to 4.x solved for now...

@FortuneV13
Copy link
Author

FortuneV13 commented Feb 10, 2023

Is there any news on a fix? @Webklex

@Webklex
Copy link
Owner

Webklex commented Feb 13, 2023

Hi @FortuneV13 , @Guite , @freescout-helpdesk , @zajinx , @victorr99 , @vagkaefer ,
many thanks for reporting this issue. Unfortunately I can't make sense of it and I'm not able to reproduce this issue.

Please try to enable the debug mode inside your config - perhaps this could provide some insight.
Besides this, how does the stack-trace looks like?

Best regards & thanks for reporting,

@vagkaefer
Copy link

Hello @Webklex , sorry the delay, I was traveling...

This is more info from the Debug

The script and config used:

$options = [
    'options' => [
        'soft_fail' => false,
        'rfc822' => true,
        'debug' => true,
    ],
];

$cm = new ClientManager($options);

$client = $cm->make([
    'host' => 'outlook.office365.com',
    'port' => 993,
    'encryption' => 'ssl',
    'validate_cert' => false,
    'username' => '[email protected]',
    'password' => $access_token,
    'protocol' => 'imap',
    'authentication' => "oauth",
]);

$client->connect();
$folder = $client->getFolder('INBOX');

$folder->query()->all()->get()->each(function ($message) use ($client) {
    var_dump($message);
});

The log:

$client->connect();
$folder = $client->getFolder('INBOX');

   << * OK The Microsoft Exchange IMAP4 service is ready. [xxxxxxxxxxxxxxxx]

   << TAG1 OK AUTHENTICATE completed.
   >> TAG2 LIST "" "*"

   << * LIST (\HasNoChildren) "/" Anota&AOcA9Q-es
   << * LIST (\HasNoChildren) "/" "Arquivo Morto"
   << * LIST (\Marked \HasNoChildren) "/" INBOX
   << * LIST (\HasNoChildren) "/" "Caixa de Sa&AO0-da"
   << * LIST (\HasChildren) "/" Calend&AOE-rio
   << * LIST (\HasNoChildren) "/" Calend&AOE-rio/Anivers&AOE-rios
   << * LIST (\HasNoChildren) "/" "Calend&AOE-rio/Feriados de Brasil"
   << * LIST (\HasChildren) "/" Contatos
   << * LIST (\HasNoChildren) "/" Historico
   << * LIST (\HasChildren) "/" "Hist&APM-rico de Conversa"
   << * LIST (\HasNoChildren \Sent) "/" "Itens Enviados"
   << * LIST (\HasNoChildren \Trash) "/" "Itens Exclu&AO0-dos"
   << * LIST (\HasNoChildren) "/" Journal
   << * LIST (\HasNoChildren \Junk) "/" "Lixo Eletr&APQ-nico"
   << * LIST (\HasNoChildren \Drafts) "/" Rascunhos
   << * LIST (\HasNoChildren) "/" Tarefas
   << TAG2 OK LIST completed.
   = Webklex\PHPIMAP\Folder {#5484
       +path: "INBOX",
       +name: "INBOX",
       +full_name: "INBOX",
       +delimiter: "/",
       +no_inferiors: false,
       +no_select: false,
       +marked: true,
       +has_children: false,
       +referral: false,
     }

> $folder->query()->all()->get()->each(function ($message) use ($client) {
                var_dump($message);
        });

   >> TAG3 SELECT "INBOX"

   << * 0 EXISTS
   << * 0 RECENT
   << * FLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)
   << * OK [PERMANENTFLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)] Permanent flags
   << * OK [UIDVALIDITY 14] UIDVALIDITY value
   << * OK [UIDNEXT 657] The next unique identifier value
   << TAG3 OK [READ-WRITE] SELECT completed.
   >> TAG4 UID SEARCH ALL

   << * SEARCH
   << TAG4 OK SEARCH completed.

      Webklex\PHPIMAP\Exceptions\ResponseException  Command failed to process:
            
         Causes:
         	- Empty response
         Commands send:
         	TAG4 UID SEARCH ALL\r\n
         Responses received:
         	* SEARCH\r\n
         	TAG4 OK SEARCH completed.\r\n
         Error occurred.

If I can help more or perform more tests, just ask

Tks

@freescout-helpdesk
Copy link
Contributor

freescout-helpdesk commented Feb 22, 2023

PHP 8.2.0

We are doing:

$messages = $client->getFolder('INBOX')->query()->since(now()->subDays(3))->leaveUnread()->unseen()->limit(300, 1)->get();

Here is the result:

>> TAG4 SELECT "INBOX"

<< * FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
<< * OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft \*)] Flags permitted.
<< * 98 EXISTS
<< * 0 RECENT
<< * OK [UIDVALIDITY 1540371430] UIDs valid
<< * OK [UIDNEXT 1015] Predicted next UID
<< TAG4 OK [READ-WRITE] Select completed (0.003 + 0.000 + 0.002 secs).
>> TAG5 UID SEARCH SINCE "19-Feb-2023" UNSEEN

<< * SEARCH
<< TAG5 OK Search completed (0.001 + 0.000 secs).

Command failed to process:
Causes:
        - Empty response
Commands send:
        TAG5 UID SEARCH SINCE "19-Feb-2023" UNSEEN\r\n
Responses received:
        * SEARCH\r\n
        TAG5 OK Search completed (0.001 + 0.000 secs).\r\n
Error occurred

UPDATE: If INBOX folder contains some email matching query requirements - it's being fetched, but another error occurrs:

<< TAG8 OK Fetch completed (0.012 + 0.000 + 0.011 secs).

In Part.php line 244:

  Call to a member function first() on null


>> TAG9 LOGOUT

<< * BYE Logging out
<< TAG9 OK Logout completed (0.001 + 0.000 secs).

@craigpotter
Copy link

I am getting this as well when running $message->thread()

Command failed to process: Causes: - Empty response Commands send: TAG25 UID SEARCH HEADER In-Reply-To [email protected]\r\n Responses received: * SEARCH\r\n TAG25 OK SEARCH completed.\r\n Error occurred

@vagkaefer
Copy link

Working fine in version 5.0.1 committed yesterday

Thanks @Webklex

@Webklex
Copy link
Owner

Webklex commented Mar 16, 2023

Thanks for all the feedback!

Please update to v5.1 and give it another try.
If you are currently using an older version below v5.0, please read the breaking changes leading up to v5.1 before upgrading.

Please create a new issue if you can reproduce this issue with v5.1 - to hopefully separate the different causes should they still exist.

Best regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants