Permalink
Browse files

Strip out BCC before sending

  • Loading branch information...
1 parent 1e8a68c commit b0484838111f1f0e152a8a477a641791c294c8af @mronge mronge committed Jun 3, 2013
Showing with 14 additions and 0 deletions.
  1. +6 −0 Source/CTSMTPAsyncConnection.m
  2. +8 −0 Source/CTSMTPConnection.m
View
6 Source/CTSMTPAsyncConnection.m
@@ -213,9 +213,15 @@ - (void)sendMailThread {
if (!success) {
goto error;
}
+ NSSet *tmpBcc = theMessage.bcc;
+
+ // Temporarily wipe out BCC so it isn't sent with the message
+ theMessage.bcc = nil;
//send
success = [mSMTPObj setData:[theMessage render]];
+
+ theMessage.bcc = tmpBcc;
if (success) {
mStatus = CTSMTPAsyncSuccess;
} else if (success && [mMailThread isCancelled]) {
View
8 Source/CTSMTPConnection.m
@@ -92,9 +92,17 @@ + (BOOL)sendMessage:(CTCoreMessage *)message server:(NSString *)server username:
if (!success) {
goto error;
}
+
+ NSSet *tmpBcc = message.bcc;
+ // Temporarily wipe out BCC so it isn't sent with the message
+ message.bcc = nil;
+
/* data */
success = [smtpObj setData:[message render]];
+
+ message.bcc = tmpBcc;
+
if (!success) {
goto error;
}

0 comments on commit b048483

Please sign in to comment.