Auto-Discovery Functions¶
Resolve IMAP/SMTP hosts programmatically without connecting.
from email_profile.advanced import resolve_imap_host, resolve_smtp_host
imap = resolve_imap_host("user@company.com")
print(f"IMAP: {imap.host}:{imap.port}")
smtp = resolve_smtp_host("user@company.com")
print(f"SMTP: {smtp.host}:{smtp.port}")
The resolution follows this order:
- Known providers map (50+)
- DNS SRV records (
_imaps._tcp.<domain>) - MX record hints
- Convention fallback (
imap.<domain>)