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.
- Negotiate
Context - Callback context for the
negotiate
stage. - Proto
Opts - Flags that represent milter protocol options.
- Smtp
Reply - Current custom SMTP reply.
Enums§
- Action
Error - An error that occurs when executing a context action.
- Either
Listener - A listener being either the one or the other listener type.
- Either
Stream - Companion connection stream of
EitherListener
. - Macro
Stage - The stage for which macros are sent.
- Smtp
Reply Error - An error that occurs when configuring the SMTP reply.
- Socket
Info - Socket information.
- Status
- The status returned from callbacks.
Traits§
- Context
Actions - Context actions.
- IntoC
String - Infallible conversion to a C string.
- Listener
- A Tokio-based listener.
- SetError
Reply - Customisation of an SMTP reply.
Functions§
- run
- Runs a milter that handles MTA connections until it is shut down.
Type Aliases§
- Callback
Future - The type returned by milter callbacks.