mscdex / node-imap

An IMAP client module for node.js.
MIT License
2.14k stars 379 forks source link

the attachment filename is messy code #870

Open Blue51 opened 2 years ago

Blue51 commented 2 years ago

when I use fetch function to get the attachment , and find the attachment filename is messy code. here is the log of attributes.struct

{
  struct: [
    {
      type: "mixed",
      params: {
        boundary: "----=_Part_2334289_269021430.1647946847692",
      },
      disposition: null,
      language: null,
    },
    [
      {
        partID: "1",
        type: "text",
        subtype: "html",
        params: {
          charset: "GBK",
        },
        id: null,
        description: null,
        encoding: "QUOTED-PRINTABLE",
        size: 3043,
        lines: 59,
        md5: null,
        disposition: null,
        language: null,
      },
    ],
    [
      {
        partID: "2",
        type: "application",
        subtype: "octet-stream",
        params: {
          name: "������ֵ���ֹ��㡿\r\n SJH578_���氲ӯ���6��˽ļ֤ȯͶ�ʻ���_2022-03-21.xlsx",
        },
        id: null,
        description: null,
        encoding: "BASE64",
        size: 9446,
        md5: null,
        disposition: {
          type: "attachment",
          params: {
            filename: "������ֵ���ֹ��㡿\r\n SJH578_���氲ӯ���6��˽ļ֤ȯͶ�ʻ���_2022-03-21.xlsx",
          },
        },
        language: null,
      },
    ],
  ]
}
trasherdk commented 2 years ago

Looks like you are missing utf-8 support.