HiraokaHyperTools / msgreader

40 stars 9 forks source link

Support of exporting inner msg in msg file #12

Closed kenjiuno closed 3 years ago

kenjiuno commented 3 years ago

It is same way as extracting other attachment files about extracting .msg in .msg:

program
  .command('dummy1')
  .action(() => {
    const msgFileBuffer = fs.readFileSync('test/msgInMsg.msg');
    const testMsg = new MsgReader(msgFileBuffer);
    const testMsgInfo = testMsg.getFileData();
    const testMsgAttachment0 = testMsg.getAttachment(0);
    console.log(testMsgAttachment0);
  });

Testing from cli.js

H:\Proj\msgreader>node cli dummy1
{
  fileName: 'Microsoft Outlook テスト メッセージ.msg',
  content: Uint8Array(16896) [
    208, 207,  17, 224, 161, 177,  26, 225,   0,   0,   0,   0,
      0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
     62,   0,   3,   0, 254, 255,   9,   0,   6,   0,   0,   0,
      0,   0,   0,   0,   0,   0,   0,   0,   1,   0,   0,   0,
      1,   0,   0,   0,   0,   0,   0,   0,   0,  16,   0,   0,
     17,   0,   0,   0,   1,   0,   0,   0, 254, 255, 255, 255,
      0,   0,   0,   0,   0,   0,   0,   0, 255, 255, 255, 255,
    255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
    255, 255, 255, 255,
    ... 16796 more items
  ]
}

11