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

Trying to access array offset on value of type bool on imap2_num_msg #37

Open
gabriel-tandil opened this issue Dec 12, 2022 · 1 comment

Comments

@gabriel-tandil
Copy link

Hello!
Nice project, very useful.
I am having this problem on one connection (office365) other hotmail connections are working fine.
Trying to access array offset on value of type bool

#0 /var/www/html/ver2/vendor/javanile/php-imap2/src/Mailbox.php(54): yii\web\ErrorHandler->handleError('8', ''Trying to acce...', ''/var/www/html/...', '54', '['imap' => clas...') 
#1 /var/www/html/ver2/vendor/javanile/php-imap2/bootstrap.php(391): Javanile\Imap2\Mailbox::numMsg('class Javanile\\...') 
#2 /var/www/html/ver2/common/clasespropias/mails/ClienteMailImap2.php(208): ::imap2_num_msg('class Javanile\\...')

apparently $status is false at MailBox.php line 54

    public static function numMsg($imap)
    {
        if (!is_a($imap, Connection::class)) {
            return Errors::invalidImapConnection(debug_backtrace(), 1, false);
        }

        $imap->selectMailbox();
        $client = $imap->getClient();

        $status = $client->status($imap->getMailboxName(), ['MESSAGES']);

        return intval($status['MESSAGES']);
    }
@gabriel-tandil
Copy link
Author

I didn't get to analyze the ins and outs of the problem but it happened with an office365 account when in the connection string I passed the mailbox name (INBOX)
{outlook.office365.com:993/imap/ssl/novalidate-cert}INBOX
but this way it worked fine with @hotmail.com account
Without the mailbox name it works fine with the o365 account but not with the hotmail account.

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

1 participant