diff --git a/app/src/main/java/eu/faircode/email/EmailService.java b/app/src/main/java/eu/faircode/email/EmailService.java
index a32898cd87..f2b7fe4a82 100644
--- a/app/src/main/java/eu/faircode/email/EmailService.java
+++ b/app/src/main/java/eu/faircode/email/EmailService.java
@@ -352,6 +352,15 @@ public class EmailService implements AutoCloseable {
AuthState authState = OAuthRefresh(context, provider, password);
connect(host, port, auth, user, authState.getAccessToken(), factory);
return authState.jsonSerializeString();
+ } else if (purpose == PURPOSE_CHECK) {
+ String msg = ex.getMessage();
+ if (msg != null)
+ msg = msg.trim();
+ if (TextUtils.isEmpty(msg))
+ throw ex;
+ throw new AuthenticationFailedException(
+ context.getString(R.string.title_service_auth, msg),
+ ex.getNextException());
} else
throw ex;
} catch (MailConnectException ex) {
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 1812184a6f..37c5c058c3 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -676,6 +676,7 @@
OAuth is not supported
Review
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
Please double check the port number
Please double check the protocol (SSL/TLS or STARTTLS)