Skip to content

Add message ID query helper#163

Merged
stevebauman merged 1 commit into
masterfrom
issue-82-message-id-query
Jun 19, 2026
Merged

Add message ID query helper#163
stevebauman merged 1 commit into
masterfrom
issue-82-message-id-query

Conversation

@stevebauman

Copy link
Copy Markdown
Member

Summary

Adds a messageId() query helper so developers can search for messages by the email Message-ID header without confusing it with an IMAP UID or message sequence number.

The helper accepts either a bare message ID like unique-message-id@example.com or a wrapped value like <unique-message-id@example.com>, normalizes it to the bare value, and compiles the expected IMAP header search:

HEADER Message-ID "unique-message-id@example.com"

Why

MessageQuery::find() works with numeric IMAP identifiers. A message's Message-ID is an email header, so it should be queried through SEARCH HEADER Message-ID ... instead of through find() or a new fetch identifier.

Closes #82.

Tests

  • ./vendor/bin/pest tests/Unit/Connection/ImapQueryBuilderTest.php tests/Unit/MessageQueryTest.php
  • ./vendor/bin/pest tests/Unit

@stevebauman stevebauman merged commit ac8a4d0 into master Jun 19, 2026
9 checks passed
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

Successfully merging this pull request may close these issues.

How to query by messageId()?

1 participant