Skip to main content

github-ico licence-mpl20 pre-commit-ico pipeline-status coverage status

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.

Usage

Most users will be looking for an asynchronous API using Python coroutines: this is available with the kilter.service package. The protocol handlers provided by this package support asynchronous operation but does not handle any IO, thus have no awaitable entrypoints. Instead a service that handles socket communication with MTAs passes bytes from a socket to a protocol handler, which returns event objects. Some of these events instruct the service to pass bytes back to the socket, others are actionable in ways that are implementation specific. When an implementation wants to communicate with an MTA, it registers messages with the protocol handler, which again returns event objects.

Metadata

Release files for kilter.protocol 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kilter.protocol 0.6.0
File Size Uploaded Provenance Actions
kilter_protocol-0.6.0.tar.gz 20.4 kB Without provenance Details for kilter_protocol-0.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kilter.protocol 0.6.0
File Interpreter ABI Platform Actions
kilter_protocol-0.6.0-py3-none-any.whl Python 3 none any Details for kilter_protocol-0.6.0-py3-none-any.whl

Total release size: 36.4 kB

Release files / kilter_protocol-0.6.0.tar.gz

Download URL kilter_protocol-0.6.0.tar.gz
Size 20.4 kB
Tags Source
SHA-256 checksum
How to use checksums
8294bb17e4d0d6c73ef39021add9670c7c2d6bebf53338a2f4311f4c282ef2e8
BLAKE2b-256 checksum
How to use checksums
69d7862829d34424b5544ba8386ea6eca5a1e83c2f968da9311b6eb92ca132af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.14

Release files / kilter_protocol-0.6.0-py3-none-any.whl

Download URL kilter_protocol-0.6.0-py3-none-any.whl
Size 16.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
74fa68670642f95a5122b60192a3f127fd29f5896c725973d737f24505fe861d
BLAKE2b-256 checksum
How to use checksums
ef0e0aafaaab387e2cf6e10d0b6e6c3aee8396cec84b27e525a248ffc3f3e454
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.14

Security for kilter.protocol 0.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page