[Kde-pim] mulitpart/alternative & mixed libkmime question.

Ingo Klöcker kloecker at kde.org
Thu Feb 15 22:57:33 GMT 2007


On Thursday 15 February 2007 23:31, Tom Albers wrote:
> Hi,
>
> I'm trying to *compose* a message with three parts, one plain, one
> html and one attachment. The plain and html are alternatives to each
> other and the attachment should be visible for either version...
>
> Scenario 1:
> Create Content A, fill it with plain content
> Create Content B, fill it with html content
> Add Content B to A. A will get converted to Mixed, with proper A and
> B multiparts. Change the Mixed to Alternative.
> Create Content C, fill it with attachment.
> Add C to A. libkmime sees it's already a multipart and adds C as
> third part to the message. Problem: C is not an alternative to A or
> B. A & B should be in a seperate multipart part and that should be
> together with C a mixed multipart.
>
> Scenario 2:
> Create Content A. Dont fill it.
> Create Content B. Fill it with plain.
> Create Content C. Fill it with html.
> Add Content C to B. B is converted to Mixed, with proper A and B
> multiparts. Change the Mixed to Alternative.
> Add Content B to A. A is converted to Mixed, there will be an extra
> invalid/invalid part in the message. Create Content C, fill it with
> attachment,
> Add C to A, A proper part is added.
> Problem: There is an invalid/invalid part added to the message. The
> rest of the message is ok. If i grep that part and delete it from the
> message, i loose the whole Alternative part. But that is a separate
> bug.
>
> Is anyone able to tell me if either scenario is the right one?

Both scenarios are awkward and obviously broken. IMO the right way 
(which KMime doesn't seem to provide or else you'd use it) is:
Create Content A, fill it with plain content
Create Content B, fill it with html content
Create BodyPart::MultiPart::Alternative and add A and B
Create Content C, fill it with the attachment
Create BodyPart::MultiPart::Mixed and add the multipart/alternative and 
C.

Apparently, the complete subtree starting with BodyPart described in 
CLASSTREE.bodyparts seems to be missing from KMime. :-(

Regards,
Ingo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20070215/15b74f6d/attachment.sig>
-------------- next part --------------
_______________________________________________
kde-pim mailing list
kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
kde-pim home page at http://pim.kde.org/


More information about the kde-pim mailing list