mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-02 14:07:04 +03:00
Resolve #248 View eml attachments
This commit is contained in:
parent
17de4268b0
commit
e205a0d3e0
4 changed files with 62 additions and 64 deletions
|
|
@ -1,6 +1,7 @@
|
|||
|
||||
import { ParseMime } from 'Mime/Parser';
|
||||
import { AttachmentModel } from 'Model/Attachment';
|
||||
import { EmailModel } from 'Model/Email';
|
||||
import { FileInfo } from 'Common/File';
|
||||
import { BEGIN_PGP_MESSAGE } from 'Stores/User/Pgp';
|
||||
|
||||
|
|
@ -16,6 +17,17 @@ export function MimeToMessage(data, message)
|
|||
let html = struct.getByContentType('text/html');
|
||||
html = html ? html.body : '';
|
||||
|
||||
if (struct.headers.subject) {
|
||||
message.subject(struct.headers.subject.value);
|
||||
}
|
||||
['from','to'].forEach(name => {
|
||||
if (struct.headers[name]) {
|
||||
let mail = new EmailModel;
|
||||
mail.parse(struct.headers[name].value);
|
||||
message[name].push(mail);
|
||||
}
|
||||
});
|
||||
|
||||
struct.forEach(part => {
|
||||
let cd = part.header('content-disposition'),
|
||||
cid = part.header('content-id'),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue