mirror of
https://github.com/nodemailer/wildduck.git
synced 2025-02-25 08:23:43 +08:00
ensure that in-reply-to and message-id headers are stored as single strings, not arrays
This commit is contained in:
parent
bb59b538e6
commit
803e21a9a8
2 changed files with 16 additions and 1 deletions
|
@ -559,6 +559,12 @@ module.exports.getQueryResponse = function (query, message, options) {
|
|||
case 'envelope':
|
||||
if (message.envelope) {
|
||||
value = message.envelope;
|
||||
// cast invalidly stored In-Reply-To (8) and Message-ID (9) to strings
|
||||
for (let index of [9, 10]) {
|
||||
if (value[index] && Array.isArray(value[index])) {
|
||||
value[index] = value[index].pop() || null;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!mimeTree) {
|
||||
mimeTree = indexer.parseMimeTree(message.raw);
|
||||
|
|
|
@ -217,7 +217,16 @@ class MIMEParser {
|
|||
});
|
||||
|
||||
// ensure single value for selected fields
|
||||
['content-transfer-encoding', 'content-id', 'content-description', 'content-language', 'content-md5', 'content-location'].forEach(key => {
|
||||
[
|
||||
'in-reply-to',
|
||||
'message-id',
|
||||
'content-transfer-encoding',
|
||||
'content-id',
|
||||
'content-description',
|
||||
'content-language',
|
||||
'content-md5',
|
||||
'content-location'
|
||||
].forEach(key => {
|
||||
if (Array.isArray(this._node.parsedHeader[key])) {
|
||||
this._node.parsedHeader[key] = this._node.parsedHeader[key].pop();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue