pydoc > imaplib

πŸ“› NAME

imaplib - IMAP4 client.

πŸš€ Quick Reference

Use CaseCommandDescription
πŸ“‘ Connect to IMAP serverIMAP4(host='', port=143)Create an IMAP4 client instance
πŸ”‘ Loginlogin(user, password)Authenticate with plaintext password
πŸ“ Select mailboxselect(mailbox='INBOX', readonly=False)Select a mailbox for operations
πŸ” Search messagessearch(charset, *criteria)Search mailbox for matching messages
πŸ“₯ Fetch messagesfetch(message_set, message_parts)Fetch parts of specified messages
πŸ“€ Append messageappend(mailbox, flags, date_time, message)Append message to named mailbox
πŸ—‘οΈ Delete messagesstore(message_set, '+FLAGS', '(\\Deleted)')Mark messages for deletion
πŸ”„ Expungeexpunge()Permanently remove deleted messages
πŸšͺ Logoutlogout()Shutdown connection to server
πŸ”’ SSL connectionIMAP4_SSL(host='', port=993)IMAP4 over SSL

πŸ“š MODULE REFERENCE

https://docs.python.org/3.10/library/imaplib.html

The following documentation is automatically generated from the Python source files. It may be incomplete, incorrect or include features that are considered implementation detail and may vary between Python implementations. When in doubt, consult the module reference at the location listed above.

πŸ“– DESCRIPTION

Based on RFC 2060.

πŸ›οΈ CLASSES

🟦 class IMAP4(builtins.object)

IMAP4(host='', port=143, timeout=None)

IMAP4 client class. Instantiate with: IMAP4([host[, port[, timeout=None]]])

All IMAP4rev1 commands are supported by lower‑case methods. Arguments are converted to strings, except for AUTHENTICATE and the last argument to APPEND. Each command returns a tuple: (type, [data, ...]) where type is usually 'OK' or 'NO'. Errors raise <instance>.error("<reason>"); server errors raise <instance>.abort("<reason>"); mailbox status changes raise <instance>.readonly("<reason>").

πŸ“‹ Methods defined here:

πŸ“Š Data descriptors defined here:

πŸ“ Data and other attributes defined here:

🟩 class IMAP4_SSL(IMAP4)

IMAP4_SSL(host='', port=993, keyfile=None, certfile=None, ssl_context=None, timeout=None)

IMAP4 client class over SSL connection. For more documentation see the docstring of the parent class IMAP4.

Method resolution order: IMAP4_SSL, IMAP4, builtins.object

πŸ”§ Methods defined here:

All other methods are inherited from IMAP4 (see above).

πŸŸͺ class IMAP4_stream(IMAP4)

IMAP4_stream(command)

IMAP4 client class over a stream. Instantiate with IMAP4_stream(command) where command is a string that can be passed to subprocess.Popen(). For more documentation see the docstring of the parent class IMAP4.

Method resolution order: IMAP4_stream, IMAP4, builtins.object

πŸ”§ Methods defined here:

All other methods are inherited from IMAP4 (see above).

πŸ”§ FUNCTIONS

πŸ“¦ DATA

__all__ = ['IMAP4', 'IMAP4_stream', 'Internaldate2tuple', 'Int2AP', 'P...]

πŸ†š VERSION

2.58

πŸ“ FILE

/usr/lib/python3.10/imaplib.py

imaplib
πŸ“› NAME πŸš€ Quick Reference πŸ“š MODULE REFERENCE πŸ“– DESCRIPTION πŸ›οΈ CLASSES
🟦 class IMAP4(builtins.object) 🟩 class IMAP4_SSL(IMAP4) πŸŸͺ class IMAP4_stream(IMAP4)
πŸ”§ FUNCTIONS πŸ“¦ DATA πŸ†š VERSION πŸ“ FILE

Generated by phpman v4.9.27 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-18 11:13 @216.73.216.114
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format

^_top_^