Skip to content

Undefined index: authentication at php-imap/src/Client.php:155 #337

@gerardojbaez

Description

@gerardojbaez

Describe the bug

The default account settings doesn't have authentication key, causing an error (or sometimes a notice) when Client tries to set default values based on the valid config keys. The error is thrown by php-imap package, in Client.php L155.

To Reproduce
Steps to reproduce the behavior:

  1. Run php artisan tinker
  2. Write into the console resolve(Webklex\PHPIMAP\Client::class); and hit Enter
  3. In this case a Notice is shown with message Undefined index: authentication in /var/www/html/vendor/webklex/php-imap/src/Client.php on line 155

In a regular HTTP request, a 500 error is thrown (but same issue).

Expected behavior
Either Client needs to check whether a valid key is present in the default account settings, or authentication key is added to the default account settings, fixing the error.

Screenshots
If applicable, add screenshots to help explain your problem.

Relevant portion of the error message generated by a regular HTTP request:
image

Tinker:
image

Woraround/Fix
Publishing the package's config file (i.e., php artisan package:publish --provider Webklex\IMAP\Providers\LaravelServiceProvider) and adding authentication key to accounts.default resolves the issue.

Desktop / Server (please complete the following information):

  • OS: Alpine Linux
  • PHP: 7.4.7
  • Version: 2.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions