[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kmail-devel
Subject:    Re: new "kmail with PGP" error
From:       Andreas Gungl <a.gungl () gmx ! de>
Date:       2000-03-07 20:20:42
[Download RAW message or body]

Hello again,

since I know that some of us use kmail 1.0.28 for their daily
work: The code can be used with kmail 1.0.28 too. Just remove the
two QCString() constructs! Then recompiling is absolutely easy.

Well, I know, weīre developing kmail 1.1.x - but as long as KDE2 is
more or less far away from being launched, I think it makes sence to
point out, if a patch can be easily applied to the stable version. So,
please excuse me and ignore this message, if you are not interested
in it.

Andreas

Am Mon, 06 Mär 2000 schrieb Andreas Gungl:
>Hi,
>
>Thank you for the hint about where to look for a solution. I donīt
>understand the code completely. Doesnīt seem to be easy with handling
>the parts. So I think, Sven is the one who should know this code best.
>
>Here is just a hack which worked for me. (No complete and perfect
>yet, but a first proposal.) The idea is, to look through all parts,
>if there is a plain text part with a pgp encrypted message. If so,
>this is the prefered part for displaying. Otherwise the prefered part
>is the html one. (I personally would like a settings option about
>which type of part to prefer.)
>
>    // ---sven: handle multipart/alternative start ---
>    // This is for multipart/alternative messages WITHOUT attachments
>    // main header has type=multipart/alternative and one attachment is
>    // text/html
>    if (type.find("multipart/alternative") != -1 && numParts == 2)
>    {
>      debug("Alternative message, type: %s",type.data());
>      //Now: Only two attachments one of them is html
>      int part_to_use = 0;
>      for (i=0; i<2; i++)                   // count parts...
>      {
>        aMsg->bodyPart(i, &msgPart);        // set part...
>        subtype = msgPart.subtypeStr();     // get subtype...
>        if (stricmp(subtype, "html")==0)    // is it html?
>        {                                   // yes...
>	  if (part_to_use)		    // use html, if no ppg
>	   part_to_use = i;		    // part found before
>        }
>        else				    // no html part...
>        {
>          str = QCString(msgPart.bodyDecoded());	// decode it...
>          if (str.find("BEGIN PGP MESSAGE") != -1)	// is pgp message?
>            part_to_use = i;				// use this part
>        }
>      }                                     // end for.
>      if (part_to_use)
>      {
>        aMsg->bodyPart(part_to_use, &msgPart);
>        subtype = msgPart.subtypeStr();
>        if (stricmp(subtype, "html")==0)    // is it html?
>          mViewer->write(str);              // write it...
>        else
>          writeBodyStr(QCString(msgPart.bodyDecoded()));
>        return;
>      }
>      // if we are here we didnt find any html part. Handle it normaly then
>    }
>    // This works only for alternative msgs without attachments. Alternative
>    // messages with attachments are broken with or without this. No need
>    // to bother with strib </body> or </html> here, because if any part
>    // follows this will not be shown correctly. You'll still be able to read the
>    // main message and deal with attachments. Nothing I can do now :-(
>    // ---sven: handle multipart/alternative end ---
>
>Please feel free to comment this idea. Sven, perhaps you could
>continue this, if it isnīt complete nonsense. I think, you still have
>some more ideas on how to improve the handling of the parts. As I
>said, itīs my first look at this code and you are the more
>experienced one.
>
>BTW, itīs possible to send the whole contents of an encrypted
>multipart mail to pgp 6.x because this version can handle mime
>parts. It will decypt the plain text part and return that contents.
>But I doubt, if the elder versions are able to handle this. (Canīt
>test at the moment.) So I think, the way mentioned above is better.
>
>Andreas
-- 
    ~
  ' v '
 //   \\
/(     )\  Powered by Penguin.
  ^ ' ^

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic