mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-25 15:32:52 +00:00
Show DSN diagnostic code
This commit is contained in:
parent
db724f339f
commit
0a2edac07b
1 changed files with 21 additions and 0 deletions
|
@ -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("<hr><div style=\"font-family: monospace; font-size: small;\">");
|
||||
for (String line : result.split("\\r?\\n"))
|
||||
|
@ -2549,10 +2553,27 @@ public class MessageHelper {
|
|||
.append(": ")
|
||||
.append(TextUtils.htmlEncode(value))
|
||||
.append("<br>");
|
||||
|
||||
// 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("</div>");
|
||||
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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue