Expand description
Finding an account’s IMAP server from its address, the way Thunderbird does (https://wiki.mozilla.org/Thunderbird:Autoconfiguration):
- the provider’s own settings,
autoconfig.<domain>(cPanel hosts and Nextcloud providers publish them), then<domain>/.well-known/autoconfig; - Thunderbird’s list of providers (ISPDB), which knows Gmail and the big ones;
- a guess,
imap.<domain>thenmail.<domain>on port 993, for you to check.
Only HTTPS: a settings file fetched in clear could send your password to someone else’s server. The ISPDB is told the domain, never the address.
Google’s mail is known before any of that: gmail.com and googlemail.com, and any domain whose mail Google receives (Google Workspace: its MX is smtp.google.com, or aspmx.l.google.com and its kin), asked of the system’s DNS. Google takes no account password there, only an app password or its own sign-in, so the form must know it (docs/google.md, “Mail”).
Structs§
- Found
- IMAP settings found for an address, with the SMTP server when the settings name one.
- Smtp
- An SMTP submission server.
Enums§
- FoundBy
- Where the settings came from, said to you before you type a password.
Constants§
- GOOGLE_
IMAP - Google’s mail servers, for Gmail and Google Workspace alike.
- GOOGLE_
SMTP - HTTP 🔒
- PROBE 🔒
Functions§
- answers 🔒
- blocks 🔒
- Each
<name attributes>body</name>, as (attributes, body). - discover
- The IMAP settings for an address.
- discover_
smtp - The SMTP server of an address: from its settings, else
smtp.<domain>, then the IMAP host, on 465. - discover_
with 🔒 discover, the domain’s MX asked ofmx(the system’s DNS, or a stand-in in tests).- domain_
of 🔒 - encode 🔒
- Percent-encodes a query value (RFC 3986 §2.3 keeps only unreserved characters).
- fetch 🔒
- google_
found - Google’s servers for an address whose mail Google keeps: IMAP on 993 and submission on 465, both encrypted from the first byte; the address as login.
- guess 🔒
imap.<domain>, thenmail.<domain>, if something answers on port 993.- is_
google_ domain - Gmail’s own domains.
- is_
google_ mail - Whether Google keeps an address’s mail: its domain is Gmail’s, or its MX (asked of the system’s DNS) is Google’s.
- is_
google_ 🔒mail_ with is_google_mail, the MX asked ofmx.- is_
google_ mx - Whether a mail exchanger is Google’s: smtp.google.com (Workspace since 2023), aspmx.l.google.com and altN.aspmx.l.google.com, aspmxN.googlemail.com. Only Google names hosts under google.com and googlemail.com.
- mx_
hosts 🔒 - The hosts that receive a domain’s mail (its MX records), asked of the system’s DNS as the sender checks do (on Android, the network’s servers, which hickory reads through ConnectivityManager); None when it cannot be asked or does not answer within a few seconds.
- parse_
config 🔒 - Reads the IMAP servers of a
config-v1.1.xmlfile; TLS from the first byte is preferred to STARTTLS (RFC 8314 §3), and plain connections are ignored. - server 🔒
- substitute 🔒
- Thunderbird’s placeholders: %EMAILADDRESS%, %EMAILLOCALPART%, %EMAILDOMAIN%.
- tag 🔒
- The text of the first
<name>text</name>, trimmed.