diff -r 4697dfb2d7ad -r 1d7827e39b52 email/pop3andsmtpmtm/servermtmutils/src/imcvrecv.cpp --- a/email/pop3andsmtpmtm/servermtmutils/src/imcvrecv.cpp Tue Feb 02 00:08:43 2010 +0200 +++ b/email/pop3andsmtpmtm/servermtmutils/src/imcvrecv.cpp Fri Feb 19 22:47:38 2010 +0200 @@ -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