1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
//! The new-tokio-smtp crate provides an extendible SMTP (Simple Mail Transfer Protocol) //! implementation using tokio. //! //! This crate provides _only_ SMTP functionality, this means it does neither //! provides functionality for creating mails, nor for e.g. retrying sending //! a mail if the receiver was temporary not available. //! //! This crate can be seen from two perspectives: //! //! 1. a normal API user, mainly bothering with `ConnectionConfig`, `Connection` //! and `Cmd` implementations (in the `command` module) //! //! 2. a cmd implementation, having to use `Io`, `Socket` etc. //! //! # Features //! //! ## `send_mail` //! //! While still not handling the creation/encoding of mails if this feature is //! enabled a `send_mail` command is added `Connection` which combines the steps //! of sending the `MAIL` command, the `RCPT` command and the `DATA` command. //! //! ## `mock-support`, `mock-impl` //! //! Extend the `Socket` abstraction to include a mock socket additional to `Tcp`, `TcpTls`. //! Also provides a mock socket implementation for simply testing commands. Custom implementations //! can be provided too if needed for testing //! // I use `{ ...; let fut = ...long multi line; fut }` a lot for better readability. // it also makes it so much easier to wrap the return value into a `dbg!`, `Box::new` and similar. #![allow(clippy::let_and_return)] #[macro_use] extern crate futures; extern crate base64; extern crate bytes; extern crate hostname; extern crate native_tls; #[cfg(feature = "mock-impl")] extern crate rand; extern crate tokio; extern crate tokio_tls; #[cfg(feature = "send-mail")] extern crate vec1; // order of modules is also "order" in dependency-tree // i.e. module should only import from modules hither // up in the list mod ascii; mod data_types; pub mod future_ext; #[macro_use] mod common; pub mod chain; pub mod command; mod connect; mod connection; pub mod error; pub mod io; #[cfg(feature = "mock-impl")] pub mod mock; pub mod response; #[cfg(feature = "send-mail")] pub mod send_mail; pub use self::common::*; pub use self::connect::*; pub use self::connection::*; pub use self::data_types::*; pub use self::io::Io; pub use self::response::Response;