# Email Archive Parsing

Parse email archives into structured paths, headers, bodies, recipients, and quoted messages.

Use it to prepare archived mail as tables for batch analysis.

## Configure sources and parsing rules

Select a Catalog source, or bind files or shard manifests as specified by the template. Provide the original-message marker regex, default charset, and maximum bytes per message.

| Setting | Description |
| --- | --- |
| Original-message marker | Regex splitting quoted message blocks; match the archive's actual markers |
| Default charset | Used when MIME text omits its charset, such as `utf-8` |
| Maximum bytes per message | Must be positive; any message exceeding it causes the node to fail |
| Owner path index | Index after splitting the source name by `/`; configuration default: 0 |
| Mailbox path start | Starting index of the mailbox path; configuration default: 1 |
| Message name index | Configuration default: -1, meaning the last component |

For `alice/inbox/message.eml`, these defaults identify owner `alice`, mailbox `inbox`, and message name `message.eml`. Check actual archive paths before using these positions.

## Choose the output mode

`rows` returns rows for small-sample inspection. `catalog_files` saves CSV files for batch processing. File mode is required when the shard count exceeds 1.

In file mode, set a destination and output prefix. Shard inputs are usually prepared by [Catalog File Shard Manifest](catalog-file-manifest.md).

## Use the output

| Result table | Content |
| --- | --- |
| `email` | Paths, owners, and source information |
| `email_info` | Message headers and bodies |
| `email_to` | Separate To recipients |
| `email_x_to` | Separate X-To recipients |
| `email_original` | Headers from quoted or original messages |

Row mode uses each table's `*_rows` and `*_columns`. File mode uses the corresponding `*_file_id` or full `output_file_ids`. `count` is the number of email files parsed.

## Example: inspect before importing

Flow: Small email sample → Email Archive Parsing → Save results.

First use `rows` to verify path fields and quoted-message splitting. Then switch to `catalog_files` for batch CSV output. Set the import start row according to the generated headers.

## Related pages

- [Variables and data flow](../../variables-and-data.md)
- [Run and debug](../../run-debug.md)
