50 releases
| new 0.3.82 | Mar 11, 2026 |
|---|---|
| 0.3.71 | Feb 28, 2026 |
| 0.3.23 | Dec 31, 2025 |
| 0.3.4 | Nov 27, 2025 |
#155 in Email
Used in 3 crates
(2 directly)
5MB
109K
SLoC
SMTP server mocking for MockForge
This crate provides SMTP server functionality for MockForge, allowing you to mock email servers for testing purposes.
Example
use mockforge_smtp::{SmtpConfig, SmtpServer, SmtpSpecRegistry};
use std::sync::Arc;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let config = SmtpConfig::default();
let registry = Arc::new(SmtpSpecRegistry::new());
let server = SmtpServer::new(config, registry)?;
server.start().await?;
Ok(())
}
mockforge-smtp
SMTP server mocking for MockForge.
Features
- RFC 5321 compliant SMTP server
- Fixture-based email handling
- Auto-reply configuration
- In-memory mailbox storage
- Template-based email generation
- Integration with MockForge protocol abstraction
Quick Start
use mockforge_smtp::{SmtpServer, SmtpConfig, SmtpSpecRegistry};
use std::sync::Arc;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let config = SmtpConfig::default();
let registry = Arc::new(SmtpSpecRegistry::new());
let server = SmtpServer::new(config, registry);
server.start().await?;
Ok(())
}
Configuration
smtp:
enabled: true
port: 1025
host: "0.0.0.0"
hostname: "mockforge-smtp"
fixtures_dir: "./fixtures/smtp"
License
MIT OR Apache-2.0
Dependencies
~56–97MB
~2M SLoC