thunderbird_accounts.mail.autodiscover_probe

Code for probing if a custom domain’s autodiscover subdomain belongs to an Exchange server.

If so, that’s a conflict to flag to the user.

Functions

exchange_autodiscover_endpoint_exists(...)

Probe a host to see if it looks like an Exchange Autodiscover endpoint.

thunderbird_accounts.mail.autodiscover_probe.exchange_autodiscover_endpoint_exists(hostname: str, domain_name: str) bool[source]

Probe a host to see if it looks like an Exchange Autodiscover endpoint.

Resolve the DNS name to confirm it’s public IP, not private. To avoid a race condition with resolving the domain a second time, we re-use the IP in the connection string and send the DNS name in the host header.

After allowing AUTODISCOVER_PROBE_MAX_REDIRECTS, we check the headers for an Exchange-like header.

Finally, we’ll check to see if the response body looks like Exchange.