Bug 100249 - Regression: "Forward inline" keeps Cc'ed addresses from the original message listed when composer is opened
Summary: Regression: "Forward inline" keeps Cc'ed addresses from the original message ...
Status: RESOLVED FIXED
Alias: None
Product: kmail
Classification: Applications
Component: general (show other bugs)
Version: 1.8
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Till Adam
URL:
Keywords:
: 101681 102128 102151 103348 104400 106150 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-02-25 14:08 UTC by Andreas Gungl
Modified: 2009-12-06 16:59 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Gungl 2005-02-25 14:08:41 UTC
Version:           1.8 (using KDE 3.3.92 (beta2), compiled sources)
Compiler:          gcc version 3.3.4 (pre 3.3.5 20040809)
OS:                Linux (i686) release 2.6.8-24.11-default

How to reporduce:

Select a received message with a CC address. Choose Forward Inline. The opened composer has the CC address fo the original message preset as new target address.

Expected behavior:

No address should be selected at all (despite some preset data based on the settings of the identity). BTW, Forward as Attachment still works as expected.
Comment 1 Andreas Gungl 2005-03-17 15:38:11 UTC
*** Bug 101681 has been marked as a duplicate of this bug. ***
Comment 2 Till Adam 2005-03-17 20:14:16 UTC
Fixed in HEAD, backport pending.
Comment 3 Till Adam 2005-03-22 21:41:02 UTC
*** Bug 102128 has been marked as a duplicate of this bug. ***
Comment 4 Till Adam 2005-03-26 18:24:36 UTC
CVS commit by tilladam: 

Backport fix for inline forwarding. It seems safe.

BUGS: 100249


  M +15 -45    kmmessage.cpp   1.518.2.1


--- kdepim/kmail/kmmessage.cpp  #1.518:1.518.2.1
@@ -1158,9 +1158,23 @@ KMMessage* KMMessage::createForward()
 
   msg->fromDwString( this->asDwString() );
-  msg->cleanupHeader();
   // remember the type and subtype, initFromMessage sets the contents type to 
   // text/plain, via initHeader, for unclear reasons
   const int type = msg->type();
   const int subtype = msg->subtype();
+
+  // Strip out all headers apart from the content description ones, because we
+  // don't want to inherit them.
+  DwHeaders& header = msg->mMsg->Headers();
+  DwField* field = header.FirstField();
+  DwField* nextField;
+  while (field)
+  {
+    nextField = field->Next();
+    if ( ! QString( field->FieldNameStr().c_str() ).contains( "ontent" ) )
+      header.RemoveField(field);
+    field = nextField;
+  }
+  msg->mMsg->Assemble();
+
   msg->initFromMessage( this );
   //restore type
@@ -1174,49 +1188,5 @@ KMMessage* KMMessage::createForward()
 
   msg->setSubject( forwardSubject() );
-  msg->removePrivateHeaderFields();
-  msg->removeHeaderField( "Sender" );
- 
-#ifdef BROKEN_FOR_OPAQUE_SIGNED_OR_ENCRYPTED_MAILS
-  QCString str = codecForName(encoding)->fromUnicode(st);
-  msg->setBody(str);
-
-  if (numBodyParts() > 0)
-  {
-    msg->setType( DwMime::kTypeMultipart );
-    msg->setSubtype( DwMime::kSubtypeMixed );
-    msg->headers().ContentType().CreateBoundary( 0 );
-    msg->headers().ContentType().Assemble();
-
-    msgPart.setTypeStr("text");
-    msgPart.setSubtypeStr("plain");
-    msgPart.setCharset(encoding);
-    msgPart.setBody(str);
-    msg->addBodyPart(&msgPart);
-
-    bool outsideRfc822 = true;
-    for ( int i = 0; i < numBodyParts(); i++)
-    {
-      bodyPart(i, &msgPart);
-      QCString mimeType( msgPart.typeStr() + '/' + msgPart.subtypeStr() );
-      if ( kasciistricmp( mimeType, "message/rfc822" ) != 0 ) // != message/rfc822
-        outsideRfc822 = true;
-      // don't add the detached signature as attachment when forwarding a
-      // PGP/MIME signed message inline
-      if( outsideRfc822 &&
-          kasciistricmp( mimeType, "application/pgp-signature" ) != 0 ) { // != application/pgp-signature
-        if (i > 0 || kasciistricmp(msgPart.typeStr(),"text") != 0)
-          msg->addBodyPart(&msgPart);
-      }
-      // avoid kind of recursive attaching of rfc822 parts
-      if ( kasciistricmp( mimeType, "message/rfc822" ) == 0 ) // == message/rfc822
-        outsideRfc822 = false;
-    }
-  }
-#endif // BROKEN_FOR_OPAQUE_SIGNED_OR_ENCRYPTED_MAILS
-
-  
-  // setStatus(KMMsgStatusForwarded);
   msg->link(this, KMMsgStatusForwarded);
-
   return msg;
 }
Comment 5 Till Adam 2005-03-28 12:08:23 UTC
*** Bug 102151 has been marked as a duplicate of this bug. ***
Comment 6 Andreas Gungl 2005-04-06 12:13:50 UTC
*** Bug 103348 has been marked as a duplicate of this bug. ***
Comment 7 Thiago Macieira 2005-04-23 01:19:51 UTC
*** Bug 104400 has been marked as a duplicate of this bug. ***
Comment 8 Andreas Gungl 2005-05-31 06:45:03 UTC
*** Bug 106150 has been marked as a duplicate of this bug. ***