Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix produced text address list string according to rfc 2822 #340

Merged
merged 1 commit into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/mail-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,7 @@ class MailParser extends Transform {
.map(address => {
let str = '';
if (address.name) {
str += address.name + (address.group ? ': ' : '');
str += `"${address.name}"` + (address.group ? ': ' : '');
}
if (address.address) {
let link = address.address;
Expand Down
2 changes: 1 addition & 1 deletion test/simple-parser-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module.exports['Parse message'] = test => {
}
],
html: '<span class="mp_address_group"><span class="mp_address_name">Andris Reinman</span> &lt;<a href="mailto:andris+123@kreata.ee" class="mp_address_email">andris+123@kreata.ee</a>&gt;</span>, <span class="mp_address_group"><a href="mailto:andris.reinman@gmail.com" class="mp_address_email">andris.reinman@gmail.com</a></span>',
text: 'Andris Reinman <andris+123@kreata.ee>, andris.reinman@gmail.com'
text: '"Andris Reinman" <andris+123@kreata.ee>, andris.reinman@gmail.com'
});
test.done();
});
Expand Down