Skip to content

Latest commit

 

History

History
65 lines (50 loc) · 1.15 KB

README.md

File metadata and controls

65 lines (50 loc) · 1.15 KB

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