13 releases (7 breaking)
0.8.1 | May 20, 2023 |
---|---|
0.7.1 | Jun 6, 2022 |
0.7.0 | Feb 12, 2022 |
0.6.1 | Mar 6, 2021 |
0.2.1 | Dec 28, 2018 |
#129 in Email
229 downloads per month
76KB
2K
SLoC
A SMTP server that can be embedded into another program
This library provides a simple embeddable SMTP server. The server uses blocking IO and a threadpool.
Examples
use mailin_embedded::{Server, SslConfig, Handler};
#[derive(Clone)]
struct MyHandler {}
impl Handler for MyHandler{}
let handler = MyHandler {};
let mut server = Server::new(handler);
server.with_name("example.com")
.with_ssl(SslConfig::None)?
.with_addr("127.0.0.1:25")?;
server.serve_forever();
SSL
The mailin-embedded
library requires an SSL implementation. The SSL implementation is selected with a feature:
Using RustTLS (the default and recommended, so far no compatibility problems):
$ cargo build
Using OpenSSL (with Mozilla modern):
$ cargo build --features "ossl"
The SSL configuration for both of these libraries is quite strict and might not work with some older Email servers. However, until now, I have only seen problems with spammers and no problems with real email servers.
Using in Cargo.toml
mailin-embedded = "^0"
Dependencies
~1.1–4MB
~87K SLoC