email_login_imap (libs/email_login.py)

MetaGPT · metagpt/tools/libs/email_login.py · python · MIT
email

Provides IMAP login helper for common email providers, returning a MailBox object.

# Source: https://github.com/FoundationAgents/MetaGPT | License: MIT | Copyright 2024 Chenglin Wu
# Provided via justclaw.it.com; keep this notice with the code.
from imap_tools import MailBox

from metagpt.tools.tool_registry import register_tool

# Define a dictionary mapping email domains to their IMAP server addresses
IMAP_SERVERS = {
    "outlook.com": "imap-mail.outlook.com",  # Outlook
    "163.com": "imap.163.com",  # 163 Mail
    "qq.com": "imap.qq.com",  # QQ Mail
    "gmail.com": "imap.gmail.com",  # Gmail
    "yahoo.com": "imap.mail.yahoo.com",  # Yahoo Mail
    "icloud.com": "imap.mail.me.com",  # iCloud Mail
    "hotmail.com": "imap-mail.outlook.com",  # Hotmail (同 Outlook)
    "live.com": "imap-mail.outlook.com",  # Live (同 Outlook)
    "sina.com": "imap.sina.com",  # Sina M

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key