Skip to content

Inbound email processor crashes on missing message_id attribute #2553

Description

@Volodymyr-Kozhukhar

Bug report

Title

Inbound email import crashes when message_id is missing

Issue Description

Incoming emails may not appear in the CRM inbox even when SMTP and IMAP are configured correctly.
In my test, the email was delivered to the mailbox and readable via IMAP, but Krayin failed while importing it.

The issue seems to happen when an email does not expose a parsed message_id attribute.

Preconditions

  1. Krayin CRM with IMAP enabled.
  2. MAIL_RECEIVER_DRIVER=webklex-imap
  3. SMTP/IMAP configured and reachable.

Steps to reproduce

  1. Configure SMTP and IMAP.
  2. Deliver an email to the configured mailbox.
  3. Run:
php artisan inbound-emails:process

Expected result

Emails should be imported and displayed in the CRM inbox.
Emails without message_id should be skipped or handled safely.

Actual result

The import crashes with:

Undefined array key "message_id"

Problematic code:

$messageId = $attributes['message_id']->first();

As a result, the inbox is not updated.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions