papnkukn / eml-format

RFC 822 EML file format parser and builder
MIT License
84 stars 51 forks source link

Long Subjects are truncated #27

Open PabloBrianese opened 2 years ago

PabloBrianese commented 2 years ago

Hello, and thank you very much for the work that goes into this module.

I run into this problem trying to read some real emails. The example string is extracted from a real email. If it matters, the .eml file was downloaded from Gmail.

Example

var emlformat = require('eml-format')
var longString = '=?UTF-8?Q?Fwd=3A_Webinario_SemACT=2DUNS_=2D_viernes_13=2F08=2C_14_hs_=2D_L?=\r\n' +
    '=?UTF-8?Q?eonardo_Alarcon_=28UNS=29_=5B=C2=A1se_agradece_difusi=C3=B3n=21=5D?='
var unquoted = emlformat.unquoteString(longString)
console.log(unquoted)
// Logs just half the string:
// Fwd:_Webinario_SemACT-UNS_-_viernes_13/08,_14_hs_-_L

I think I have identified the problem in the regular expresion capturing groups, and that I can fix it. I will try to help solve the issue later.