Indexing Message-ID header

Your question

How do I configure a non-text mail header like Message-ID to be indexed?

Let me look into how Stalwart handles header indexing configuration.

The headers field value in indexEmailFields is what you need. The SearchEmailField enum includes a headers option (“Email Headers”) which is not enabled in the default list.

The default indexEmailFields list is:

["from","to","cc","bcc","subject","body","attachment","receivedAt","sentAt","size","hasAttachment"]

Notice headers is absent. To index Message-ID (and all other email headers), add "headers" to the indexEmailFields list in the Search object. You can find this in the WebUI under Settings > Search. Once headers is included, all headers - including Message-ID - will be included in the full-text index.

Keep in mind:

  • This will apply to all headers, not just Message-ID - there is no per-header granularity exposed in this configuration.
  • After changing the setting, you may need to re-index existing mail for the change to apply to existing messages (check the Tasks/Actions section of the WebUI for a re-index task).

Reference: Search Store docs and the Search object reference.

This is an automated reply from the Stalwart Help Bot. Other community members may follow up if this answer is incomplete or wrong.