diff --git a/app/src/main/java/eu/faircode/email/EmailService.java b/app/src/main/java/eu/faircode/email/EmailService.java
index 14b10f7579..c770f5085d 100644
--- a/app/src/main/java/eu/faircode/email/EmailService.java
+++ b/app/src/main/java/eu/faircode/email/EmailService.java
@@ -446,8 +446,12 @@ public class EmailService implements AutoCloseable {
connect(host, port, auth, user, factory);
} catch (Exception ex1) {
Log.e(ex1);
+ String msg = ex.getMessage();
+ if (auth == AUTH_TYPE_GMAIL &&
+ msg != null && msg.endsWith("Invalid credentials (Failure)"))
+ msg += "; " + context.getString(R.string.title_service_token);
throw new AuthenticationFailedException(
- context.getString(R.string.title_service_auth, ex.getMessage()),
+ context.getString(R.string.title_service_auth, msg),
ex.getNextException());
}
} else if (purpose == PURPOSE_CHECK) {
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 3e8abd4951..06b55d8125 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -925,6 +925,7 @@
Long press an identity to display options, like copy to create alias identities
The email server said: \'%1$s\'
This might be caused by the VPN that is being used
+ The Android account manager could be blocked by a VPN, firewall, ad blocker, etc., preventing it from obtaining an access token
Please double check the port number
Please double check the protocol (SSL/TLS or STARTTLS)