Skip to content

Commit

Permalink
fix(address): do not use '@' instead of empyt address if a field does…
Browse files Browse the repository at this point in the history
… not contain a value
  • Loading branch information
andris9 committed Feb 12, 2024
1 parent 5921ba1 commit aeabbde
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions lib/tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -423,10 +423,19 @@ module.exports = {
};

let processAddresses = function (list) {
return [].concat(list || []).map(addr => ({
name: module.exports.processName(libmime.decodeWords(getStrValue(addr[0]))),
address: (getStrValue(addr[2]) || '') + '@' + (getStrValue(addr[3]) || '')
}));
return []
.concat(list || [])
.map(addr => {
let address = (getStrValue(addr[2]) || '') + '@' + (getStrValue(addr[3]) || '');
if (address === '@') {
address = '';
}
return {
name: module.exports.processName(libmime.decodeWords(getStrValue(addr[0]))),
address
};
})
.filter(addr => addr.name || addr.address);
},
envelope = {};

Expand Down

0 comments on commit aeabbde

Please sign in to comment.