github.com/mjcaley/aiospamc ↗
Python asyncio-based library that implements the SPAMC/SPAMD client protocol used by SpamAssassin.
Open this visualization on its own page →
Contributors
6
Lines of Code
1,209
From
2016-12-17
To
2020-12-07
About mjcaley/aiospamc
aiospamc is a Python client library and command-line tool for interacting with SpamAssassin's SPAMC/SPAMD protocol using asyncio for asynchronous operations. It allows developers to integrate spam filtering capabilities into their applications by communicating with a SpamAssassin server to check messages for spam scores, ping the server, and retrieve modified email headers. The project supports both programmatic use through a Python API and direct command-line access with user-friendly output formats including JSON.
The library is built on Python 3.10 or higher and includes dependencies like certifi for certificate handling, loguru for logging, and typer for the CLI interface. It provides straightforward methods for common operations such as checking spam scores against configured thresholds, verifying server connectivity, and examining how SpamAssassin modifies message headers. The implementation emphasizes async-first design, making it suitable for high-concurrency applications that need to process multiple messages without blocking.
The project includes comprehensive documentation, automated unit and integration testing, and maintains compatibility across supported Python versions. It's designed for both end users who want quick access to SpamAssassin functionality through the terminal and developers building spam filtering into larger applications.