Inbox retrieval feature

An inbox the agent can query, not a pile of raw MIME.

Filter messages, reconstruct conversations, retrieve attachments, and extract structured values through stable API and tool contracts.

Maintained by Evidence checked Editorial method

Direct answer

mails0 stores email metadata for API retrieval and preserves raw messages for parsing and attachment access. Agents can list or search inboxes, filter by direction and automatic labels, retrieve a specific message, inspect reconstructed threads, and request structured extraction without scraping a webmail interface.

Visual guide

Decision map

Search begins with a scoped mailbox and a specific question

  1. 01
    Inbox and search

    Retrieve a bounded result set instead of loading an entire mailbox. Use server-side filters whenever the caller already knows the direction or message category.

  2. 02
    Thread context

    Follow Message-ID, In-Reply-To, and References relationships to present a conversation rather than isolated messages.

  3. 03
    Structured values

    Turn known confirmation formats into explicit fields after selecting the correct message, preserving the original message identity for audit.

Retrieval model

Search begins with a scoped mailbox and a specific question

Email retrieval should narrow the result before content reaches the model. Direction, label, sender, recipient, time, and thread context reduce both token use and accidental disclosure.

Find

Inbox and search

Retrieve a bounded result set instead of loading an entire mailbox. Use server-side filters whenever the caller already knows the direction or message category.

Understand

Thread context

Follow Message-ID, In-Reply-To, and References relationships to present a conversation rather than isolated messages.

Extract

Structured values

Turn known confirmation formats into explicit fields after selecting the correct message, preserving the original message identity for audit.

Workflow

Move from a broad inbox to one auditable result

  1. 01

    Filter the mailbox

    Start with inbound direction, a useful automatic label, and a bounded result limit.

  2. 02

    Search for intent

    Use sender, subject, or relevant content terms to identify candidate messages without sending everything to the agent.

  3. 03

    Open the message or thread

    Retrieve the selected message and its conversation context only when the task needs it.

  4. 04

    Return the minimum result

    Expose the code, link, attachment, or structured field needed by the next step and retain the message ID for traceability.

Search a scoped inbox
mails inbox --direction inbound --label code --limit 5
Automatic triage

Labels are retrieval hints, not hidden business decisions

Incoming messages can be classified into practical categories such as verification code, newsletter, notification, or personal. These labels reduce the first search space and are available as explicit filters.

Classification should remain inspectable. A label can accelerate retrieval, but a critical workflow should still validate sender, recipient, timing, and message content before taking an irreversible action.

  • Use the code label for verification workflows.
  • Use notification to separate automated status mail from human replies.
  • Use thread retrieval before drafting a reply so the agent has the relevant prior context.
  • Use message IDs in logs instead of storing full content in general application telemetry.
Storage and privacy

Separate message metadata, raw content, and application logs

Data layerPurposeRecommended handling
Mailbox metadataFiltering, ordering, status, and referencesKeep scoped to the mailbox and index only fields needed for retrieval.
Raw messageParsing fidelity and attachment accessStore in the email system with explicit retention, not in prompts or analytics.
Derived labelsFast triage and tool filteringTreat as hints that can be reviewed or recomputed.
Agent resultCode, link, summary, or structured fieldReturn the minimum value required by the workflow.
Operational telemetryLatency, errors, and usageAvoid mailbox addresses, bodies, secrets, and raw headers.
Evidence

Sources and product scope

Product behavior is verified against the mails0 source and documentation. External comparisons link to official vendor documentation checked on 2026-08-15.

Questions and answers

Questions about Inbox search and threads

Can mails0 search email bodies?

Yes. The search surface can query indexed message content along with useful metadata. Keep result limits bounded and retrieve full content only when the task requires it.

How are email threads reconstructed?

mails0 uses standard message identifiers and reply-reference headers to associate messages with a thread. Forwarded or malformed mail can still require application-specific handling.

What automatic labels are available?

The current labels include code, newsletter, notification, and personal. They are intended as practical retrieval filters rather than irreversible classifications.

Can an agent download attachments?

Yes, when its mailbox scope and deployment permit the attachment operation. Validate content type and size before passing attachment data into another tool.

Start with a bounded inbox

Give the agent an inbox, then prove the workflow.

Start with a receive-only temporary mailbox. Move to a permanent identity or self-hosted deployment only after the workflow reaches a real email value event.