Skip to content

Conversation

@dab246
Copy link
Member

@dab246 dab246 commented Oct 28, 2025

Issue

#3976

Description

This PR introduces improvements to the DNS SRV resolution flow by removing the hard dependency on Cloudflare and Google resolvers.
It enhances DnsLookupManager to use a multi-priority fallback mechanism including system DNS, public open resolvers (UDP/TCP), and DNS-over-HTTPS (DoH) providers such as Quad9, AdGuard, OpenDNS, and Yandex.

The goal is to increase privacy, resilience, and independence from GAFAM-controlled infrastructure, especially in restrictive or public network environments.

Changes

  • Refactored DnsLookupManager to support prioritized resolver strategy:
  1. System DNS (default)
  2. Public Open DNS (UDP/TCP)
  3. Public DoH (Quad9, AdGuard, OpenDNS, Yandex)
  4. Cloud DNS (Google/Cloudflare) — now last fallback only
  • Added timeout (3s) per resolver to prevent blocking calls
  • Improved logging and error handling for each DNS layer
  • Added full unit test coverage with mocked resolvers
    • Success path
    • Fallback logic
    • Timeout handling
    • Invalid email validation

Resolved

  • Demo:
Screen_recording_20251028_112719.webm
  • Logs
I/flutter (19422): [SystemUdpSrvClient] ⚠️ No system DNS found — let higher-level resolver fallback to public DNS.
I/flutter (19422): [SystemUdpSrvClient] Using 0 system DNS servers: 
I/flutter (19422): [BaseSrvResolver] ⚠️ No DNS servers configured.
I/flutter (19422): [TwakeMail] DnsLookupManager::lookupJmapUrl → ⚠️ No records via System Default, continuing...
I/flutter (19422): [TwakeMail] DnsLookupManager::lookupJmapUrl → 🔍 Trying Public DNS (UDP/TCP) (timeout: 3s)...
I/flutter (19422): [BaseSrvResolver] 🌐 Querying _jmap._tcp.linagora.com via 8 servers...
I/ImeTracker(19422): system_server:15b4d912: onCancelled at PHASE_CLIENT_ON_CONTROLS_CHANGED
I/flutter (19422): [BaseSrvResolver] ✅ 149.112.112.112 responded via UDP
I/flutter (19422): [TwakeMail] DnsLookupManager::lookupJmapUrl → ✅ Success via Public DNS (UDP/TCP): jmap.linagora.com

I/flutter (19422): [SystemUdpSrvClient] ⚠️ No system DNS found — let higher-level resolver fallback to public DNS.
I/flutter (19422): [SystemUdpSrvClient] Using 0 system DNS servers: 
I/flutter (19422): [BaseSrvResolver] ⚠️ No DNS servers configured.
I/flutter (19422): [TwakeMail] DnsLookupManager::lookupJmapUrl → ⚠️ No records via System Default, continuing...
I/flutter (19422): [TwakeMail] DnsLookupManager::lookupJmapUrl → 🔍 Trying Public DNS (UDP/TCP) (timeout: 3s)...
I/flutter (19422): [BaseSrvResolver] 🌐 Querying _jmap._tcp.stg.lin-saas.com via 8 servers...
I/flutter (19422): [BaseSrvResolver] ✅ 94.140.15.15 responded via UDP
I/flutter (19422): [TwakeMail] DnsLookupManager::lookupJmapUrl → ✅ Success via Public DNS (UDP/TCP): jmap.stg.lin-saas.com

@github-actions
Copy link

This PR has been deployed to https://linagora.github.io/tmail-flutter/4129.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants