Skip to content

"failed to read - connection closed?" error when trying to query successful connection #259

Open
@JustinLardinois

Description

Describe the bug
I'm able to successfully create a connection, but then I'm getting a "failed to read - connection closed?" error when I try to query for messages.

Used config
Using default config

Code to Reproduce

        $clientManager = new ClientManager();

        $client = $clientManager->make([
            'host'          => 'imap.googlemail.com',
            'port'          => 993,
            'encryption'    => 'ssl',
            'validate_cert' => true,
            'username'      => '[email protected]',
            'password'      => 'password',
            'protocol'      => 'imap'
        ]);

        try {
            $client->connect();
        } catch (ConnectionFailedException $e) {
            echo 'Unable to connect to [email protected]';
            return;
        }

        $inbox = $client->getFolderByName('INBOX');

        $messages = $inbox->query()
            ->leaveUnread()
            ->unseen()
            ->from('example.com')
            ->since(\Carbon\Carbon::now()->subDays(1))
            ->get();

Expected behavior
The query will be successful and my application will continue execution

Screenshots
N/A

Desktop / Server (please complete the following information):

  • OS: CentOS 7
  • PHP: 7.4.30
  • Version: v3.2.0
  • Provider: Gmail (G Suite)

Additional context
Same error as #215, but I don't know if it's a related issue or not. I saw the comment on that issue asking for debug output, but I couldn't figure out how to enable that.

Metadata

Assignees

No one assigned

    Labels

    GmailRelated to Google mail / GMAIL

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions