Add comprehensive README documentation
Co-authored-by: setoelkahfi <1797197+setoelkahfi@users.noreply.github.com>
copilot-swe-agent[bot] committed
Oct 9, 2025 at 12:34 UTC
c253f1aa180b2a39ce6861825cefe5eae597af3e
1 file changed
+57
README.md
new
+57
@@ -0,0 +1,57 @@
1
+# SMTP Server
2
+
3
+A basic SMTP server implementation in Rust with TLS/STARTTLS support.
4
+
5
+## Features
6
+
7
+- ✅ Basic SMTP protocol support (HELO/EHLO, MAIL FROM, RCPT TO, DATA, QUIT)
8
+- ✅ STARTTLS support for secure connections
9
+- ✅ Self-signed certificate generation for TLS
10
+- ✅ Async/await with Tokio runtime
11
+- ✅ Structured logging with tracing
12
+- ✅ Multiple recipient support
13
+- ✅ Command validation and error handling
14
+
15
+## Running the Server
16
+
17
+```bash
18
+cargo run
19
+```
20
+
21
+The server listens on `127.0.0.1:2525` by default.
22
+
23
+## Testing
24
+
25
+You can test the server using `nc` (netcat) or `telnet`:
26
+
27
+```bash
28
+echo -e "EHLO test.com\r\nMAIL FROM: <sender@example.com>\r\nRCPT TO: <recipient@example.com>\r\nDATA\r\nSubject: Test\r\n\r\nTest message\r\n.\r\nQUIT\r\n" | nc localhost 2525
29
+```
30
+
31
+## Supported Commands
32
+
33
+- `HELO/EHLO` - Initiate SMTP session
34
+- `MAIL FROM` - Specify sender email address
35
+- `RCPT TO` - Specify recipient email address (supports multiple)
36
+- `DATA` - Begin email message content
37
+- `RSET` - Reset the current transaction
38
+- `NOOP` - No operation (keepalive)
39
+- `QUIT` - Close connection
40
+- `STARTTLS` - Upgrade connection to TLS
41
+
42
+## Building
43
+
44
+```bash
45
+cargo build --release
46
+```
47
+
48
+## Dependencies
49
+
50
+- `tokio` - Async runtime
51
+- `anyhow` - Error handling
52
+- `tracing` / `tracing-subscriber` - Logging
53
+- `regex` - SMTP command parsing
54
+- `native-tls` / `tokio-native-tls` - TLS support
55
+- `openssl` - Certificate generation
56
+- `futures` - Stream handling
57
+- `tokio-util` - Codec utilities