mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-24 15:11:03 +00:00
Fixed decryption
This commit is contained in:
parent
2a38a42f44
commit
a4dd59c97c
1 changed files with 12 additions and 8 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue