From e8957b787e22c896ce3bb6de019450a1a6735b99 Mon Sep 17 00:00:00 2001 From: Halla Moore Date: Wed, 5 Apr 2017 11:00:06 -0700 Subject: [PATCH] [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@ '), so replace it with whitespace. Test Plan: manual Reviewers: evan, mark, juan Reviewed By: juan Differential Revision: https://phab.nylas.com/D4363 --- packages/isomorphic-core/src/sendmail-client.es6 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/isomorphic-core/src/sendmail-client.es6 b/packages/isomorphic-core/src/sendmail-client.es6 index 56f165abc..9a94b75ff 100644 --- a/packages/isomorphic-core/src/sendmail-client.es6 +++ b/packages/isomorphic-core/src/sendmail-client.es6 @@ -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@ '), so replace it with whitespace. + return participants.map(p => `${p.name.replace('@', ' ')} <${p.email}>`).join(','); } class SendmailClient {