fix: mail content decode (#3039)

* fix: mail content decode

* Update imap.js

* Update package.json

* Update yarn.lock
This commit is contained in:
Cloud
2019-09-11 14:29:25 +08:00
committed by DIYgod
parent 0602c059f3
commit 7ec90fd23c
+2 -1
View File
@@ -2,6 +2,7 @@ const ImapClient = require('emailjs-imap-client').default;
const queryString = require('query-string');
const config = require('@/config');
const parser = require('mailparser').simpleParser;
const iconv = require('iconv-lite');
module.exports = async (ctx) => {
const email = ctx.params.email;
@@ -56,7 +57,7 @@ module.exports = async (ctx) => {
if (cache) {
return Promise.resolve(JSON.parse(cache));
}
const description = await ParserMail(item['body[]']);
const description = await ParserMail(iconv.decode(item['body[]'], 'utf8'));
const single = {
title: item.envelope.subject,
description,