aioimaplib
Python asyncio IMAP4rev1 client library
Decision gist · record as of 2026-08-14
Yes, if you need async IMAP access in a Python 3.9+ asyncio application and accept GPLv3 copyleft. The library is actively maintained, has zero known vulnerabilities, installs with no dependencies, and covers the majority of IMAP commands. Not suitable for proprietary closed-source projects due to license; consider alternatives if you need STARTTLS or AUTHENTICATE (non-XOAUTH2) support.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or later.
- IMAP4ClientProtocol is not thread-safe; each instance must run in the same thread.
- Low friction: pure Python wheel with no runtime dependencies.
License · maintenance · safety
GPL-3.0 (copyleft) — GPLv3 copyleft license: any derivative work or software that links this library must also be released under GPLv3. Acceptable for open-source projects; requires careful review for proprietary or closed-source applications.
last release 2025-01-16 (575 days) · last repo commit 2026-05-19 · 168 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 721,738 downloads/mo, #5,230 on PyPI
Alternatives
Verify before relying
import asyncio
from aioimaplib import aioimaplib
async def check_mailbox(host, user, password):
imap_client = aioimaplib.IMAP4_SSL(host=host)
await imap_client.wait_hello_from_server()
await imap_client.login(user, password)
res, data = await imap_client.select()
print(f'Messages in INBOX: {data[0]}')
await imap_client.logout()
asyncio.run(check_mailbox('my.imap.server', 'user', 'pass'))- Whether OAuth2 support works reliably with Google Mail (documented as tested with Outlook only as of 2023-01-01)
- Compatibility with IMAP servers beyond those listed (dovecot, Gmail, Outlook, Yahoo, free.fr, orange.fr, mailden.net)
What it is and what it does
aioimaplib is an asyncio port of Python's standard imaplib, designed to let you interact with IMAP mail servers using async/await syntax instead of blocking I/O. It has no runtime dependencies and implements 23 of 25 IMAP4rev1 commands from RFC 3501, plus RFC 2177 IDLE support for efficient server-push notification of new messages.
The library is tested against Python 3.9 through 3.12 and actively maintained. It handles concurrent IMAP commands according to protocol rules (sync commands block; async commands can run in parallel), supports SSL connections, and integrates with Python's standard logging. IDLE mode lets you wait for new mail without CPU-intensive polling by reading server pushes from an async queue. Note that close() only closes the mailbox state, not the TCP connection; you must call logout() to properly disconnect.
Use it for
- Build a mail-fetching daemon that checks multiple IMAP accounts concurrently without blocking threads
- Implement real-time email notifications using IDLE mode to wait for new messages on the server
- Integrate IMAP mailbox access into an asyncio-based web service or bot without spawning threads
- Migrate existing imaplib code to async/await for better concurrency in I/O-bound applications
- Monitor multiple mailboxes in parallel and react to server-pushed events as they arrive
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need async IMAP access in a Python 3.9+ asyncio application and accept GPLv3 copyleft.
The library is actively maintained, has zero known vulnerabilities, installs with no dependencies, and covers the majority of IMAP commands. Not suitable for proprietary closed-source projects due to license; consider alternatives if you need STARTTLS or AUTHENTICATE (non-XOAUTH2) support.
Install
aioimaplib on PyPI
Before you install
Low friction: pure Python wheel with no runtime dependencies. Actively maintained with recent commits and tested against Python 3.9, 3.10, 3.11, 3.12.
Requires Python 3.9 or later. IMAP4ClientProtocol is not thread-safe; each instance must run in the same thread.
License in practice
GPLv3 copyleft license: any derivative work or software that links this library must also be released under GPLv3. Acceptable for open-source projects; requires careful review for proprietary or closed-source applications.
Quickstart
import asyncio
from aioimaplib import aioimaplib
async def check_mailbox(host, user, password):
imap_client = aioimaplib.IMAP4_SSL(host=host)
await imap_client.wait_hello_from_server()
await imap_client.login(user, password)
res, data = await imap_client.select()
print(f'Messages in INBOX: {data[0]}')
await imap_client.logout()
asyncio.run(check_mailbox('my.imap.server', 'user', 'pass'))
Verify before relying
- Whether OAuth2 support works reliably with Google Mail (documented as tested with Outlook only as of 2023-01-01)
- Compatibility with IMAP servers beyond those listed (dovecot, Gmail, Outlook, Yahoo, free.fr, orange.fr, mailden.net)
Package facts
| License | GPL-3.0 copyleft |
| Python support | Supports the current Python release <4.0,>=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 575 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 721,738 / month, #5,230 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Intended Audience :: DevelopersLicense :: OSI Approved :: GNU General Public License v3 (GPLv3)Natural Language :: EnglishProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.9Topic :: Communications :: Email :: Post-Office :: IMAPTopic :: InternetTopic :: Software Development :: Libraries :: Python Modules |
Evidence: aioimaplib-2.0.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “async imap client”
- aioimaplibAn asyncio-based IMAP4rev1 client library that brings async/await…
- IMAPClientIMAPClient provides a Pythonic interface to IMAP servers, handling…
- imap-toolsA high-level Python library for IMAP email operations: fetch, search,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also IMAPClient · imap-tools · fastapi-mail · aiosmtplib · aiocoap · robotframework-imaplibrary2 · apache-airflow-providers-imap · aioresponses · mailsuite · aioftp