Crate new_tokio_smtp

source ·
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:

  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

Re-exports

pub use self::response::Response;
pub use self::io::Io;

Modules

Provides the smtp_chain macro and the chain function
Module containing all commands already provided by this crate
error module
provieds an extension trait for futures of the form Future<(Ctx, Result<Item, Err>), Err2>
This modules contains all the Io type related parts (for implementing Cmd)
Provides access to Response, ResponseCode and parsing parts (form impl Cmd’s)
[feature: send-mail] provides the send_mail functionality

Macros

creates a chain of commands and them to the given connection

Structs

represents a AddressLiteral
represents a smtp extension/capability indicated through ehlo
The basic Connection type representing an (likely) open smtp connection
Builder for an ConnectionConfig for a encrypted smtp connection.
Configuration specifing how to setup an SMTP connection.
The default tls setup, which just calls builder.build()
represents a Domain
A type representing the ehlo response of the last ehlo call
represents an EsmtpParam (syntax construct in ehlo response)
represents an EsmtpKeyword (syntax construct in ehlo response)
represents an EsmtpValue (syntax construct in ehlo response)
represents a forward path, most times this is just a mail address
Builder for an ConnectionConfig for an unencrypted smtp connection.Cmd
represents a reverse path, most times this is just a mail address
A Tls configuration

Enums

Represents the identity of an client
configure what kind of security is used

Constants

Traits

Trait implemented by any smtp command
Trait used when setting up tls to modify the setup process
A alternate version of Cmd which is object safe but has methods which can panic if misused.

Type Definitions

A type acting like a Cmd trait object
A future resolving to an Connection instance
future returned by Cmd::exec