--- id: aioimaplib version: "2.0.1" license: GPL-3.0 license_treatment: copyleft maintenance: active --- # aioimaplib — Python asyncio IMAP4rev1 client library License: copyleft · Maintenance: active · Downloads: 721.7K/mo ## 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 above — verify before relying. An asyncio-based IMAP4rev1 client library that brings async/await support to email mailbox operations, with no runtime dependencies and support for IDLE mode to wait for new messages without polling. 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 pip install aioimaplib uv add aioimaplib poetry add aioimaplib ## Installing aioimaplib 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. 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')) Requires Python 3.9 or later. IMAP4ClientProtocol is not thread-safe; each instance must run in the same thread. 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_current - Install friction: low - Maintenance: active - Downloads: 721.7K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags async imap client, asyncio email library, imap4 asyncio, non-blocking mail fetch, imap idle support, python async email, imap server connection, asyncio, email-protocol, copyleft-gpl [View on SkillFed](https://skillfed.io/packages/aioimaplib) · [View on PyPI](https://pypi.org/project/aioimaplib/)