Kilter Protocol (kilter.protocol)
Kilter Protocol
Kilter is a framework for writing mail filters (known as “milters”)
compatible with Sendmail and Postfix MTAs. Unlike many previous milter implementations in
Python it is not simply bindings to the libmilter library (originally from the Sendmail
project). The framework aims to provide Pythonic interfaces for implementing filters,
including leveraging coroutines instead of libmilter’s callback-style interface.
The kilter.protocol package contains the parsers and filter state machine for the
communications protocol used between the Mail Transfer Agents (MTA) and filters.
Users looking for something as simple to use as libmilter should take a look
at kilter.service.
What is understood about the wire protocol is documented in Wire Protocol.
Sendmail Filters
The Sendmail filter (milter) API facilitates communication between a Mail Transfer Agent (MTA) and arbitrary filters running as external services. These filters can perform a number of operations on received and outgoing mail, such as: virus scanning; checking senders’ reputations; signing outgoing mail; and verifying signatures of incoming mail.
While the protocol was originally for filtering mail through a Sendmail MTA, Postfix has also reverse engineered the protocol and supports most filters made for Sendmail.
libmilter
Historically filters used the libmilter library supplied by the Sendmail project to handle
all aspects of communication with an MTA. Filters simply registered callbacks for various
events then started the library’s main loop. This approach makes implementing simple filters
in C easy for users, but makes writing “Pythonic” filters difficult, especially when a user
wishes to make use of async/await features.
Use of libmilter to implement filters is almost universal as it is a black-box; the
on-the-wire protocol used is undocumented and subject to change between versions, which
makes writing a third-party parser difficult.
Sections
- Milter API Protocol
- Package API: kilter.protocol
- Submodules
- kilter.protocol.buffer module
- kilter.protocol.core module
- kilter.protocol.exceptions module
- kilter.protocol.messages module
FamilyStageActionFlagsProtocolFlagsMessageNegotiateMacroConnectHeloEnvelopeFromEnvelopeRecipientDataUnknownHeaderEndOfHeadersBodyEndOfMessageAbortCloseContinueRejectDiscardAcceptTemporaryFailureSkipReplyCodeChangeHeaderQuarantineAddHeaderInsertHeaderChangeSenderAddRecipientAddRecipientParRemoveRecipientReplaceBodyProgress
- Submodules