Encode List-ID header, allow access to campaigns with deleted list

This commit is contained in:
Andris Reinman 2016-08-10 20:45:29 +03:00
parent 0b6d549af4
commit fb7fd7238f
4 changed files with 29 additions and 21 deletions

View file

@ -16,6 +16,7 @@ let url = require('url');
let htmlToText = require('html-to-text');
let request = require('request');
let caches = require('../lib/caches');
let libmime = require('libmime');
function findUnsent(callback) {
let returnUnsent = (row, campaign) => {
@ -307,7 +308,7 @@ function formatMessage(message, callback) {
}),
'List-ID': {
prepared: true,
value: '"' + list.name.replace(/[^a-z0-9\s'.,\-]/g, '').trim() + '" <' + list.cid + '.' + (url.parse(configItems.serviceUrl).hostname || 'localhost') + '>'
value: libmime.encodeWords(list.name) + ' <' + list.cid + '.' + (url.parse(configItems.serviceUrl).hostname || 'localhost') + '>'
}
},
list: {