diff -r 022fc9a9f172 -r 43cbef41dd6d email/pop3andsmtpmtm/servermtmutils/src/imcvrecv.cpp --- a/email/pop3andsmtpmtm/servermtmutils/src/imcvrecv.cpp Sun Mar 28 16:36:08 2010 +0100 +++ b/email/pop3andsmtpmtm/servermtmutils/src/imcvrecv.cpp Mon Mar 29 12:25:56 2010 +0100 @@ -254,11 +254,16 @@ // Folding headers, RFC 2822, section 2.2.3 { // make sure we're not about to exceed the buffer - if((iOutputLine->Length() + iInputLine.Length()) > iOutputLine->Des().MaxLength()) - iOutputLine = iOutputLine->ReAllocL(iOutputLine->Length() + iInputLine.Length()); - - // now copy the remaining data into the buffer - iOutputLine->Des().Append(iInputLine); + //Restricting the field size of the header to 5000, to avoid -4 error + //and which at times ends up in DOS condition [denial of service- user wouldn't be able to download any further mails]. + if (iOutputLine->Length()<5000) + { + if((iOutputLine->Length() + iInputLine.Length()) > iOutputLine->Des().MaxLength()) + iOutputLine = iOutputLine->ReAllocL(iOutputLine->Length() + iInputLine.Length()); + + // now copy the remaining data into the buffer + iOutputLine->Des().Append(iInputLine); + } } } else