Expand description
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:
-
a normal API user, mainly bothering with
ConnectionConfig,ConnectionandCmdimplementations (in thecommandmodule) -
a cmd implementation, having to use
Io,Socketetc.
§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
Re-exports§
Modules§
- chain
- Provides the
smtp_chainmacro and thechainfunction - command
- Module containing all commands already provided by this crate
- error
- error module
- future_
ext - provieds an extension trait for futures of the form
Future<(Ctx, Result<Item, Err>), Err2> - io
- This modules contains all the
Iotype related parts (for implementingCmd) - response
- Provides access to
Response,ResponseCodeand parsing parts (form implCmd’s) - send_
mail - [feature:
send-mail] provides the send_mail functionality
Macros§
- smtp_
chain - creates a chain of commands and them to the given connection
Structs§
- Address
Literal - represents a
AddressLiteral - Capability
- represents a smtp extension/capability indicated through ehlo
- Connection
- The basic
Connectiontype representing an (likely) open smtp connection - Connection
Builder - Builder for an
ConnectionConfigfor a encrypted smtp connection. - Connection
Config - Configuration specifing how to setup an SMTP connection.
- Default
TlsSetup - The default tls setup, which just calls
builder.build() - Domain
- represents a
Domain - Ehlo
Data - A type representing the ehlo response of the last ehlo call
- Ehlo
Param - represents an EsmtpParam (syntax construct in ehlo response)
- Esmtp
Keyword - represents an EsmtpKeyword (syntax construct in ehlo response)
- Esmtp
Value - represents an EsmtpValue (syntax construct in ehlo response)
- Forward
Path - represents a forward path, most times this is just a mail address
- Local
NonSecure Builder - Builder for an
ConnectionConfigfor an unencrypted smtp connection.Cmd - Reverse
Path - represents a reverse path, most times this is just a mail address
- TlsConfig
- A Tls configuration
Enums§
- Client
Id - Represents the identity of an client
- Security
- configure what kind of security is used
- Syntax
Error - Syntax
Error Handling - Which method should be used to handle syntax errors.
Constants§
Traits§
- Cmd
- Trait implemented by any smtp command
- Setup
Tls - Trait used when setting up tls to modify the setup process
- Type
Erasable Cmd - A alternate version of
Cmdwhich is object safe but has methods which can panic if misused.
Type Aliases§
- Boxed
Cmd - A type acting like a
Cmdtrait object - Connecting
Future - A future resolving to an
Connectioninstance - Exec
Future - future returned by
Cmd::exec