From 5707f8b5403732716d5831f3872822dc1bc37d92 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 10 Oct 2020 07:49:18 +0200 Subject: [PATCH] Show default EHLO --- app/src/main/java/eu/faircode/email/EmailService.java | 11 +++++++---- .../main/java/eu/faircode/email/FragmentIdentity.java | 2 ++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/EmailService.java b/app/src/main/java/eu/faircode/email/EmailService.java index 10ca1ead36..38ebc497ce 100644 --- a/app/src/main/java/eu/faircode/email/EmailService.java +++ b/app/src/main/java/eu/faircode/email/EmailService.java @@ -582,11 +582,8 @@ public class EmailService implements AutoCloseable { } } else if ("smtp".equals(protocol) || "smtps".equals(protocol)) { - String[] c = BuildConfig.APPLICATION_ID.split("\\."); - Collections.reverse(Arrays.asList(c)); - String hdomain = TextUtils.join(".", c); - // https://tools.ietf.org/html/rfc5321#section-4.1.3 + String hdomain = getDefaultEhlo(); String haddr = (address instanceof Inet4Address ? "[127.0.0.1]" : "[IPv6:::1]"); properties.put("mail." + protocol + ".localhost", @@ -614,6 +611,12 @@ public class EmailService implements AutoCloseable { throw new NoSuchProviderException(protocol); } + static String getDefaultEhlo() { + String[] c = BuildConfig.APPLICATION_ID.split("\\."); + Collections.reverse(Arrays.asList(c)); + return TextUtils.join(".", c); + } + private static class ErrorHolder { AuthorizationException error; } diff --git a/app/src/main/java/eu/faircode/email/FragmentIdentity.java b/app/src/main/java/eu/faircode/email/FragmentIdentity.java index 428cc83955..4d78bba480 100644 --- a/app/src/main/java/eu/faircode/email/FragmentIdentity.java +++ b/app/src/main/java/eu/faircode/email/FragmentIdentity.java @@ -468,6 +468,8 @@ public class FragmentIdentity extends FragmentBase { btnAdvanced.setVisibility(View.GONE); + etEhlo.setHint(EmailService.getDefaultEhlo()); + btnSave.setVisibility(View.GONE); pbSave.setVisibility(View.GONE); cbTrust.setVisibility(View.GONE);