Explain non-delivery notification

pull/217/head
M66B 9 months ago
parent 30d8003071
commit 81cd19ee0c

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

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

@ -1681,6 +1681,7 @@
<string name="title_attachment_saved">Attachment saved</string> <string name="title_attachment_saved">Attachment saved</string>
<string name="title_attachments_saved">Attachments 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_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_save">Save changes?</string>
<string name="title_ask_delete">Delete message permanently?</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> <string name="title_ask_delete_accept">I understand that permanently deleting messages is irreversible</string>

Loading…
Cancel
Save