mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-24 16:53:37 +00:00
TNEF attachment filename eval
This commit is contained in:
parent
e9c0bfa542
commit
d469c9827f
1 changed files with 11 additions and 2 deletions
|
@ -2129,7 +2129,7 @@ public class MessageHelper {
|
|||
attachment.message = local.message;
|
||||
attachment.sequence = local.sequence;
|
||||
attachment.subsequence = ++subsequence;
|
||||
attachment.name = "document.rtf";
|
||||
attachment.name = "body.rtf";
|
||||
attachment.type = "application/rtf";
|
||||
attachment.disposition = Part.ATTACHMENT;
|
||||
attachment.id = db.attachment().insertAttachment(attachment);
|
||||
|
@ -2139,11 +2139,20 @@ public class MessageHelper {
|
|||
}
|
||||
|
||||
for (org.apache.poi.hmef.Attachment at : msg.getAttachments()) {
|
||||
String filename = at.getLongFilename();
|
||||
if (filename == null)
|
||||
filename = at.getFilename();
|
||||
if (filename == null) {
|
||||
String ext = at.getExtension();
|
||||
if (ext != null)
|
||||
filename = "document." + ext;
|
||||
}
|
||||
|
||||
EntityAttachment attachment = new EntityAttachment();
|
||||
attachment.message = local.message;
|
||||
attachment.sequence = local.sequence;
|
||||
attachment.subsequence = ++subsequence;
|
||||
attachment.name = at.getLongFilename();
|
||||
attachment.name = filename;
|
||||
attachment.type = Helper.guessMimeType(attachment.name);
|
||||
attachment.disposition = Part.ATTACHMENT;
|
||||
attachment.id = db.attachment().insertAttachment(attachment);
|
||||
|
|
Loading…
Reference in a new issue