Expand description
Intelligent email parsing with structured type extraction.
Built on top of mailparse, this library parses raw email bytes into strongly-typed structures with automatic entity extraction.
§Features
- Strong typing for all email components
- Automatic entity extraction (emails, phones, URLs, names, companies, monetary amounts, social handles)
- Thread analysis (reply depth, references, in-reply-to)
- Spam indicator detection and scoring
- Signature block separation
- HTML-to-text fallback for HTML-only emails
§Example
use email_extract::{Email, parse_email};
let raw = b"From: alice@example.com\r\nSubject: Hello\r\n\r\nCall me at 555-1234";
let email = parse_email(1, raw).unwrap();
assert_eq!(email.from.address, "alice@example.com");
assert_eq!(email.subject.original, "Hello");
assert!(!email.extracted.phone_numbers.is_empty());Structs§
- Authentication
Results - Email authentication results
- Body
- Email body content
- Category
Hint - Category hint for email classification
- A fully parsed email with extracted entities and metadata
- Email
Address - Email address with optional display name
- Email
Metadata - Email metadata and analysis results
- Extracted
Email - Extracted email address
- Extracted
Entities - All entities extracted from email content
- Extracted
Url - Extracted URL with analysis
- Headers
- Email headers
- Message
Id - Message ID wrapper type
- Monetary
Amount - Monetary amount
- Person
Name - Parsed person name
- Phone
Number - Phone number with type detection
- Social
Handle - Social media handle
- Spam
Indicator - Spam indicator
- Subject
- Email subject with analysis
- Thread
Info - Thread information
Enums§
- Auth
Result - Authentication result status
- Parse
Error - Errors that can occur during email parsing
- Phone
Type - Type of phone number
- Priority
- Email priority level
- Sentiment
- Sentiment analysis result
- Social
Platform - Social media platform
- Urgency
- Urgency level
- UrlType
- Type of URL
Functions§
- parse_
email - Parse raw email bytes into a structured Email
Type Aliases§
- Result
- Result type for email parsing operations