--- id: imap-tools version: "1.15.0" license: Apache-2.0 license_treatment: permissive maintenance: active --- # imap-tools — Work with email by IMAP License: permissive · Maintenance: active · Downloads: 752.6K/mo ## What it is and what it does imap_tools is a Python library that wraps the standard library's imaplib to provide a simpler, higher-level interface for working with email via IMAP. It handles the low-level protocol details and lets you fetch messages, search by criteria, manage folders, and perform actions like copy, move, delete, and flag—all without needing external dependencies beyond Python itself. The library parses email messages into structured objects with attributes like subject, sender, recipients, body (text and HTML variants), attachments, and headers. It includes a query builder for constructing search criteria, support for IDLE (server push notifications), and context managers for safe connection handling. It's designed for straightforward email automation tasks: monitoring inboxes, archiving, filtering, or bulk operations on messages and folders. Use it for: - Automated email monitoring: poll an inbox for new messages matching specific criteria and trigger actions. - Email backup or archival: fetch and download messages from IMAP folders in bulk. - Message filtering and organization: search emails by subject, sender, or date and move or flag them. - Notification systems: use IDLE to wait for new mail server-side and react in real time. - Email data extraction: parse message headers, bodies, and attachments for analysis or logging. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A high-level Python library for IMAP email operations: fetch, search, and manage messages and folders without external dependencies. Yes. imap_tools is actively maintained, has no external dependencies, supports modern Python versions, carries no known vulnerabilities, and uses a permissive license. Install it if you need to automate IMAP email tasks in Python—it significantly simplifies the standard library's imaplib. The only caveat is that it is not thread-safe, so use separate instances per thread if needed. ## Install pip install imap-tools uv add imap-tools poetry add imap-tools ## Installing imap-tools Before you install: Low friction: pure Python wheel with no runtime dependencies. Actively maintained—last release 8 days ago, 837 repository stars, supports Python 3.8 through 3.14. License in practice: Apache-2.0 is permissive; you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions. Quickstart: from imap_tools import MailBox, AND with MailBox('imap.mail.com').login('user@mail.com', 'password') as mailbox: for msg in mailbox.fetch(AND(subject='weather')): print(msg.subject, msg.date, msg.text) Requires a working IMAP server and valid credentials; not thread-safe. Verify before relying: - Performance characteristics when handling large mailboxes or bulk operations. - Compatibility with less common IMAP server implementations or extensions. ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 752.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags imap email client library, fetch emails python, imap message search, email folder management, imap idle monitoring, python email automation, imap query builder, email-automation, imap-client [View on SkillFed](https://skillfed.io/packages/imap-tools) · [View on PyPI](https://pypi.org/project/imap-tools/)