Added app password hint

pull/172/head
M66B 5 years ago
parent 6bb51888a3
commit 4a08400e06

@ -66,6 +66,7 @@ public class EmailProvider {
public int keepalive;
public boolean partial;
public boolean useip;
public boolean appPassword;
public String link;
public Server imap = new Server();
public Server smtp = new Server();
@ -127,6 +128,7 @@ public class EmailProvider {
provider.keepalive = xml.getAttributeIntValue(null, "keepalive", 0);
provider.partial = xml.getAttributeBooleanValue(null, "partial", true);
provider.useip = xml.getAttributeBooleanValue(null, "useip", true);
provider.appPassword = xml.getAttributeBooleanValue(null, "appPassword", false);
provider.link = xml.getAttributeValue(null, "link");
provider.type = xml.getAttributeValue(null, "type");
String user = xml.getAttributeValue(null, "user");

@ -262,6 +262,7 @@ public class FragmentQuickSetup extends FragmentBase {
throw new IllegalArgumentException(context.getString(R.string.title_no_password));
EmailProvider provider = EmailProvider.fromEmail(context, email, EmailProvider.Discover.ALL);
args.putBoolean("appPassword", provider.appPassword);
if (provider.link != null)
args.putString("link", provider.link);
@ -404,9 +405,13 @@ public class FragmentQuickSetup extends FragmentBase {
protected void onException(final Bundle args, Throwable ex) {
Log.e(ex);
if (ex instanceof AuthenticationFailedException)
tvErrorHint.setText(R.string.title_setup_no_auth_hint);
else
if (ex instanceof AuthenticationFailedException) {
boolean appPassword = args.getBoolean("appPassword");
String message = getString(R.string.title_setup_no_auth_hint);
if (appPassword)
message += " - " + getString(R.string.title_setup_app_password_hint);
tvErrorHint.setText(message);
} else
tvErrorHint.setText(R.string.title_setup_no_settings_hint);
if (ex instanceof IllegalArgumentException || ex instanceof UnknownHostException) {

@ -164,6 +164,7 @@
<string name="title_setup_no_settings">No settings found for domain \'%1$s\'</string>
<string name="title_setup_no_settings_hint">Please try setting up an account and identity in setup steps 1 and 2 using the settings provided by your email provider</string>
<string name="title_setup_no_auth_hint">Please double check your email address and password and make sure external access (IMAP/SMTP) is enabled for your account</string>
<string name="title_setup_app_password_hint">This provider requires an app password instead of the account password</string>
<string name="title_setup_no_system_folders">Inbox or draft folder not found</string>
<string name="title_setup_quick_success">An account and an identity have successfully been added</string>
<string name="title_setup_quick_failed">You can try to configure an account and an identity below too</string>

@ -59,6 +59,7 @@
<!-- no IMAP IDLE -->
<provider
name="Yahoo!"
appPassword="true"
domain="yahoo.*"
id="yahoo"
link="https://github.com/M66B/FairEmail/blob/master/FAQ.md#user-content-faq88">

Loading…
Cancel
Save