[][src]Crate new_tokio_smtp

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

chain

Provides the smtp_chain macro and the chain function

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 Io type related parts (for implementing Cmd)

response

Provides access to Response, ResponseCode and parsing parts (form impl Cmd'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

AddressLiteral

represents a AddressLiteral

Capability

represents a smtp extension/capability indicated through ehlo

Connection

The basic Connection type representing an (likely) open smtp connection

ConnectionBuilder

Builder for an ConnectionConfig for a encrypted smtp connection.

ConnectionConfig

Configuration specifing how to setup an SMTP connection.

DefaultTlsSetup

The default tls setup, which just calls builder.build()

Domain

represents a Domain

EhloData

A type representing the ehlo response of the last ehlo call

EhloParam

represents an EsmtpParam (syntax construct in ehlo response)

EsmtpKeyword

represents an EsmtpKeyword (syntax construct in ehlo response)

EsmtpValue

represents an EsmtpValue (syntax construct in ehlo response)

ForwardPath

represents a forward path, most times this is just a mail address

LocalNonSecureBuilder

Builder for an ConnectionConfig for an unencrypted smtp connection.Cmd

ReversePath

represents a reverse path, most times this is just a mail address

TlsConfig

A Tls configuration

Enums

ClientId

Represents the identity of an client

Security

configure what kind of security is used

SyntaxError

Constants

DEFAULT_SMTP_MSA_PORT
DEFAULT_SMTP_MX_PORT

Traits

Cmd

Trait implemented by any smtp command

SetupTls

Trait used when setting up tls to modify the setup process

TypeErasableCmd

A alternate version of Cmd which is object safe but has methods which can panic if misused.

Type Definitions

BoxedCmd

A type acting like a Cmd trait object

ConnectingFuture

A future resolving to an Connection instance

ExecFuture

future returned by Cmd::exec