diff --git a/ChangeLog b/ChangeLog index dee38e597..49f6d8c0d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-06-28 Ludovic Marcotte + + * SOPE/sope-patchset-r1664.diff + Fixed the LF/CRLF encoding issue in NGSmtpClient.m + 2010-06-28 Francis Lachapelle * UI/Contacts/UIxContactEditor.m (-initSnapshot, -_saveSnapshot): diff --git a/SOPE/sope-patchset-r1664.diff b/SOPE/sope-patchset-r1664.diff index 96d9bc415..ee094e120 100644 --- a/SOPE/sope-patchset-r1664.diff +++ b/SOPE/sope-patchset-r1664.diff @@ -4001,6 +4001,57 @@ Index: sope-mime/NGMail/NGSmtpClient.m if ([reply isPositive]) { if ([reply code] != NGSmtpActionCompleted) { NSLog(@"SMTP(RCPT TO): expected reply code %i, got code %i ..", +@@ -507,6 +522,10 @@ + NGSmtpResponse *reply = nil; + NSMutableData *cleaned_data; + NSRange r1, r2; ++ ++ const char *bytes; ++ char *mbytes; ++ int len, mlen; + + [self requireState:NGSmtpState_TRANSACTION]; + +@@ -519,8 +538,38 @@ + } + [self->text flush]; + +- cleaned_data = [NSMutableData dataWithData: _data]; ++ // ++ // SOPE sucks in many ways and that is one of them. The headers are actually ++ // correctly encoded (trailing \r\n is inserted) but not the base64 encoded ++ // data since it uses GNUstep's dataByEncodingBase64 function which says: ++ // ++ // NGBase64Coding.h:- (NSData *)dataByEncodingBase64; /* Note: inserts '\n' every 72 chars */ ++ // ++ len = [_data length]; ++ mlen = 0; + ++ cleaned_data = [NSMutableData dataWithLength: len*2]; ++ ++ bytes = [_data bytes]; ++ mbytes = [cleaned_data mutableBytes]; ++ ++ while (len > 0) ++ { ++ if (*bytes == '\n' && *(bytes-1) != '\r' && mlen > 0) ++ { ++ *mbytes = '\r'; ++ mbytes++; ++ mlen++; ++ } ++ ++ *mbytes = *bytes; ++ mbytes++; bytes++; ++ len--; ++ mlen++; ++ } ++ ++ [cleaned_data setLength: mlen]; ++ + // + // According to RFC 2821 section 4.5.2, we must check for the character + // sequence "."; any occurrence have its period duplicated Index: sope-mime/NGMail/NGMailAddressParser.h =================================================================== --- sope-mime/NGMail/NGMailAddressParser.h (revision 1664)