|
1 | | -# smtp-{codec,types} |
| 1 | +[](https://github.com/duesee/smtp-codec/actions/workflows/ci.yml) |
| 2 | +[](https://github.com/duesee/smtp-codec/actions/workflows/scheduled.yml) |
| 3 | +[](https://docs.rs/smtp-codec) |
2 | 4 |
|
3 | | -This workspace contains `smtp-codec` and `smtp-types`, two crates for building SMTP clients and servers following [RFC 5321]. |
| 5 | +# smtp-codec |
4 | 6 |
|
5 | | -`smtp-codec` provides parsing and serialization, and is based on `smtp-types`. |
6 | | -`smtp-types` provides misuse-resistant types, constructors, and general support for SMTP implementations. |
| 7 | +This library provides parsing, serialization, and support for SMTP implementations. |
| 8 | +It is based on `smtp-types` and aims to become a rock-solid building block for SMTP client and server implementations in Rust. |
| 9 | +Many things are there, but `smtp-codec` is still in a rough state. |
7 | 10 |
|
8 | | -## Features |
| 11 | +# License |
9 | 12 |
|
10 | | -* Complete formal syntax of SMTP is implemented following RFC 5321 |
11 | | -* Several SMTP extensions are supported (AUTH, SIZE, 8BITMIME, PIPELINING, STARTTLS, SMTPUTF8, ENHANCEDSTATUSCODES) |
12 | | -* Correctness and misuse-resistance are enforced on the type level |
13 | | -* Comprehensive test coverage |
14 | | - |
15 | | -## Usage |
16 | | - |
17 | | -```rust |
18 | | -use smtp_codec::{decode::Decoder, encode::Encoder, CommandCodec, GreetingCodec}; |
19 | | - |
20 | | -// Parse a greeting |
21 | | -let input = b"220 mail.example.com ESMTP ready\r\n"; |
22 | | -let (remaining, greeting) = GreetingCodec::default().decode(input).unwrap(); |
23 | | -println!("Domain: {}", greeting.domain); |
24 | | - |
25 | | -// Encode a command |
26 | | -use smtp_codec::smtp_types::command::Command; |
27 | | -let cmd = Command::quit(); |
28 | | -let bytes = CommandCodec::default().encode(&cmd); |
29 | | -assert_eq!(bytes.dump(), b"QUIT\r\n"); |
30 | | -``` |
31 | | - |
32 | | -## Supported Extensions |
33 | | - |
34 | | -| Feature | Description | RFC | |
35 | | -|-------------------------|------------------------------------------|----------| |
36 | | -| starttls | SMTP over TLS | RFC 3207 | |
37 | | -| ext_auth | SMTP Authentication | RFC 4954 | |
38 | | -| ext_size | Message Size Declaration | RFC 1870 | |
39 | | -| ext_8bitmime | 8-bit MIME Transport | RFC 6152 | |
40 | | -| ext_pipelining | Command Pipelining | RFC 2920 | |
41 | | -| ext_smtputf8 | Internationalized Email | RFC 6531 | |
42 | | -| ext_enhancedstatuscodes | Enhanced Error Codes | RFC 2034 | |
43 | | - |
44 | | -## License |
45 | | - |
46 | | -Licensed under either of Apache License, Version 2.0 or MIT license at your option. |
47 | | - |
48 | | -[RFC 5321]: https://tools.ietf.org/html/rfc5321 |
| 13 | +This crate is dual-licensed under Apache 2.0 and MIT terms. |
0 commit comments