Skip to content

Simple SMTP server for teaching Rust.

License

Notifications You must be signed in to change notification settings

az82/rust-smtp-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple SMTP server in Rust

This is a small educational project for teaching Rust. It implements a simple, not standards-compliant and very unsafe SMTP server in Rust. The server prints received messages on stdout.

This project is licensed under the terms of the MIT license.

Build

cargo build

Usage

Starting the server:

./target/debug/rust-smtp-server

Sending requests using netcat:

nc localhost 2525 <<EOT
HELO localhost
MAIL FROM: someone@localhost
RCPT TO: someone.else@localhost
DATA
Hello,
the SMTP server works!
Bye.
.
QUIT
EOT
EOT

About SMTP

Original SMTP specification: RFC 821.

Sample conversation:

<- 220 smtp.server.com Simple Mail Transfer Service Ready
-> HELO localhost
<- 250 Hello localhost
-> MAIL FROM:<user@localhost>
<- 250 OK
-> RCPT TO:<admin@localhost>
<- 250 OK
-> DATA
<- 354 Send message content
-> <Mail Data>
-> .
<- 250 OK
-> QUIT
<- 221 Bye

Status

CircleCI

About

Simple SMTP server for teaching Rust.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages