-
-
Notifications
You must be signed in to change notification settings - Fork 288
Open
Labels
Description
See mail-parser.js at line 396:
// keep only the first value
let singleKeys = [
'message-id',
'content-id',
'from',
'sender',
'in-reply-to',
'reply-to',
'subject',
'date',
'content-disposition',
'content-type',
'content-transfer-encoding',
'priority',
'mime-version',
'content-description',
'precedence',
'errors-to',
'disposition-notification-to'
];
headers.forEach((value, key) => {
if (Array.isArray(value)) {
if (singleKeys.includes(key) && value.length) {
headers.set(key, value[value.length - 1]);
} else if (value.length === 1) {
headers.set(key, value[0]);
}
}
if (key === 'list') {
// normalize List-* headers
let listValue = {};
[].concat(value || []).forEach(val => {
Object.keys(val || {}).forEach(listKey => {
listValue[listKey] = val[listKey];
});
});
headers.set(key, listValue);
}
});
Comment says it should keep the first item, but instead we get the last one