Outlook中的HTML格式的msg格式

有没有任何纯粹的开源解决scheme直接从Javascript和/或NodeJSparsingOutlook味精格式? 我相信有必要在nodemailer中支持Outlook msg格式,它至less能正确parsingeml。 到目前为止,我找不到比依靠linux命令行更好的方法:

  • 使用msgconvert linux命令从msg转到eml:

    sudo apt install -y libemail-outlook-message-perl cd /tmp msgconvert test\ with\ html\ content.msg # creates test\ with\ html\ content.eml 
  • 使用https://github.com/nodemailer/mailparser从eml获取信息,例如:

     git clone https://github.com/nodemailer/mailparser.git npm install cd mailparser/examples node extractInfoFromEml.js /tmp/test\ with\ html\ content.eml 
  • 下面是extractInfoFromEml.js的代码(只是simple.js,但接受一个参数。

     'use strict'; const util = require('util'); const fs = require('fs'); const simpleParser = require('../lib/simple-parser.js'); const args = process.argv.slice(2); const filePath = args[0]; let input = fs.createReadStream(filePath); simpleParser(input) .then(mail => { console.log(util.inspect(mail, false, 22)); }) .catch(err => { console.log(err); }); 

    PS:显然nodemailer接受只是错误,所以我不能要求在github的function要求。