rusmes_pop3/lib.rs
1//! POP3 protocol implementation for RusMES
2//!
3//! This crate provides a full-featured, RFC 1939-compliant POP3 server
4//! implementation built on Tokio for asynchronous I/O.
5//!
6//! # RFC Compliance
7//!
8//! - **RFC 1939**: Post Office Protocol version 3 (full command set)
9//! - **RFC 2449**: POP3 Extension Mechanism (CAPA command)
10//! - **RFC 2595**: STLS extension for TLS upgrade
11//!
12//! # Supported Commands
13//!
14//! ## Authorization State
15//! - `USER` / `PASS` — Username and password authentication
16//! - `APOP` — MD5 digest authentication with timestamp challenge
17//! - `CAPA` — Capability listing
18//! - `STLS` — Initiate TLS upgrade (if enabled)
19//! - `QUIT` — Disconnect without applying changes
20//!
21//! ## Transaction State
22//! - `STAT` — Mailbox status (message count and total octets)
23//! - `LIST` — Message listing with sizes
24//! - `RETR` — Retrieve a complete message
25//! - `DELE` — Mark a message for deletion
26//! - `RSET` — Reset all deletion marks
27//! - `TOP` — Retrieve message headers and N body lines
28//! - `UIDL` — Unique ID listing per message
29//! - `NOOP` — Keep connection alive
30//! - `QUIT` — Enter Update state, commit deletions, then disconnect
31//!
32//! # Modules
33//!
34//! - `command`: POP3 command enumeration.
35//! - `parser`: POP3 command line parser.
36//! - `response`: POP3 response formatting (`+OK` / `-ERR`).
37//! - `server`: Async TCP listener accepting POP3 connections.
38//! - `session`: Per-connection state machine (Authorization → Transaction → Update).
39//!
40//! # Security
41//!
42//! APOP challenge generation uses `getrandom` for cryptographic quality randomness.
43//! In production deployments, STLS should be enabled to protect USER/PASS credentials.
44
45mod command;
46mod parser;
47mod response;
48mod server;
49mod session;
50
51pub use command::Pop3Command;
52pub use parser::parse_command;
53pub use response::{Pop3Response, Pop3Status};
54pub use server::Pop3Server;
55pub use session::{Pop3Config, Pop3Session, Pop3State};