Show default EHLO

pull/187/head
M66B 4 years ago
parent 5b1c1770b2
commit 5707f8b540

@ -582,11 +582,8 @@ public class EmailService implements AutoCloseable {
} }
} else if ("smtp".equals(protocol) || "smtps".equals(protocol)) { } 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 // https://tools.ietf.org/html/rfc5321#section-4.1.3
String hdomain = getDefaultEhlo();
String haddr = (address instanceof Inet4Address ? "[127.0.0.1]" : "[IPv6:::1]"); String haddr = (address instanceof Inet4Address ? "[127.0.0.1]" : "[IPv6:::1]");
properties.put("mail." + protocol + ".localhost", properties.put("mail." + protocol + ".localhost",
@ -614,6 +611,12 @@ public class EmailService implements AutoCloseable {
throw new NoSuchProviderException(protocol); 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 { private static class ErrorHolder {
AuthorizationException error; AuthorizationException error;
} }

@ -468,6 +468,8 @@ public class FragmentIdentity extends FragmentBase {
btnAdvanced.setVisibility(View.GONE); btnAdvanced.setVisibility(View.GONE);
etEhlo.setHint(EmailService.getDefaultEhlo());
btnSave.setVisibility(View.GONE); btnSave.setVisibility(View.GONE);
pbSave.setVisibility(View.GONE); pbSave.setVisibility(View.GONE);
cbTrust.setVisibility(View.GONE); cbTrust.setVisibility(View.GONE);

Loading…
Cancel
Save