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

Is gmail idle not working?

Open SerikK opened this issue 10 months ago • 1 comments

Describe the bug When I want to get new messages from gmail is not working, I am using from example laravel integration.

To Reproduce `<?php

namespace App\Console\Commands;

use Webklex\IMAP\Commands\ImapIdleCommand; use Webklex\PHPIMAP\Message;

class CustomImapIdleCommand extends ImapIdleCommand {

/**
 * The name and signature of the console command.
 *
 * @var string
 */
 protected $signature = 'custom_command';

/**
 * Holds the account information
 *
 * @var string|array $account
 */
protected $account = "default";

/**
 * Callback used for the idle command and triggered for every new received message
 * @param Message $message
 */
public function onNewMessage(Message $message) {
    $this->info("New message received: " . $message->subject);
}

} `

Expected behavior When I run php artisan custom_command I get new messages

Screenshots

Desktop / Server (please complete the following information):

  • OS: Debian GNU/Linux 11 (Docker mac)
  • PHP: 8.2
  • Version "webklex/laravel-imap": "^6.1"

Additional context IMAP_HOST=imap.googlemail.com IMAP_PORT=993 IMAP_ENCRYPTION=ssl IMAP_VALIDATE_CERT=true [email protected] IMAP_PASSWORD="app pasword" IMAP_DEFAULT_ACCOUNT=default IMAP_PROTOCOL=imap

SerikK avatar Jan 23 '25 16:01 SerikK

Hi @SerikK , many thanks for your report. Unfortunately I'm not sure what you are asking or reporting. Please try to elaborate the issue you are facing and add whatever might be related to the issue, so hopefully the issue can be reproduced :)

If it turns out the issue is related to https://github.com/Webklex/php-imap and not this laravel wrapper, please head over there and create a new issue.

Best regards & happy coding,

Webklex avatar Jan 28 '25 12:01 Webklex

Hello, I'm having trouble connecting Gmail with Webklex with Laravel. I'm trying to access it like this in Laravel

$client = Client::account($account); $client->connect();

        $inbox = $client->getFolder('INBOX');
        $mensagens = $inbox->messages()->limit(10)->get();

        $this->info("Mensagens encontradas: " . count($mensagens));

But I'm getting this error message

Erro (Webklex): BAD Could not parse command

Through PHP I connect Gmail like this

$inbox = @imap_open('{imap.gmail.com:993/imap/ssl}INBOX', $email, $senhaApp);

But with Laravel/Webklex I can't do it using the default Webklex settings as I showed.

Can you help me?

alberioc avatar Jul 04 '25 19:07 alberioc