1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-28 10:47:28 +00:00

Added logging

This commit is contained in:
M66B 2022-07-19 08:11:50 +02:00
parent 4324d22585
commit ac3ac4330f

View file

@ -4258,9 +4258,10 @@ public class MessageHelper {
try { try {
Log.d("Part class=" + part.getClass() + " type=" + part.getContentType()); Log.d("Part class=" + part.getClass() + " type=" + part.getContentType());
// https://github.com/autocrypt/protected-headers
try { try {
ContentType ct = new ContentType(part.getContentType()); ContentType ct = new ContentType(part.getContentType());
// https://github.com/autocrypt/protected-headers
if ("v1".equals(ct.getParameter("protected-headers"))) { if ("v1".equals(ct.getParameter("protected-headers"))) {
String[] subject = part.getHeader("subject"); String[] subject = part.getHeader("subject");
if (subject != null && subject.length != 0) { if (subject != null && subject.length != 0) {
@ -4268,6 +4269,15 @@ public class MessageHelper {
parts.protected_subject = decodeMime(subject[0]); parts.protected_subject = decodeMime(subject[0]);
} }
} }
// https://en.wikipedia.org/wiki/MIME#Multipart_subtypes
if ("multipart".equals(ct.getPrimaryType()) &&
!("mixed".equalsIgnoreCase(ct.getSubType()) ||
"alternative".equalsIgnoreCase(ct.getSubType()) ||
"related".equalsIgnoreCase(ct.getSubType()) ||
"report".equalsIgnoreCase(ct.getSubType()))) {
Log.e(part.getContentType());
}
} catch (Throwable ex) { } catch (Throwable ex) {
Log.e(ex); Log.e(ex);
} }