1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-01-04 22:40:32 +00:00

Explain non-delivery notification

This commit is contained in:
M66B 2024-12-24 14:01:13 +01:00
parent 30d8003071
commit 81cd19ee0c
3 changed files with 13 additions and 5 deletions

View file

@ -4914,7 +4914,7 @@ class Core {
if (mdn && helper.isReport())
try {
MessageHelper.Report r = parts.getReport();
MessageHelper.Report r = parts.getReport(context);
boolean client_id = prefs.getBoolean("client_id", true);
String we = "dns;" + (client_id ? EmailService.getDefaultEhlo() : "example.com");
if (r != null && !we.equals(r.reporter)) {

View file

@ -4244,7 +4244,7 @@ public class MessageHelper {
HtmlHelper.formatPlainText(result) +
"</pre>";
} else if (h.isReport()) {
Report report = new Report(h.contentType.getBaseType(), result);
Report report = new Report(h.contentType.getBaseType(), result, context);
result = report.html;
StringBuilder w = new StringBuilder();
@ -4286,7 +4286,7 @@ public class MessageHelper {
return sb.toString();
}
Report getReport() throws MessagingException, IOException {
Report getReport(Context context) throws MessagingException, IOException {
for (PartHolder h : extra)
if (h.isReport()) {
String result;
@ -4297,7 +4297,7 @@ public class MessageHelper {
result = Helper.readStream((InputStream) content);
else
result = content.toString();
return new Report(h.contentType.getBaseType(), result);
return new Report(h.contentType.getBaseType(), result, context);
}
return null;
}
@ -6062,7 +6062,7 @@ public class MessageHelper {
String feedback;
String html;
Report(String type, String content) {
Report(String type, String content, Context context) {
this.type = type;
StringBuilder report = new StringBuilder();
report.append("<hr><div style=\"font-family: monospace; font-size: small;\">");
@ -6138,7 +6138,14 @@ public class MessageHelper {
Log.e(ex);
report.append(TextUtils.htmlEncode(new ThrowableWrapper(ex).toSafeString()));
}
report.append("</div>");
if (isDeliveryStatus() && !isDelivered())
report.append("<br><div style=\"font-size: small; font-style: italic;\">")
.append(TextUtils.htmlEncode(context.getString(R.string.title_report_remark)))
.append("</div>");
this.html = report.toString();
}

View file

@ -1681,6 +1681,7 @@
<string name="title_attachment_saved">Attachment saved</string>
<string name="title_attachments_saved">Attachments saved</string>
<string name="title_attachments_incomplete">Some attachments or images were not downloaded and could not be added</string>
<string name="title_report_remark">This report, a specially formatted email, was sent by an email server because a sent message could not be delivered to the recipient, for example because the mailbox is full, or because the email address does not exist (anymore).</string>
<string name="title_ask_save">Save changes?</string>
<string name="title_ask_delete">Delete message permanently?</string>
<string name="title_ask_delete_accept">I understand that permanently deleting messages is irreversible</string>