Auto-Discovery¶
Email-profile automatically detects the IMAP and SMTP server for your email address using multiple strategies.
How it Works¶
- Known providers — checks a built-in map of 50+ providers (Gmail, Outlook, Yahoo, etc.)
- DNS SRV records — queries
_imaps._tcp.<domain>for RFC 6186 compliant servers - MX record hints — resolves MX records and matches against known patterns
- Convention fallback — tries
imap.<domain>as a last resort
Supported Providers¶
| Provider | IMAP Server | |
|---|---|---|
| Gmail | imap.gmail.com | |
| Outlook / Hotmail / Live | outlook.office365.com | |
| Yahoo | imap.mail.yahoo.com | |
| iCloud | imap.mail.me.com | |
| Zoho | imap.zoho.com | |
| ProtonMail (Bridge) | 127.0.0.1:1143 | |
| AOL | imap.aol.com | |
| Yandex | imap.yandex.com | |
| Mail.ru | imap.mail.ru | |
| GMX | imap.gmx.com | |
| Hostinger | imap.hostinger.com | |
| GoDaddy | imap.secureserver.net | |
| Namecheap | mail.privateemail.com | |
| Gandi | mail.gandi.net | |
| OVH | ssl0.ovh.net | |
| Ionos (1&1) | imap.ionos.com | |
| Fastmail | imap.fastmail.com | |
| Rackspace | secure.emailsrvr.com | |
| Titan | imap.titan.email | |
| Locaweb | imap.locaweb.com.br | |
| KingHost | imap.kinghost.net | |
| UOL | imap.uol.com.br | |
| Terra | imap.terra.com.br |
Any server with proper DNS SRV or MX records is also detected automatically.
Usage¶
"""Auto-discovery connects with just email and password."""
from email_profile import Email
def main() -> None:
# Gmail
with Email("user@gmail.com", "app_password") as app:
print(f"Gmail: {app.server}")
# Outlook
with Email("user@outlook.com", "app_password") as app:
print(f"Outlook: {app.server}")
# Any provider — auto-discovers IMAP host
with Email("user@company.com", "password") as app:
print(f"Discovered: {app.server}")
if __name__ == "__main__":
main()