skillfed

aiosmtpd

aiosmtpd - asyncio based SMTP server

aiosmtpd v1.4.6 1.9M downloads/30d#3,453 on PyPI373
Permissive license Apache-2.0 Active released

What it is and what it does

aiosmtpd is an asyncio-based SMTP server implementation that replaces the synchronous smtpd module from Python's standard library. It allows you to build email servers and mail transport agents (MTAs) that can handle multiple concurrent SMTP connections without blocking. The package is built on asyncio, making it suitable for integration into async Python applications that need to receive, process, or relay email messages.

The server implements SMTP and related MTA protocols, letting you define custom handlers for incoming mail. It runs on Windows, Linux, FreeBSD, and supports both CPython and PyPy across Python 3.8 through 3.12. With only two runtime dependencies (atpublic and attrs), it has minimal overhead and integrates cleanly into existing async codebases.

Use it for:

  • Build a test SMTP server for development and integration testing of email-sending applications.
  • Implement a mail relay or gateway that receives SMTP connections and forwards messages to downstream systems.
  • Create a custom email processing pipeline that captures incoming messages for logging, filtering, or transformation.
  • Run a local SMTP listener for development environments to intercept and inspect outgoing mail without sending it.
  • Integrate email reception into an async web application or microservice architecture.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

aiosmtpd is an asyncio-based SMTP server that handles email message reception and routing, similar to the standard library's smtpd module but built for concurrent async workloads.

Yes. aiosmtpd is actively maintained, permissively licensed, has low install friction, and fills a genuine gap for async SMTP server use cases. It's well-suited for testing, prototyping, and production email reception in async Python applications. No known vulnerabilities as of the fact sheet date.

Install

aiosmtpd on PyPI

pip

pip install aiosmtpd

uv

uv add aiosmtpd

poetry

poetry add aiosmtpd

Installing aiosmtpd

Before you install

Low install friction with only two lightweight runtime dependencies (atpublic and attrs). The package is actively maintained with a recent commit as of 2026-08-12, supports Python 3.8 through 3.12, and has been in development since 2015-10-20.

License in practice

Licensed under Apache-2.0 (permissive), allowing commercial and private use with minimal restrictions—suitable for most deployment scenarios.

Quickstart

pip install aiosmtpd

import asyncio
from aiosmtpd.smtp import SMTP

async def main():
    smtp = SMTP()
    await smtp.handle_EHLO(None, None)

asyncio.run(main())

Requires Python 3.8 or later; asyncio event loop must be available in the runtime environment.

Verify before relying

  • Whether the package includes built-in handlers for common mail delivery scenarios or requires custom handler implementation.
  • Performance characteristics under high concurrent connection loads.
  • Compatibility with modern mail client authentication schemes (SASL, TLS).

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies 2 — atpublic, attrs
Maintenance actively maintained — 818 days since the last release
Last repo commit
First released
Downloads 1,895,655/month — #3,453 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: aiosmtpd-1.4.6-py3-none-any.whl

Keywords: email, smtpd, smtp

Framework :: AsyncIOIntended Audience :: DevelopersLicense :: OSI ApprovedLicense :: OSI Approved :: Apache Software LicenseOperating System :: Microsoft :: WindowsOperating System :: POSIX :: BSD :: FreeBSDOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Communications :: Email :: Mail Transport Agents

Tags

asyncio smtp serverasync email serversmtp daemon pythonemail message handlingmta protocol serverconcurrent smtppython email relay
smtp-serverasyncioemail-handling

More Mail Transport Agents packages