[isomorphic-core] Handle weird MIME edge case with @ symbol

Summary:
Something weird happens with the mime building when the participant name
has an @ symbol in it (e.g. a name and email of hello@gmail.com turns
into 'hello@ <gmail.com hello@gmail.com>'), so replace it with
whitespace.

Test Plan: manual

Reviewers: evan, mark, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D4363
This commit is contained in:
Halla Moore 2017-04-05 11:00:06 -07:00
parent be4b0d773c
commit e8957b787e

View file

@ -8,7 +8,10 @@ import {convertSmtpError} from './smtp-errors'
const MAX_RETRIES = 1;
const formatParticipants = (participants) => {
return participants.map(p => `${p.name} <${p.email}>`).join(',');
// Something weird happens with the mime building when the participant name
// has an @ symbol in it (e.g. a name and email of hello@gmail.com turns into
// 'hello@ <gmail.com hello@gmail.com>'), so replace it with whitespace.
return participants.map(p => `${p.name.replace('@', ' ')} <${p.email}>`).join(',');
}
class SendmailClient {