IMAPClient
Easy-to-use, Pythonic and complete IMAP client library
What it is and what it does
IMAPClient is a Python library that wraps the IMAP protocol, letting you connect to email servers and work with mailboxes and messages using natural Python types instead of raw IMAP commands. It handles the low-level protocol details—parsing server responses, managing message UIDs, converting time zones, and supporting internationalized mailbox names—so you can focus on application logic.
The library is designed for developers building email clients, migration tools, or automation scripts that need reliable IMAP access. It supports Python versions 3.8 through 3.13 and includes comprehensive unit and functional tests. With no external runtime dependencies and a pure-Python wheel, it installs cleanly and runs on any platform.
Use it for:
- Build an email client or mail reader that connects to IMAP servers and displays folder contents.
- Automate email archival or migration tasks by fetching messages from one server and moving them elsewhere.
- Create a mail filter or rule engine that searches mailboxes and performs actions on matching messages.
- Sync email data to a local database or search index for offline access or analytics.
- Monitor specific mailboxes for new messages and trigger workflows or notifications.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
IMAPClient provides a Pythonic interface to IMAP servers, handling mailbox access, message retrieval, and email operations with automatic parsing of server responses and transparent UID management.
Yes. IMAPClient is production-stable, actively maintained, has zero known vulnerabilities, and installs with no friction. It's the right choice if you need to programmatically interact with IMAP servers from Python. The permissive BSD license poses no restrictions for most use cases.
Install
imapclient on PyPI
pip
pip install imapclientuv
uv add imapclientpoetry
poetry add imapclientInstalling IMAPClient
Before you install
Low install friction; pure Python wheel with no runtime dependencies. Actively maintained with recent commits and a stable release cadence since 2013.
License in practice
3-Clause BSD License is permissive; you may use, modify, and distribute IMAPClient freely in commercial and private projects with minimal restrictions.
Quickstart
pip install imapclient
from imapclient import IMAPClient
client = IMAPClient('imap.example.com')
client.login('user@example.com', 'password')
mailbox = client.select_folder('INBOX')
messages = client.fetch(client.search(), ['BODY[]'])
Requires Python 3.8 or later; IMAP server credentials and network access needed at runtime.
Verify before relying
- Whether the library supports OAuth2 or modern authentication beyond plain-text credentials.
- Performance characteristics when handling mailboxes with very large message counts.
- Whether internationalized mailbox name handling covers all IMAP server implementations.
Package facts
| License | 3-Clause BSD License (permissive) |
| Python support | supports the current Python release (>=3.8.0) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 209 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,534,744/month — #3,017 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: imapclient-3.1.0-py2.py3-none-any.whl
Keywords: imap, client, email, mail
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
aioimaplibAn asyncio-based IMAP4rev1 client library that…
copyleft · top 15,000 on PyPI
imap-toolsA high-level Python library for IMAP email…
permissive · top 15,000 on PyPI
mailsuitemailsuite retrieves, parses, and sends emails…
permissive · top 15,000 on PyPI
robotframework-imaplibrary2A Robot Framework library that connects to IMAP…
permissive · top 15,000 on PyPI
apache-airflow-providers-imapIntegrates IMAP email protocol support into…
permissive · top 5,000 on PyPI
aiosmtplibaiosmtplib is an asynchronous SMTP client that…
permissive · top 5,000 on PyPI
email-normalizeNormalizes email addresses by detecting the…
permissive · top 15,000 on PyPI
mailtrapOfficial Python client for Mailtrap's email…
permissive · top 15,000 on PyPI
mail-parserParses raw email messages into structured…
permissive · top 5,000 on PyPI
redmailRedmail simplifies sending emails with Python…
permissive · top 15,000 on PyPI