Skip to content

"Empty response" when delete is used on Google Accounts #472

@fresent

Description

@fresent

Describe the bug
Running into issue with message "Empty response" when delete is used on Google (both free gmail and g-suite account).

Used config

$options = [
                    'options' => [
                        'soft_fail' => false,
                        'debug' => true,
                    ],
                ];
$connectionConfig = [
                    'host'          => -,
                    'port'          => 993,
                    'encryption'    => 'ssl',
                    'validate_cert' => true,
                    'fetch' => \Webklex\PHPIMAP\IMAP::FT_PEEK,
                    'sequence' => \Webklex\PHPIMAP\IMAP::ST_UID,
                    'fetch_flags' => true,
                    'soft_fail' => false,
                    'username'      => emailAddress,
                    'password'      => AppPasswordFromGmail,
                    'protocol'      => 'imap',
                    'timeout'       => 180,
                    'dispositions' => ['attachment', 'inline'],
                    'decoder' => [
                        'message' => 'utf-8', // mimeheader
                        'attachment' => 'utf-8' // mimeheader
                    ]
                ];

StackTrace

[2024-02-05 05:17:37] production.WARNING: array (
  'Email Attempted' => 'free-email-id@gmail.com',
  'Error Message' => 'Command failed to process:
Causes:
        - Empty response
Commands send:
        TAG20 UID FETCH 2886 (FLAGS)\\r\\n
Responses received:
        TAG20 OK Success\\r\\n
Error occurred',
  'Error StackTrace' => '#0 /masked-home-location/application/vendor/webklex/php-imap/src/Connection/Protocols/Response.php(318): Webklex\\PHPIMAP\\Exceptions\\ResponseException::make()
#1 /masked-home-location/application/vendor/webklex/php-imap/src/Connection/Protocols/Response.php(308): Webklex\\PHPIMAP\\Connection\\Protocols\\Response->validate()
#2 /masked-home-location/application/vendor/webklex/php-imap/src/Message.php(585): Webklex\\PHPIMAP\\Connection\\Protocols\\Response->validatedData()
#3 /masked-home-location/application/vendor/webklex/php-imap/src/Message.php(1254): Webklex\\PHPIMAP\\Message->parseFlags()
#4 /masked-home-location/application/vendor/webklex/php-imap/src/Message.php(1194): Webklex\\PHPIMAP\\Message->setFlag()
#5 /masked-home-location/application/app/Application call: Webklex\\PHPIMAP\\Message->delete()
[2024-02-05 05:18:20] production.WARNING: array (
  'Email Attempted' => 'Google Workplace account',
  'Error Message' => 'Command failed to process:
Causes:
        - Empty response
Commands send:
        TAG23 UID FETCH 2632 (FLAGS)\\r\\n
Responses received:
        TAG23 OK Success\\r\\n
Error occurred',
  'Error StackTrace' => '#0 /masked-home-location/application/vendor/webklex/php-imap/src/Connection/Protocols/Response.php(318): Webklex\\PHPIMAP\\Exceptions\\ResponseException::make()
#1 /masked-home-location/application/vendor/webklex/php-imap/src/Connection/Protocols/Response.php(308): Webklex\\PHPIMAP\\Connection\\Protocols\\Response->validate()
#2 /masked-home-location/application/vendor/webklex/php-imap/src/Message.php(585): Webklex\\PHPIMAP\\Connection\\Protocols\\Response->validatedData()
#3 /masked-home-location/application/vendor/webklex/php-imap/src/Message.php(1254): Webklex\\PHPIMAP\\Message->parseFlags()
#4 /masked-home-location/application/vendor/webklex/php-imap/src/Message.php(1194): Webklex\\PHPIMAP\\Message->setFlag()
#5 /masked-home-location/application/app/Application call: Webklex\\PHPIMAP\\Message->delete()

Expected behavior
Using delete on email should not be throwing error and just delete the message.
Seems IMAP is returning correctly (with message OK Success) but library is still throwing error with Empty Response

Desktop / Server (please complete the following information):

  • OS: Ubuntu 22
  • PHP: 8.1
  • Version : 5.5.0
  • Provider : Gmail

Metadata

Metadata

Assignees

No one assigned

    Labels

    GmailRelated to Google mail / GMAILquestion

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions