{"id":13688214,"url":"https://github.com/aio-libs/aiosmtpd","last_synced_at":"2025-05-14T04:08:24.249Z","repository":{"id":9787385,"uuid":"63340589","full_name":"aio-libs/aiosmtpd","owner":"aio-libs","description":"A reimplementation of the Python stdlib smtpd.py based on asyncio.","archived":false,"fork":false,"pushed_at":"2025-04-11T07:49:23.000Z","size":1312,"stargazers_count":339,"open_issues_count":95,"forks_count":96,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-05-10T00:02:59.476Z","etag":null,"topics":["asyncio","email","lmtp","mail-mta","mta","python","smtp","smtp-mta","smtp-server","smtpd"],"latest_commit_sha":null,"homepage":"https://aiosmtpd.aio-libs.org","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aio-libs.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.rst","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-14T13:51:17.000Z","updated_at":"2025-05-05T16:15:11.000Z","dependencies_parsed_at":"2024-01-17T06:46:51.528Z","dependency_job_id":"6fcf58c0-c6a1-422e-b16c-d34c55155ebc","html_url":"https://github.com/aio-libs/aiosmtpd","commit_stats":{"total_commits":639,"total_committers":42,"mean_commits":"15.214285714285714","dds":0.6431924882629108,"last_synced_commit":"e386484a32a052d831d0a4a735bbef2e4e868eb4"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aio-libs%2Faiosmtpd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aio-libs%2Faiosmtpd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aio-libs%2Faiosmtpd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aio-libs%2Faiosmtpd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aio-libs","download_url":"https://codeload.github.com/aio-libs/aiosmtpd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254069693,"owners_count":22009558,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asyncio","email","lmtp","mail-mta","mta","python","smtp","smtp-mta","smtp-server","smtpd"],"created_at":"2024-08-02T15:01:08.941Z","updated_at":"2025-05-14T04:08:19.238Z","avatar_url":"https://github.com/aio-libs.png","language":"Python","readme":"=========================================\n aiosmtpd - An asyncio based SMTP server\n=========================================\n\n| |github license| |_| |PyPI Version| |_| |PyPI Python| |_| |PyPI PythonImpl|\n| |GA badge| |_| |CodeQL badge| |_| |codecov| |_| |readthedocs|\n|\n| |GH Discussions|\n|\n\n.. |_| unicode:: 0xA0\n   :trim:\n.. |github license| image:: https://img.shields.io/github/license/aio-libs/aiosmtpd?logo=Open+Source+Initiative\u0026logoColor=0F0\n   :target: https://github.com/aio-libs/aiosmtpd/blob/master/LICENSE\n   :alt: Project License on GitHub\n.. |PyPI Version| image:: https://img.shields.io/pypi/v/aiosmtpd?logo=pypi\u0026logoColor=yellow\n   :target: https://pypi.org/project/aiosmtpd/\n   :alt: PyPI Package\n.. |PyPI Python| image:: https://img.shields.io/pypi/pyversions/aiosmtpd?logo=python\u0026logoColor=yellow\n   :target: https://pypi.org/project/aiosmtpd/\n   :alt: Supported Python Versions\n.. |PyPI PythonImpl| image:: https://img.shields.io/pypi/implementation/aiosmtpd?logo=python\n   :target: https://pypi.org/project/aiosmtpd/\n   :alt: Supported Python Implementations\n.. .. For |GA badge|, don't forget to check actual workflow name in unit-testing-and-coverage.yml\n.. |GA badge| image:: https://github.com/aio-libs/aiosmtpd/workflows/aiosmtpd%20CI/badge.svg\n   :target: https://github.com/aio-libs/aiosmtpd/actions/workflows/unit-testing-and-coverage.yml\n   :alt: GitHub CI status\n.. |CodeQL badge| image:: https://github.com/aio-libs/aiosmtpd/workflows/CodeQL/badge.svg\n   :target: https://github.com/aio-libs/aiosmtpd/actions/workflows/codeql.yml\n   :alt: CodeQL status\n.. |codecov| image:: https://codecov.io/github/aio-libs/aiosmtpd/coverage.svg?branch=master\n   :target: https://codecov.io/github/aio-libs/aiosmtpd?branch=master\n   :alt: Code Coverage\n.. |readthedocs| image:: https://img.shields.io/readthedocs/aiosmtpd?logo=Read+the+Docs\u0026logoColor=white\n   :target: https://aiosmtpd.readthedocs.io/en/latest/\n   :alt: Documentation Status\n.. |GH Discussions| image:: https://img.shields.io/github/discussions/aio-libs/aiosmtpd?logo=github\u0026style=social\n   :target: https://github.com/aio-libs/aiosmtpd/discussions\n   :alt: GitHub Discussions\n\nThe Python standard library includes a basic |SMTP|_ server in the |smtpd|_ module,\nbased on the old asynchronous libraries |asyncore|_ and |asynchat|_.\nThese modules are quite old and are definitely showing their age;\n``asyncore`` and ``asynchat`` are difficult APIs to work with, understand, extend, and fix.\n(And have been deprecated since Python 3.6, and will be removed in Python 3.12.)\n\nWith the introduction of the |asyncio|_ module in Python 3.4,\na much better way of doing asynchronous I/O is now available.\nIt seems obvious that an asyncio-based version of the SMTP and related protocols are needed for Python 3.\nThis project brings together several highly experienced Python developers collaborating on this reimplementation.\n\nThis package provides such an implementation of both the SMTP and LMTP protocols.\n\nFull documentation is available on |aiosmtpd rtd|_\n\n\nRequirements\n============\n\nSupported Platforms\n-----------------------\n\n``aiosmtpd`` has been tested on **CPython**\u003e=3.8 and |PyPy|_\u003e=3.8\nfor the following platforms (in alphabetical order):\n\n* Cygwin (as of 2022-12-22, only for CPython 3.8, and 3.9)\n* MacOS 11 and 12\n* Ubuntu 18.04\n* Ubuntu 20.04\n* Ubuntu 22.04\n* Windows 10\n* Windows Server 2019\n* Windows Server 2022\n\n``aiosmtpd`` *probably* can run on platforms not listed above,\nbut we cannot provide support for unlisted platforms.\n\n.. |PyPy| replace:: **PyPy**\n.. _`PyPy`: https://www.pypy.org/\n\n\nInstallation\n============\n\nInstall as usual with ``pip``::\n\n    pip install aiosmtpd\n\nIf you receive an error message ``ModuleNotFoundError: No module named 'public'``,\nit likely means your ``setuptools`` is too old;\ntry to upgrade ``setuptools`` to at least version ``46.4.0``\nwhich had `implemented a fix for this issue`_.\n\n.. _`implemented a fix for this issue`: https://setuptools.readthedocs.io/en/latest/history.html#v46-4-0\n\n\nProject details\n===============\n\nAs of 2016-07-14, aiosmtpd has been put under the |aiolibs|_ umbrella project\nand moved to GitHub.\n\n* Project home: https://github.com/aio-libs/aiosmtpd\n* PyPI project page: https://pypi.org/project/aiosmtpd/\n* Report bugs at: https://github.com/aio-libs/aiosmtpd/issues\n* Git clone: https://github.com/aio-libs/aiosmtpd.git\n* Documentation: http://aiosmtpd.readthedocs.io/\n* StackOverflow: https://stackoverflow.com/questions/tagged/aiosmtpd\n\nThe best way to contact the developers is through the GitHub links above.\nYou can also request help by submitting a question on StackOverflow.\n\n\nBuilding\n========\n\nYou can install this package in a virtual environment like so::\n\n    $ python3 -m venv /path/to/venv\n    $ source /path/to/venv/bin/activate\n    $ python setup.py install\n\nThis will give you a command line script called ``aiosmtpd`` which implements the\nSMTP server.  Use ``aiosmtpd --help`` for a quick reference.\n\nYou will also have access to the ``aiosmtpd`` library, which you can use as a\ntesting environment for your SMTP clients.  See the documentation links above\nfor details.\n\n\nDeveloping\n==========\n\nYou'll need the `tox \u003chttps://pypi.python.org/pypi/tox\u003e`__ tool to run the\ntest suite for Python 3.  Once you've got that, run::\n\n    $ tox\n\nIndividual tests can be run like this::\n\n    $ tox -- \u003ctestname\u003e\n\nwhere ``\u003ctestname\u003e`` is the \"node id\" of the test case to run, as explained\nin `the pytest documentation`_. The command above will run that one test case\nagainst all testenvs defined in ``tox.ini`` (see below).\n\nIf you want test to stop as soon as it hit a failure, use the ``-x``/``--exitfirst``\noption::\n\n    $ tox -- -x\n\nYou can also add the ``-s``/``--capture=no`` option to show output, e.g.::\n\n    $ tox -e py311-nocov -- -s\n\nand these options can be combined::\n\n    $ tox -e py311-nocov -- -x -s \u003ctestname\u003e\n\n(The ``-e`` parameter is explained in the next section about 'testenvs'.\nIn general, you'll want to choose the ``nocov`` testenvs if you want to show output,\nso you can see which test is generating which output.)\n\n\nSupported 'testenvs'\n------------------------\n\nIn general, the ``-e`` parameter to tox specifies one (or more) **testenv**\nto run (separate using comma if more than one testenv). The following testenvs\nhave been configured and tested:\n\n* ``{py38,py39,py310,py311,py312,pypy3,pypy37,pypy38,pypy39}-{nocov,cov,diffcov,profile}``\n\n  Specifies the interpreter to run and the kind of testing to perform.\n\n  - ``nocov`` = no coverage testing. Tests will run verbosely.\n  - ``cov`` = with coverage testing. Tests will run in brief mode\n    (showing a single character per test run)\n  - ``diffcov`` = with diff-coverage report (showing difference in\n    coverage compared to previous commit). Tests will run in brief mode\n  - ``profile`` = no coverage testing, but code profiling instead.\n    This must be **invoked manually** using the ``-e`` parameter\n\n  **Note 1:** As of 2021-02-23,\n  only the ``{py38,py39}-{nocov,cov}`` combinations work on **Cygwin**.\n\n  **Note 2:** It is also possible to use whatever Python version is used when\n  invoking ``tox`` by using the ``py`` target, but you must explicitly include\n  the type of testing you want. For example::\n\n    $ tox -e \"py-{nocov,cov,diffcov}\"\n\n  (Don't forget the quotes if you want to use braces!)\n\n  You might want to do this for CI platforms where the exact Python version\n  is pre-prepared, such as Travis CI or |GitHub Actions|_; this will definitely\n  save some time during tox's testenv prepping.\n\n  For all testenv combinations except diffcov,\n  |bandit|_ security check will also be run prior to running pytest.\n\n.. _bandit: https://github.com/PyCQA/bandit\n.. |bandit| replace:: ``bandit``\n\n\n* ``qa``\n\n  Performs |flake8|_ code style checking,\n  and |flake8-bugbear|_ design checking.\n\n  In addition, some tests to help ensure that ``aiosmtpd`` is *releasable* to PyPI are also run.\n\n.. _flake8: https://flake8.pycqa.org/en/latest/\n.. |flake8| replace:: ``flake8``\n.. _flake8-bugbear: https://github.com/PyCQA/flake8-bugbear\n.. |flake8-bugbear| replace:: ``flake8-bugbear``\n\n* ``docs``\n\n  Builds **HTML documentation** and **manpage** using Sphinx.\n  A `pytest doctest`_ will run prior to actual building of the documentation.\n\n* ``static``\n\n  Performs a **static type checking** using ``pytype``.\n\n  **Note 1:** Please ensure that `all pytype dependencies`_ have been installed before\n  executing this testenv.\n\n  **Note 2:** This testenv will be _SKIPPED_ on Windows,\n  because ``pytype`` currently cannot run on Windows.\n\n  **Note 3:** This testenv does NOT work on **Cygwin**.\n\n.. _`all pytype dependencies`: https://github.com/google/pytype/blob/2021.02.09/CONTRIBUTING.md#pytype-dependencies\n\n\nEnvironment Variables\n-------------------------\n\n``ASYNCIO_CATCHUP_DELAY``\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n    Due to how asyncio event loop works, some actions do not instantly get\n    responded to. This is especially so on slower / overworked systems.\n    In consideration of such situations, some test cases invoke a slight\n    delay to let the event loop catch up.\n\n    Defaults to `0.1` and can be set to any float value you want.\n\n\nDifferent Python Versions\n-----------------------------\n\nThe tox configuration files have been created to cater for more than one\nPython versions `safely`: If an interpreter is not found for a certain\nPython version, tox will skip that whole testenv.\n\nHowever, with a little bit of effort, you can have multiple Python interpreter\nversions on your system by using ``pyenv``. General steps:\n\n1. Install ``pyenv`` from https://github.com/pyenv/pyenv#installation\n\n2. Install ``tox-pyenv`` from https://pypi.org/project/tox-pyenv/\n\n3. Using ``pyenv``, install the Python versions you want to test on\n\n4. Create a ``.python-version`` file in the root of the repo, listing the\n   Python interpreter versions you want to make available to tox (see pyenv's\n   documentation about this file)\n\n   **Tip:** The 1st line of ``.python-version`` indicates your *preferred* Python version\n   which will be used to run tox.\n\n5. Invoke tox with the option ``--tox-pyenv-no-fallback`` (see tox-pyenv's\n   documentation about this option)\n\n\n``housekeep.py``\n----------------\n\nIf you ever need to 'reset' your repo, you can use the ``housekeep.py`` utility\nlike so::\n\n    $ python housekeep.py superclean\n\nIt is *strongly* recommended to NOT do superclean too often, though.\nEvery time you invoke ``superclean``,\ntox will have to recreate all its testenvs,\nand this will make testing *much* longer to finish.\n\n``superclean`` is typically only needed when you switch branches,\nor if you want to really ensure that artifacts from previous testing sessions\nwon't interfere with your next testing sessions.\n\nFor example, you want to force Sphinx to rebuild all documentation.\nOr, you're sharing a repo between environments (say, PSCore and Cygwin)\nand the cached Python bytecode messes up execution\n(e.g., sharing the exact same directory between Windows PowerShell and Cygwin\nwill cause problems as Python becomes confused about the locations of the source code).\n\n\nSigning Keys\n============\n\nStarting version 1.3.1,\nfiles provided through `PyPI`_ or `GitHub Releases`_\nwill be signed using one of the following GPG Keys:\n\n+-------------------------+----------------+----------------------------------+\n| GPG Key ID              | Owner          | Email                            |\n+=========================+================+==================================+\n| ``5D60 CE28 9CD7 C258`` | Pandu E POLUAN | pepoluan at gmail period com     |\n+-------------------------+----------------+----------------------------------+\n| ``5555 A6A6 7AE1 DC91`` | Pandu E POLUAN | pepoluan at gmail period com     |\n+-------------------------+----------------+----------------------------------+\n| ``E309 FD82 73BD 8465`` | Wayne Werner   | waynejwerner at gmail period com |\n+-------------------------+----------------+----------------------------------+\n| ``5FE9 28CD 9626 CE2B`` | Sam Bull       | sam at sambull period org        |\n+-------------------------+----------------+----------------------------------+\n\n\n\n.. _PyPI: https://pypi.org/project/aiosmtpd/\n.. _`GitHub Releases`: https://github.com/aio-libs/aiosmtpd/releases\n\n\nLicense\n=======\n\n``aiosmtpd`` is released under the Apache License version 2.0.\n\n\n.. _`GitHub Actions`: https://docs.github.com/en/free-pro-team@latest/actions/guides/building-and-testing-python#running-tests-with-tox\n.. |GitHub Actions| replace:: **GitHub Actions**\n.. _`pytest doctest`: https://docs.pytest.org/en/stable/doctest.html\n.. _`the pytest documentation`: https://docs.pytest.org/en/stable/usage.html#specifying-tests-selecting-tests\n.. _`aiosmtpd rtd`: https://aiosmtpd.readthedocs.io\n.. |aiosmtpd rtd| replace:: **aiosmtpd.readthedocs.io**\n.. _`SMTP`: https://tools.ietf.org/html/rfc5321\n.. |SMTP| replace:: **SMTP**\n.. _`smtpd`: https://docs.python.org/3/library/smtpd.html\n.. |smtpd| replace:: **smtpd**\n.. _`asyncore`: https://docs.python.org/3/library/asyncore.html\n.. |asyncore| replace:: ``asyncore``\n.. _`asynchat`: https://docs.python.org/3/library/asynchat.html\n.. |asynchat| replace:: ``asynchat``\n.. _`asyncio`: https://docs.python.org/3/library/asyncio.html\n.. |asyncio| replace:: ``asyncio``\n.. _`aiolibs`: https://github.com/aio-libs\n.. |aiolibs| replace:: **aio-libs**\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faio-libs%2Faiosmtpd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faio-libs%2Faiosmtpd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faio-libs%2Faiosmtpd/lists"}