Skip to content

Example: Ingest .eml Files

This example shows the shortest file-based ingest path for individual .eml messages.

Use this when you have exported messages on disk, synthetic fixtures for tests, a small set of messages to inspect manually, or parser changes you want to test against known inputs.

For a full walkthrough, use Quickstart.

Terminal window
python -m pip install mailatlas
export MAILATLAS_HOME="$PWD/.mailatlas"

If you need sample fixtures:

Terminal window
git clone https://github.com/mailatlas/sample-data.git
Terminal window
mailatlas ingest sample-data/fixtures/eml/atlas-market-map.eml

Expected output shape:

{
"status": "ok",
"ingested_count": 1,
"duplicate_count": 0,
"document_refs": [
{
"id": "<document-id>",
"subject": "<subject>",
"source_kind": "eml",
"created_at": "<timestamp>"
}
]
}
Terminal window
mailatlas ingest \
sample-data/fixtures/eml/atlas-market-map.eml \
sample-data/fixtures/eml/atlas-founder-forward.eml

MailAtlas stores each unique message as a document in the same workspace.

Terminal window
mailatlas list
mailatlas get <document-id>
mailatlas get <document-id> --format markdown --out ./eml-example-markdown

MailAtlas can write raw email bytes to raw/, normalized HTML to html/, extracted inline images and attachments to assets/, metadata to store.db, and exports to the path passed with --out.