Skip to content

fakelag/rs-mailserver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust SMTP mailserver

SMTP server written in rust. Server receives emails via SMTP and publishes them to redis pubsub where they can then be processed by other services. Connections from SMTP clients are handled concurrently by spawning tokio green tasks for each new connection. After an SMTP task has completed a successful exchange with its client, the final email is sent to a mpsc channel for processing. A redis worker task consumes messages from the channel and publishes them. If redis is unreachable, the message will be dropped.

System graph

Usage

Compiled binary can be used in client or server mode:

$ rs-mailserver help
Starting SMTP client:
Usage:
        rs-mailserver send <mail_from> <mail_to> <mail_content>
        rs-mailserver send [email protected] [email protected] "email contents"
Starting SMTP server:
Usage:
        rs-mailserver recv <server_domain> [redis_addr] [listen_address]
        rs-mailserver recv yourdomain.com redis://localhost:6379 0.0.0.0:25

Starting SMTP as server

$ rs-mailserver recv yourdomain.com
SMTP Server started. Listening to 0.0.0.0:25 (yourdomain.com)

Sending an email to your server

$ rs-mailserver send localhost:25 [email protected] [email protected] "email contents to send"
Ok

About

SMTP server in rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages