|
|
|
@ -1059,8 +1059,10 @@ public class MessageHelper {
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
ContentType ct = new ContentType(cpart.getContentType());
|
|
|
|
|
if ("application/pgp-encrypted".equals(ct.getBaseType().toLowerCase()))
|
|
|
|
|
if ("application/pgp-encrypted".equals(ct.getBaseType().toLowerCase())) {
|
|
|
|
|
pgp = true;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
} catch (ParseException ex) {
|
|
|
|
|
Log.w(ex);
|
|
|
|
|
}
|
|
|
|
@ -1144,13 +1146,15 @@ public class MessageHelper {
|
|
|
|
|
|
|
|
|
|
// Try to guess a better content type
|
|
|
|
|
// For example, sometimes PDF files are sent as application/octet-stream
|
|
|
|
|
String extension = Helper.getExtension(apart.attachment.name);
|
|
|
|
|
if (extension != null) {
|
|
|
|
|
String type = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension.toLowerCase());
|
|
|
|
|
if (type != null) {
|
|
|
|
|
if (!type.equals(apart.attachment.type))
|
|
|
|
|
Log.w("Guessing file=" + apart.attachment.name + " type=" + type);
|
|
|
|
|
apart.attachment.type = type;
|
|
|
|
|
if (!apart.pgp) {
|
|
|
|
|
String extension = Helper.getExtension(apart.attachment.name);
|
|
|
|
|
if (extension != null) {
|
|
|
|
|
String type = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension.toLowerCase());
|
|
|
|
|
if (type != null) {
|
|
|
|
|
if (!type.equals(apart.attachment.type))
|
|
|
|
|
Log.w("Guessing file=" + apart.attachment.name + " type=" + type);
|
|
|
|
|
apart.attachment.type = type;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|