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.
cargo buildStarting the server:
./target/debug/rust-smtp-serverSending 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
EOTOriginal 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