diff --git a/app/src/main/java/eu/faircode/email/FragmentAccount.java b/app/src/main/java/eu/faircode/email/FragmentAccount.java index da7d0eead1..ed4b58308d 100644 --- a/app/src/main/java/eu/faircode/email/FragmentAccount.java +++ b/app/src/main/java/eu/faircode/email/FragmentAccount.java @@ -506,6 +506,11 @@ public class FragmentAccount extends FragmentBase { String password = args.getString("password"); String realm = args.getString("realm"); + if (host.contains(":")) { + Uri h = Uri.parse(host); + host = h.getHost(); + } + if (TextUtils.isEmpty(host)) throw new IllegalArgumentException(context.getString(R.string.title_no_host)); if (TextUtils.isEmpty(port)) @@ -763,6 +768,11 @@ public class FragmentAccount extends FragmentBase { boolean pro = Helper.isPro(context); boolean should = args.getBoolean("should"); + if (host.contains(":")) { + Uri h = Uri.parse(host); + host = h.getHost(); + } + if (!should && TextUtils.isEmpty(host)) throw new IllegalArgumentException(context.getString(R.string.title_no_host)); if (TextUtils.isEmpty(port)) diff --git a/app/src/main/java/eu/faircode/email/FragmentIdentity.java b/app/src/main/java/eu/faircode/email/FragmentIdentity.java index 3db2aec986..dde8623099 100644 --- a/app/src/main/java/eu/faircode/email/FragmentIdentity.java +++ b/app/src/main/java/eu/faircode/email/FragmentIdentity.java @@ -567,6 +567,11 @@ public class FragmentIdentity extends FragmentBase { boolean should = args.getBoolean("should"); + if (host.contains(":")) { + Uri h = Uri.parse(host); + host = h.getHost(); + } + if (!should && TextUtils.isEmpty(name)) throw new IllegalArgumentException(context.getString(R.string.title_no_name)); if (!should && TextUtils.isEmpty(email))