From: Gary E. M. <ge...@re...> - 2001-04-16 21:09:53
|
Yo All! I have a problem with the emailed tripwire reports. When I receive the reports tey show up as an attachment which I have to open. This is not good. I have submitted this as bug 416515. The problem seems to be in this header: Content-Transfer-Type: 7-bit If the header is not sent then I have no problem. The header specifies the default MIME behavior so is never required. See RFC 2045 page 15. Below is a patch to smtpmailmessage.cpp and pipedmailmessage.cpp to correct this behavior. Since both files do almost the same thing the best thing would be to merge those two files, but I thought I should start small. RGDS GARY --------------------------------------------------------------------------- Gary E. Miller Rellim 20340 Empire Ave, Suite E-3, Bend, OR 97701 ge...@re... Tel:+1(541)382-8588 Fax: +1(541)382-8676 --- smtpmailmessage.cpp.dist Mon Apr 16 13:37:57 2001 +++ smtpmailmessage.cpp Mon Apr 16 13:38:43 2001 @@ -419,28 +419,27 @@ // Determine encoding needed for body or attachments //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - std::string sContentType = "Content-Transfer-Encoding: "; if( cMailMessageUtil::HasNonAsciiChars( sSend ) ) { + std::string sContentType = "Content-Transfer-Encoding: "; // encode text sSend = iMimeEncoding::GetInstance()->Encode( sSend, cMailMessageUtil::_MAX_RFC822_LINE_LEN ); // identify content type sContentType += iMimeEncoding::GetInstance()->GetContentTypeIdentifier(); + sContentType += "7-bit"; + // send content type + sContentType += "\r\n"; + SendString( sContentType ); } else { // do no encoding - // identify content type - sContentType += "7-bit"; } - // send content type - sContentType += "\r\n"; - SendString( sContentType ); //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // Send Body and Attachments --- pipedmailmessage.cpp.dist Mon Apr 16 13:34:50 2001 +++ pipedmailmessage.cpp Mon Apr 16 13:37:17 2001 @@ -112,28 +112,27 @@ // Determine encoding needed for body or attachments //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - std::string sContentType = "Content-Transfer-Encoding: "; if( cMailMessageUtil::HasNonAsciiChars( sSend ) ) { + std::string sContentType = "Content-Transfer-Encoding: "; + // encode text sSend = iMimeEncoding::GetInstance()->Encode( sSend, cMailMessageUtil::_MAX_RFC822_LINE_LEN ); // identify content type sContentType += iMimeEncoding::GetInstance()->GetContentTypeIdentifier(); + // send content type + sContentType += "\r\n"; + SendString( cStringUtil::StrToTstr( sContentType ) ); + } else { - // do no encoding + // do no encoding, and do not send content type header. - // identify content type - sContentType += "7-bit"; } - - // send content type - sContentType += "\r\n"; - SendString( cStringUtil::StrToTstr( sContentType ) ); //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // Send Body and Attachments |