add: KMMessage* msg = new KMMessage;  msg->initFromMessage( aMsg );  QString st = QString::fromUtf8( aMsg->createForwardBody() ); QCString encoding = KMMsgBase::autoDetectCharset( aMsg->charset(), KMMessage::preferredCharsets(), st ); if( encoding.isEmpty() ) encoding = "utf-8"; QCString str = KMMsgBase::codecForName( encoding )->fromUnicode( st );  msg->setCharset( encoding ); msg->setTo( mParameter ); msg->setSubject( "Fwd: " + aMsg->subject() );  bool isQP = kmkernel->msgSender()->sendQuotedPrintable();  if( aMsg->numBodyParts() == 0 ) { msg->setAutomaticFields( true ); msg->setHeaderField( "Content-Type", "text/plain" );  QValueList<int> dummy; msg->setBodyAndGuessCte(str, dummy, !isQP); msg->setCharset( encoding ); if( isQP ) msg->setBodyEncoded( str ); else msg->setBody( str ); } else { KMMessagePart bodyPart, msgPart;  msg->removeHeaderField( "Content-Type" ); msg->removeHeaderField( "Content-Transfer-Encoding" ); msg->setAutomaticFields( true ); msg->setBody( "This message is in MIME format.\n\n" );  bodyPart.setTypeStr( "text" ); bodyPart.setSubtypeStr( "plain" );  QValueList<int> dummy; bodyPart.setBodyAndGuessCte(str, dummy, !isQP); bodyPart.setCharset( encoding ); bodyPart.setBodyEncoded( str ); msg->addBodyPart( &bodyPart );  for( int i = 0; i < aMsg->numBodyParts(); i++ ) { aMsg->bodyPart( i, &msgPart ); if( i > 0 || qstricmp( msgPart.typeStr(), "text" ) != 0 ) msg->addBodyPart( &msgPart ); } } msg->cleanupHeader(); msg->link( aMsg, KMMsgStatusForwarded );  sendMDN( aMsg, KMime::MDN::Dispatched );  if ( !kmkernel->msgSender()->send( msg, FALSE ) ) { kdDebug(5006) << "KMFilterAction: could not forward message (sending failed)" << endl; return ErrorButGoOn; }
context: KMFilterAction::ReturnCode KMFilterActionBounce::process(KMMessage* msg) const{  KMMessage *bounceMsg = msg->createBounce( FALSE );  if ( !bounceMsg ) return ErrorButGoOn;  // Queue message. This is a) so that the user can check  // the bounces before sending and b) for speed reasons.  kmkernel->msgSender()->send( bounceMsg, FALSE );  return GoOn;}