diff --git a/app/src/main/java/eu/faircode/email/MessageHelper.java b/app/src/main/java/eu/faircode/email/MessageHelper.java index d0a081fd61..774a46fcd7 100644 --- a/app/src/main/java/eu/faircode/email/MessageHelper.java +++ b/app/src/main/java/eu/faircode/email/MessageHelper.java @@ -2527,6 +2527,10 @@ public class MessageHelper { } } } else if (h.isDSN()) { + String action = null; + String diag = null; + String status = null; + StringBuilder report = new StringBuilder(); report.append("
"); for (String line : result.split("\\r?\\n")) @@ -2549,10 +2553,27 @@ public class MessageHelper { .append(": ") .append(TextUtils.htmlEncode(value)) .append("
"); + + // https://datatracker.ietf.org/doc/html/rfc3464#section-2.3 + switch (name) { + case "Action": + action = value; + break; + case "Status": + status = value; + break; + case "Diagnostic-Code": + diag = value; + break; + } } } report.append("
"); result = report.toString(); + + if (diag != null && + ("failed".equals(action) || "delayed".equals(action))) + warnings.add(diag + (status == null ? "" : " (" + status + ")")); } else Log.w("Unexpected content type=" + h.contentType);