Crate indymilter

Source
Expand description

A library for writing asynchronous milter applications.

This library provides an API for creating milters that can be integrated with MTAs using the sendmail mail filter protocol, also known as libmilter.

§Usage

The function run is the main entry point to the indymilter API. This function returns a future that can be awaited in order to execute a milter application.

The API presented for implementing a milter is modeled after the sendmail milter (libmilter) API. Refer to the sendmail milter documentation for details and background. The documentation included in indymilter is less complete.

§Trace logging

This library uses the tracing crate for internal trace logging. For insight into library operation, use a tracing subscriber and enable logging at trace level.

A word of warning: Trace logging is very noisy, and can be misleading. Even during normal operation it is common to see ‘errors’ such as inability to parse empty macro definitions from the MTA. However, this is expected, historically grown behaviour (no different from libmilter) and does not impact operation.

Modules§

message
Milter protocol messages.

Structs§

Actions
Flags that represent eom actions.
Callbacks
Callback closures for each milter stage.
Config
Milter configuration.
Context
Callback context.
EomActions
End-of-message actions.
EomContext
Callback context for the eom stage.
Macros
Currently defined macros.
NegotiateContext
Callback context for the negotiate stage.
ProtoOpts
Flags that represent milter protocol options.
SmtpReply
Current custom SMTP reply.

Enums§

ActionError
An error that occurs when executing a context action.
EitherListener
A listener being either the one or the other listener type.
EitherStream
Companion connection stream of EitherListener.
MacroStage
The stage for which macros are sent.
SmtpReplyError
An error that occurs when configuring the SMTP reply.
SocketInfo
Socket information.
Status
The status returned from callbacks.

Traits§

ContextActions
Context actions.
IntoCString
Infallible conversion to a C string.
Listener
A Tokio-based listener.
SetErrorReply
Customisation of an SMTP reply.

Functions§

run
Runs a milter that handles MTA connections until it is shut down.

Type Aliases§

CallbackFuture
The type returned by milter callbacks.