Crates.io | mailin-embedded |
lib.rs | mailin-embedded |
version | 0.8.3 |
source | src |
created_at | 2018-12-06 17:37:05.68734 |
updated_at | 2024-08-31 07:30:49.084625 |
description | An SMTP server that can be embedded in other programs |
homepage | |
repository | https://code.alienscience.org/alienscience/mailin |
max_upload_size | |
id | 100423 |
size | 20,278 |
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.
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();
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.
mailin-embedded = "^0"