From 73bb7a8d5552b9132e4417a3e93eeff2e24316a1 Mon Sep 17 00:00:00 2001 From: Aki <114849413+Its-Aki@users.noreply.github.com> Date: Mon, 11 Nov 2024 13:42:06 +0530 Subject: [PATCH] Issue #8502 Added catch block for InvalidDnsNameException --- .../autodiscovery/autoconfig/MxLookupAutoconfigDiscovery.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/feature/autodiscovery/autoconfig/src/main/kotlin/app/k9mail/autodiscovery/autoconfig/MxLookupAutoconfigDiscovery.kt b/feature/autodiscovery/autoconfig/src/main/kotlin/app/k9mail/autodiscovery/autoconfig/MxLookupAutoconfigDiscovery.kt index 55521c6ee1c..71fa8950b3e 100644 --- a/feature/autodiscovery/autoconfig/src/main/kotlin/app/k9mail/autodiscovery/autoconfig/MxLookupAutoconfigDiscovery.kt +++ b/feature/autodiscovery/autoconfig/src/main/kotlin/app/k9mail/autodiscovery/autoconfig/MxLookupAutoconfigDiscovery.kt @@ -11,6 +11,7 @@ import app.k9mail.core.common.net.Domain import com.fsck.k9.logging.Timber import java.io.IOException import okhttp3.OkHttpClient +import org.minidns.dnsname.InvalidDnsNameException class MxLookupAutoconfigDiscovery internal constructor( private val mxResolver: SuspendableMxResolver, @@ -69,6 +70,9 @@ class MxLookupAutoconfigDiscovery internal constructor( } catch (e: IOException) { Timber.d(e, "Failed to get MX record for domain: %s", domain.value) null + } catch (e: InvalidDnsNameException) { + Timber.d(e, "Invalid DNS name for domain: %s", domain.value) + null } }