Skip to content

Commit

Permalink
fix: make sure references header only contains strings
Browse files Browse the repository at this point in the history
  • Loading branch information
AdriVanHoudt committed Jan 4, 2021
1 parent bb88293 commit 63199d7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict';

const _ = require('lodash');
const MailComposer = require('nodemailer/lib/mail-composer');
const SimpleParser = require('mailparser').simpleParser;

Expand Down Expand Up @@ -71,6 +72,15 @@ exports.parseRawMail = (rawMessage, callback) => {

return v;
});

// We want to make sure the references headers only contains strings, other stuff can lead to problems downstream
// See https://github.com/Salesflare/Server/issues/7122
if (key === 'references') {
parsedMail.headers[key] = parsedMail.headers[key].filter((reference) => {

return _.isString(reference);
});
}
});
}

Expand Down

0 comments on commit 63199d7

Please sign in to comment.