| Crates.io | eml2md |
| lib.rs | eml2md |
| version | 0.1.0 |
| created_at | 2026-01-11 17:13:15.764553+00 |
| updated_at | 2026-01-11 17:13:15.764553+00 |
| description | Convert EML files to Markdown |
| homepage | |
| repository | https://github.com/hydai/eml2md |
| max_upload_size | |
| id | 2036110 |
| size | 48,014 |
A fast, lightweight command-line tool to convert EML (email) files to Markdown format.
simple (plain text) and html output formatsRequires Rust (2024 edition).
git clone https://github.com/hydai/eml2md.git
cd eml2md
cargo build --release
The binary will be available at target/release/eml2md.
eml2md -i <input.eml> -o <output.md> [-f <format>]
| Option | Description | Required | Default |
|---|---|---|---|
-i, --input |
Input EML file path | Yes | - |
-o, --output |
Output Markdown file path | Yes | - |
-f, --format |
Output format (simple or html) |
No | simple |
# Convert email to markdown
eml2md -i email.eml -o email.md
# Use HTML format
eml2md -i email.eml -o email.md -f html
The generated Markdown includes a metadata table and the email body:
|||
|---|---|
|From|John Doe <john@example.com>|
|To|Jane Doe <jane@example.com>|
|CC||
|Date|2024-01-01 12:00:00|
|Subject|Meeting Notes|
Hello,
This is the email body content...
# Development build
cargo build
# Release build
cargo build --release
# Run all checks
make all
# Individual checks
make lint # Format check (cargo fmt --all --check)
make clippy # Linter (cargo clippy --all-targets --all-features)
make build # Build project
cargo test
eml2md/
├── src/
│ ├── main.rs # CLI entry point
│ ├── lib.rs # Library exports
│ ├── eml.rs # EML parsing (Email, Header, Body, Attachment)
│ ├── content_type.rs # MIME type parsing
│ └── formatter/
│ ├── mod.rs # Formatter trait and factory
│ └── simple.rs # SimpleFormatter & SimpleHtmlFormatter
├── tests/
│ └── example/ # Example EML files for testing
├── Cargo.toml
└── Makefile
| Crate | Purpose |
|---|---|
| clap | Command-line argument parsing |
| mail-parser | EML/MIME message parsing |
| chrono | Date/time handling |
| base64 | Base64 encoding for attachments |
| anyhow | Error handling |
| thiserror | Custom error types |
Apache-2.0