Removed identity verification, showing failed authentication reason

pull/161/head
M66B 5 years ago
parent 603d613e89
commit f5bd4eadc6

@ -202,7 +202,7 @@ FairEmail follows all the best practices for an email client as decribed in [thi
* [(119) Can you add colors to the unified inbox widget?](#user-content-faq119)
* [(120) Why are new message notifications not removed on opening the app?](#user-content-faq120)
* [(121) How are messages grouped into a conversation?](#user-content-faq121)
* [(122) Why is the recipient name/email address show with a warning color?](#user-content-faq122)
* [~~(122) Why is the recipient name/email address show with a warning color?~~](#user-content-faq122)
* [(123) What does 'force sync'?](#user-content-faq123)
[I have another question.](#support)
@ -2090,11 +2090,11 @@ because this could result in grouping unrelated messages and would be at the exp
<br />
<a name="faq122"></a>
**(122) Why is the recipient name/email address show with a warning color?**
**~~(122) Why is the recipient name/email address show with a warning color?~~**
The recipient name and/or email address in the addresses section will be shown in a warning color
when the sender domain name and the domain name of the *to* address do not match.
Mostly this indicates that the message was received *via* an account with another email address.
~~The recipient name and/or email address in the addresses section will be shown in a warning color~~
~~when the sender domain name and the domain name of the *to* address do not match.~~
~~Mostly this indicates that the message was received *via* an account with another email address.~~
<br />

@ -493,6 +493,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
});
view.setOnKeyListener(this);
ivAuth.setOnClickListener(this);
ivSnoozed.setOnClickListener(this);
ivFlagged.setOnClickListener(this);
if (viewType == ViewType.THREAD)
@ -530,6 +531,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
touch.setOnClickListener(null);
view.setOnKeyListener(null);
ivAuth.setOnClickListener(null);
ivSnoozed.setOnClickListener(null);
ivFlagged.setOnClickListener(null);
if (viewType == ViewType.THREAD)
@ -998,24 +1000,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
String cc = MessageHelper.formatAddresses(message.cc);
String bcc = MessageHelper.formatAddresses(message.bcc);
boolean self = false;
InternetAddress via = null;
if (message.identityEmail != null)
try {
via = new InternetAddress(message.identityEmail, message.identityName);
if (message.to != null) {
String v = MessageHelper.canonicalAddress(via.getAddress());
for (Address t : message.to) {
if (EntityFolder.isOutgoing(message.folderType) ||
v.equals(MessageHelper.canonicalAddress(((InternetAddress) t).getAddress()))) {
self = true;
break;
}
}
}
} catch (UnsupportedEncodingException ignored) {
}
tvFromExTitle.setVisibility(show_addresses && !TextUtils.isEmpty(from) ? View.VISIBLE : View.GONE);
tvFromEx.setVisibility(show_addresses && !TextUtils.isEmpty(from) ? View.VISIBLE : View.GONE);
tvFromEx.setText(from);
@ -1023,8 +1007,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
tvToTitle.setVisibility(show_addresses && !TextUtils.isEmpty(to) ? View.VISIBLE : View.GONE);
tvTo.setVisibility(show_addresses && !TextUtils.isEmpty(to) ? View.VISIBLE : View.GONE);
tvTo.setText(to);
tvToTitle.setTextColor(self ? textColorSecondary : colorWarning);
tvTo.setTextColor(self ? textColorSecondary : colorWarning);
tvReplyToTitle.setVisibility(show_addresses && !TextUtils.isEmpty(replyto) ? View.VISIBLE : View.GONE);
tvReplyTo.setVisibility(show_addresses && !TextUtils.isEmpty(replyto) ? View.VISIBLE : View.GONE);
@ -1038,6 +1020,13 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
tvBcc.setVisibility(show_addresses && !TextUtils.isEmpty(bcc) ? View.VISIBLE : View.GONE);
tvBcc.setText(bcc);
InternetAddress via = null;
if (message.identityEmail != null)
try {
via = new InternetAddress(message.identityEmail, message.identityName);
} catch (UnsupportedEncodingException ignored) {
}
tvIdentityTitle.setVisibility(show_addresses && via != null ? View.VISIBLE : View.GONE);
tvIdentity.setVisibility(show_addresses && via != null ? View.VISIBLE : View.GONE);
tvIdentity.setText(via == null ? null : MessageHelper.formatAddresses(new Address[]{via}));
@ -1460,7 +1449,9 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
if (message == null)
return;
if (view.getId() == R.id.ivSnoozed)
if (view.getId() == R.id.ivAuth)
onShowAuth(message);
else if (view.getId() == R.id.ivSnoozed)
onShowSnoozed(message);
else if (view.getId() == R.id.ivFlagged)
onToggleFlag(message);
@ -1637,6 +1628,23 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
return false;
}
private void onShowAuth(TupleMessageEx message) {
List<String> result = new ArrayList<>();
if (Boolean.FALSE.equals(message.dkim))
result.add("DKIM");
if (Boolean.FALSE.equals(message.spf))
result.add("SPF");
if (Boolean.FALSE.equals(message.dmarc))
result.add("DMARC");
if (Boolean.FALSE.equals(message.mx))
result.add("MX");
ToastEx.makeText(context,
context.getString(R.string.title_authentication_failed, TextUtils.join(", ", result)),
Toast.LENGTH_LONG)
.show();
}
private void onShowSnoozed(TupleMessageEx message) {
if (message.ui_snoozed != null) {
DateFormat DTF = Helper.getDateTimeInstance(context, SimpleDateFormat.MEDIUM, SimpleDateFormat.SHORT);

@ -478,6 +478,7 @@
<string name="title_reply_template">Template</string>
<string name="title_moving">Moving to %1$s</string>
<string name="title_open_with">Open with</string>
<string name="title_authentication_failed">%1$s authentication failed</string>
<string name="title_receipt_subject">Read receipt: %1$s</string>
<string name="title_receipt_text">This read receipt only acknowledges that the message was displayed. There is no guarantee that the recipient has read the message contents.</string>

Loading…
Cancel
Save