From cba0c3c246be6d10ecbc3f311321a1bf4cabac42 Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 24 Aug 2021 09:40:24 +0200 Subject: [PATCH] Reduced logging --- .../java/eu/faircode/email/EmailProvider.java | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/EmailProvider.java b/app/src/main/java/eu/faircode/email/EmailProvider.java index 6ba3aecbc3..f1353f2015 100644 --- a/app/src/main/java/eu/faircode/email/EmailProvider.java +++ b/app/src/main/java/eu/faircode/email/EmailProvider.java @@ -427,24 +427,33 @@ public class EmailProvider implements Parcelable { } @NonNull - private static EmailProvider fromISPDB(Context context, String domain, String email) throws IOException, XmlPullParserException { + private static EmailProvider fromISPDB(Context context, String domain, String email) throws Throwable { // https://wiki.mozilla.org/Thunderbird:Autoconfiguration + Throwable failure; + try { URL url = new URL("https://autoconfig." + domain + "/mail/config-v1.1.xml?emailaddress=" + email); return getISPDB(context, domain, url); } catch (Throwable ex) { - Log.w(ex); + Log.i(ex); + failure = ex; } try { URL url = new URL("https://" + domain + "/.well-known/autoconfig/mail/config-v1.1.xml?emailaddress=" + email); return getISPDB(context, domain, url); } catch (Throwable ex) { - Log.w(ex); + Log.i(ex); + } + + try { + URL url = new URL("https://autoconfig.thunderbird.net/v1.1/" + domain); + return getISPDB(context, domain, url); + } catch (Throwable ex) { + Log.i(ex); } - URL url = new URL("https://autoconfig.thunderbird.net/v1.1/" + domain); - return getISPDB(context, domain, url); + throw failure; } @NonNull