--===============0834388829== Content-Type: multipart/signed; boundary="nextPart3603994.2U0zaZhII9"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit --nextPart3603994.2U0zaZhII9 Content-Type: multipart/mixed; boundary="Boundary-01=_sB8gGeMZ+ZmXNzi" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-01=_sB8gGeMZ+ZmXNzi Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Ok, I have something that works now. The problem with IMAP accounts was tha= t,=20 altough headers were properly parsed, the encryption and signature (at leas= t=20 those two) ones were ignored. I'm sending the patch for this, but I need to mention a couple of issues th= at=20 might come up: _ the modifications in headeritem.cpp: I don't know if the key generation i= s=20 for the index or not, but by modifying the switch (see path), that could be= a=20 small problem since s=3D"5" now is not the default case anymore _ KMMsgSignatureTemporarilyDisabled means that the message is not signed,=20 therefore the modifications in kmcommans.cpp, but I'm not 100% certain abou= t=20 those, someone needs to check _ same comment for kmfolderimap.cpp and modification in=20 KMReaderWin::slotTouchMessage() _ last but NOT least, kmmessage.cpp, KMMessage::fromDwString a quick couple of greps showed that the boolean passed as parameter is alwa= ys=20 set to false (might be wrong though). Even if set to true, I didn't=20 understand the following lines: if (aSetStatus) { setStatus(headerField("Status").latin1(), headerField("X-Status").latin1 ()); setEncryptionStateChar( headerField("X-KMail-EncryptionState").at(0) ); setSignatureStateChar( headerField("X-KMail-SignatureState").at(0) ); setMDNSentState( static_cast(=20 headerField("X-KMail-MDN-Sent").at(0).latin1() ) ); } since they don't make use of the newly parsed information, therefore I adde= d=20 this : if ( mMsg->Headers().FindField("X-KMail-SignatureState") ) setSignatureStateChar(=20 mMsg->Headers().FindField("X-KMail-SignatureState")->FieldBodyStr().at(0) ); if ( mMsg->Headers().FindField("X-KMail-EncryptionState") ) setEncryptionStateChar(=20 mMsg->Headers().FindField("X-KMail-EncryptionState")->FieldBodyStr().at(0) = ); Now, enough with the modifications. I fell on some other issues, unrelated = to=20 the above patch. Steps to undertake: _ create a new message and save a draft (signed, so the option "never sign = &=20 encrypt when saving drafts" needs to be unchecked) without adding any body= =20 content _ re-open it, uncheck the signature button and resave as draft _ if you check the headers, the X-KMail-SignatureState is still on F (for=20 fully signed), although there is no signed content Small issue, but thought I should mention it. Keep me posted if something seems wrong with the patch, Alexis P.S: If it seems right, please close http://bugs.kde.org/103240 --Boundary-01=_sB8gGeMZ+ZmXNzi Content-Type: text/x-diff; charset="utf-8"; name="patch.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="patch.diff" Common subdirectories: kmail.orig/kdepim-3.5.7/kmail/about and kmail/kdepim= =2D3.5.7/kmail/about Common subdirectories: kmail.orig/kdepim-3.5.7/kmail/avscripts and kmail/kd= epim-3.5.7/kmail/avscripts Only in kmail/kdepim-3.5.7/kmail/: .deps Only in kmail/kdepim-3.5.7/kmail/: Doxyfile diff -u -p kmail.orig/kdepim-3.5.7/kmail/headeritem.cpp kmail/kdepim-3.5.7/= kmail/headeritem.cpp =2D-- kmail.orig/kdepim-3.5.7/kmail/headeritem.cpp 2007-05-14 09:54:39.0000= 00000 +0200 +++ kmail/kdepim-3.5.7/kmail/headeritem.cpp 2007-06-27 16:59:07.000000000 += 0200 @@ -504,11 +504,12 @@ QString HeaderItem::generate_key( KMHead QString s; switch ( msg->signatureState() ) { =2D case KMMsgFullySigned : s =3D "1"; break; =2D case KMMsgPartiallySigned : s =3D "2"; break; =2D case KMMsgSignatureStateUnknown: s =3D "3"; break; =2D case KMMsgSignatureProblematic : s =3D "4"; break; =2D default : s =3D "5"; break; + case KMMsgFullySigned : s =3D "1"; break; + case KMMsgPartiallySigned : s =3D "2"; break; + case KMMsgSignatureStateUnknown : s =3D "3"; break; + case KMMsgSignatureProblematic : s =3D "4"; break; + case KMMsgSignatureTemporarilyDisabled : s =3D "5"; break; + default : s =3D "6"; break; } return ret + s + sortArrival; } @@ -516,11 +517,12 @@ QString HeaderItem::generate_key( KMHead QString s; switch ( msg->encryptionState() ) { =2D case KMMsgFullyEncrypted : s =3D "1"; break; =2D case KMMsgPartiallyEncrypted : s =3D "2"; break; =2D case KMMsgEncryptionStateUnknown: s =3D "3"; break; =2D case KMMsgEncryptionProblematic : s =3D "4"; break; =2D default : s =3D "5"; break; + case KMMsgFullyEncrypted : s =3D "1"; break; + case KMMsgPartiallyEncrypted : s =3D "2"; break; + case KMMsgEncryptionStateUnknown : s =3D "3"; break; + case KMMsgEncryptionProblematic : s =3D "4"; break; + case KMMsgEncryptionTemporarilyDisabled : s =3D "5"; break; + default : s =3D "6"; break; } return ret + s + sortArrival; } Only in kmail/kdepim-3.5.7/kmail/: .imapjob.cpp.swp Common subdirectories: kmail.orig/kdepim-3.5.7/kmail/interfaces and kmail/k= depim-3.5.7/kmail/interfaces Only in kmail/kdepim-3.5.7/kmail/: kmail.kdevses diff -u -p kmail.orig/kdepim-3.5.7/kmail/kmcommands.cpp kmail/kdepim-3.5.7/= kmail/kmcommands.cpp =2D-- kmail.orig/kdepim-3.5.7/kmail/kmcommands.cpp 2007-05-14 09:54:39.0000= 00000 +0200 +++ kmail/kdepim-3.5.7/kmail/kmcommands.cpp 2007-06-27 20:58:49.000000000 += 0200 @@ -2580,7 +2580,7 @@ KMCommand::Result KMSaveAttachmentsComma const KURL& url ) { bool bSaveEncrypted =3D false; =2D bool bEncryptedParts =3D node->encryptionState() !=3D KMMsgNotEncrypte= d; + bool bEncryptedParts =3D ( node->encryptionState() !=3D KMMsgNotEncrypte= d && node->encryptionState() !=3D KMMsgEncryptionTemporarilyDisabled ); if( bEncryptedParts ) if( KMessageBox::questionYesNo( parentWidget(), i18n( "The part %1 of the message is encrypted. Do you want to k= eep the encryption when saving?" ). @@ -2590,7 +2590,7 @@ KMCommand::Result KMSaveAttachmentsComma bSaveEncrypted =3D true; =20 bool bSaveWithSig =3D true; =2D if( node->signatureState() !=3D KMMsgNotSigned ) + if( node->signatureState() !=3D KMMsgNotSigned && node->signatureState()= !=3D KMMsgSignatureTemporarilyDisabled ) if( KMessageBox::questionYesNo( parentWidget(), i18n( "The part %1 of the message is signed. Do you want to keep= the signature when saving?" ). arg( url.fileName() ), diff -u -p kmail.orig/kdepim-3.5.7/kmail/kmcomposewin.cpp kmail/kdepim-3.5.= 7/kmail/kmcomposewin.cpp =2D-- kmail.orig/kdepim-3.5.7/kmail/kmcomposewin.cpp 2007-05-14 09:54:39.00= 0000000 +0200 +++ kmail/kdepim-3.5.7/kmail/kmcomposewin.cpp 2007-06-27 20:32:14.000000000= +0200 @@ -1803,6 +1803,7 @@ void KMComposeWin::setMsg(KMMessage* new // enable/disable encryption if the message was/wasn't encrypted switch ( mMsg->encryptionState() ) { case KMMsgFullyEncrypted: // fall through + case KMMsgEncryptionTemporarilyDisabled: // fall through case KMMsgPartiallyEncrypted: mLastEncryptActionState =3D true; break; @@ -1816,6 +1817,7 @@ void KMComposeWin::setMsg(KMMessage* new // enable/disable signing if the message was/wasn't signed switch ( mMsg->signatureState() ) { case KMMsgFullySigned: // fall through + case KMMsgSignatureTemporarilyDisabled: // fall through case KMMsgPartiallySigned: mLastSignActionState =3D true; break; diff -u -p kmail.orig/kdepim-3.5.7/kmail/kmfolderimap.cpp kmail/kdepim-3.5.= 7/kmail/kmfolderimap.cpp =2D-- kmail.orig/kdepim-3.5.7/kmail/kmfolderimap.cpp 2007-05-14 09:54:39.00= 0000000 +0200 +++ kmail/kdepim-3.5.7/kmail/kmfolderimap.cpp 2007-06-27 11:30:12.000000000= +0200 @@ -1637,8 +1637,10 @@ KMFolderImap::doCreateJob( KMMessage *ms account() && account()->loadOnDemand() && ( msg->msgSizeServer() > 5000 || msg->msgSizeServer() =3D=3D 0 ) && ( msg->signatureState() =3D=3D KMMsgNotSigned || + msg->signatureState() =3D=3D KMMsgSignatureTemporarilyDisabled || msg->signatureState() =3D=3D KMMsgSignatureStateUnknown ) && ( msg->encryptionState() =3D=3D KMMsgNotEncrypted || + msg->encryptionState() =3D=3D KMMsgEncryptionTemporarilyDisabled = || msg->encryptionState() =3D=3D KMMsgEncryptionStateUnknown ) ) { // load-on-demand: retrieve the BODYSTRUCTURE and to speed things up a= lso the headers diff -u -p kmail.orig/kdepim-3.5.7/kmail/kmmessage.cpp kmail/kdepim-3.5.7/k= mail/kmmessage.cpp =2D-- kmail.orig/kdepim-3.5.7/kmail/kmmessage.cpp 2007-05-14 09:54:39.00000= 0000 +0200 +++ kmail/kdepim-3.5.7/kmail/kmmessage.cpp 2007-06-28 15:38:32.000000000 +0= 200 @@ -403,6 +403,13 @@ void KMMessage::fromDwString(const DwStr setSignatureStateChar( headerField("X-KMail-SignatureState").at(0) ); setMDNSentState( static_cast( headerField("X-KMail-= MDN-Sent").at(0).latin1() ) ); } + // If the message contains information on signature/encryption + // state apply it here + if ( mMsg->Headers().FindField("X-KMail-SignatureState") ) + setSignatureStateChar( mMsg->Headers().FindField("X-KMail-SignatureSta= te")->FieldBodyStr().at(0) ); + if ( mMsg->Headers().FindField("X-KMail-EncryptionState") ) + setEncryptionStateChar( mMsg->Headers().FindField("X-KMail-EncryptionS= tate")->FieldBodyStr().at(0) ); + if (attachmentState() =3D=3D KMMsgAttachmentUnknown && readyToShow()) updateAttachmentState(); =20 diff -u -p kmail.orig/kdepim-3.5.7/kmail/kmmsgbase.cpp kmail/kdepim-3.5.7/k= mail/kmmsgbase.cpp =2D-- kmail.orig/kdepim-3.5.7/kmail/kmmsgbase.cpp 2007-05-14 09:54:39.00000= 0000 +0200 +++ kmail/kdepim-3.5.7/kmail/kmmsgbase.cpp 2007-06-28 15:27:21.000000000 +0= 200 @@ -317,6 +317,8 @@ void KMMsgBase::setEncryptionStateChar(=20 setEncryptionState( KMMsgPartiallyEncrypted, idx ); else if( status.latin1() =3D=3D (char)KMMsgFullyEncrypted ) setEncryptionState( KMMsgFullyEncrypted, idx ); + else if( status.latin1() =3D=3D (char)KMMsgEncryptionTemporarilyDisabl= ed ) + setEncryptionState( KMMsgEncryptionTemporarilyDisabled, idx ); else setEncryptionState( KMMsgEncryptionStateUnknown, idx ); } @@ -348,6 +350,8 @@ void KMMsgBase::setSignatureStateChar( Q setSignatureState( KMMsgPartiallySigned,idx ); else if( status.latin1() =3D=3D (char)KMMsgFullySigned ) setSignatureState( KMMsgFullySigned, idx ); + else if( status.latin1() =3D=3D (char)KMMsgSignatureTemporarilyDisable= d ) + setSignatureState( KMMsgSignatureTemporarilyDisabled, idx ); else setSignatureState( KMMsgSignatureStateUnknown, idx ); } diff -u -p kmail.orig/kdepim-3.5.7/kmail/kmmsgbase.h kmail/kdepim-3.5.7/kma= il/kmmsgbase.h =2D-- kmail.orig/kdepim-3.5.7/kmail/kmmsgbase.h 2007-01-15 12:28:47.0000000= 00 +0100 +++ kmail/kdepim-3.5.7/kmail/kmmsgbase.h 2007-06-27 11:25:27.000000000 +0200 @@ -89,7 +89,8 @@ typedef enum KMMsgNotEncrypted=3D'N', KMMsgPartiallyEncrypted=3D'P', KMMsgFullyEncrypted=3D'F', =2D KMMsgEncryptionProblematic=3D'X' + KMMsgEncryptionProblematic=3D'X', + KMMsgEncryptionTemporarilyDisabled=3D'D' } KMMsgEncryptionState; =20 /** Flags for the signature state. */ @@ -99,7 +100,8 @@ typedef enum KMMsgNotSigned=3D'N', KMMsgPartiallySigned=3D'P', KMMsgFullySigned=3D'F', =2D KMMsgSignatureProblematic=3D'X' + KMMsgSignatureProblematic=3D'X', + KMMsgSignatureTemporarilyDisabled=3D'D' } KMMsgSignatureState; =20 /** Flags for the "MDN sent" state. */ diff -u -p kmail.orig/kdepim-3.5.7/kmail/kmreaderwin.cpp kmail/kdepim-3.5.7= /kmail/kmreaderwin.cpp =2D-- kmail.orig/kdepim-3.5.7/kmail/kmreaderwin.cpp 2007-05-14 09:54:39.000= 000000 +0200 +++ kmail/kdepim-3.5.7/kmail/kmreaderwin.cpp 2007-06-28 15:32:34.000000000 = +0200 @@ -310,7 +310,7 @@ kdDebug(5006) << "pgp signed" << endl; kdDebug(5006) << "pkcs7 mime" << endl; // note: subtype Pkcs7Mime can also be signed // and we do NOT want to remove the signature! =2D if ( child && curNode->encryptionState() !=3D KMMsgNotEncr= ypted ) + if ( child && curNode->encryptionState() !=3D KMMsgNotEncryp= ted && curNode->encryptionState() !=3D KMMsgEncryptionTemporarilyDisabled ) dataNode =3D child; } break; @@ -1556,7 +1556,9 @@ void KMReaderWin::parseMsg(KMMessage* aM // - this can only be done *after* calling parseObjectTree() KMMsgEncryptionState encryptionState =3D mRootNode->overallEncryptionSta= te(); KMMsgSignatureState signatureState =3D mRootNode->overallSignatureStat= e(); =2D aMsg->setEncryptionState( encryptionState ); + + if (aMsg->encryptionState() !=3D KMMsgEncryptionTemporarilyDisabled) + aMsg->setEncryptionState( encryptionState ); // Don't reset the signature state to "not signed" (e.g. if one canceled= the // decryption of a signed messages which has already been decrypted befo= re). if ( signatureState !=3D KMMsgNotSigned || @@ -1796,6 +1798,7 @@ void KMReaderWin::slotTouchMessage() command->start(); if ( mNoMDNsWhenEncrypted && message()->encryptionState() !=3D KMMsgNotEncrypted && + message()->encryptionState() !=3D KMMsgEncryptionTemporarilyDisable= d && message()->encryptionState() !=3D KMMsgEncryptionStateUnknown ) return; if ( KMMessage * receipt =3D message()->createMDN( MDN::ManualAction, Only in kmail/kdepim-3.5.7/kmail/: Makefile diff -u -p kmail.orig/kdepim-3.5.7/kmail/messagecomposer.cpp kmail/kdepim-3= =2E5.7/kmail/messagecomposer.cpp =2D-- kmail.orig/kdepim-3.5.7/kmail/messagecomposer.cpp 2007-05-14 09:54:39= =2E000000000 +0200 +++ kmail/kdepim-3.5.7/kmail/messagecomposer.cpp 2007-06-28 15:33:05.000000= 000 +0200 @@ -712,6 +712,16 @@ void MessageComposer::adjustCryptFlags() if ( !mRc ) return; =20 + // Setting signature/encryption states + if (!mDoSign && mSigningRequested) + mReferenceMessage->setSignatureStateChar('D'); + if (!mDoEncrypt && mEncryptionRequested) + mReferenceMessage->setEncryptionStateChar('D'); + if (!mSigningRequested && mReferenceMessage->signatureState() =3D=3D KMM= sgSignatureTemporarilyDisabled) + mReferenceMessage->setSignatureStateChar(' '); + if (!mEncryptionRequested && mReferenceMessage->encryptionState() =3D=3D= KMMsgEncryptionTemporarilyDisabled) + mReferenceMessage->setEncryptionStateChar(' '); + // resolveAllKeys needs to run even if mDisableCrypto =3D=3D true, since // we depend on it collecting all recipients into one dummy // SplitInfo to avoid special-casing all over the place: Common subdirectories: kmail.orig/kdepim-3.5.7/kmail/pics and kmail/kdepim-= 3.5.7/kmail/pics Common subdirectories: kmail.orig/kdepim-3.5.7/kmail/profiles and kmail/kde= pim-3.5.7/kmail/profiles Common subdirectories: kmail.orig/kdepim-3.5.7/kmail/tests and kmail/kdepim= =2D3.5.7/kmail/tests --Boundary-01=_sB8gGeMZ+ZmXNzi-- --nextPart3603994.2U0zaZhII9 Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQBGg8BvmKVIM5KbtKYRAv7sAJ9UAALXjrU8R4rwcC8LYxhb4+rqyQCfcg8a YViTysp/GAfGHU8Hi6+kIrk= =30W+ -----END PGP SIGNATURE----- --nextPart3603994.2U0zaZhII9-- --===============0834388829== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kde-pim mailing list kde-pim@kde.org https://mail.kde.org/mailman/listinfo/kde-pim kde-pim home page at http://pim.kde.org/ --===============0834388829==--