[Kde-pim] KMime vs. custom headers

Ingo Klöcker kloecker at kde.org
Tue Jul 14 18:48:09 BST 2009


On Tuesday 14 July 2009, Thomas McGuire wrote:
> Hi,
>
> On Tuesday 14 July 2009 06:42:46 Constantin Berzan wrote:
> > Looking at the code in KMime::Content::assemble(), I see that
> > headers are handled in two ways:
> > 1) "known" headers are hard-wired in assembleHeaders(), which is
> > extended by Message::assembleHeaders() for Messages;
> > 2) custom "X-" headers are added in assemble() itself.
> >
> > This leaves a number of non-"X-" headers which are optional, but
> > are not handled in assembleHeaders().  These headers are not
> > handled in any way, and if added to the message, they will be lost
> > and never appear in the encoded content!  From the headers defined
> > in KMime, at least ContentID, ContentLocation, and MailCopiesTo
> > exhibit this broken behaviour.
> >
> > I'm writing to the list because I'm not sure how to fix this. 
> > Should we: * treat every header type defined in KMime in
> > assembleHeaders() and make it a rule that, apart from those headers
> > defined in KMime, only "X-" headers may be added?
> > * find some generic way to treat these headers?
>
> I'm for the second solution, we can't add all possible non X-headers
> to KMime. Keep in mind that there is a difference between headers of
> MIME parts (the Content class) and headers of the message (the
> Message class). No clear idea from my side how to do this, KMime
> looks a bit messy with regards to headers.

One possibility might be to extend KMime with delegates for assembling 
headers not known to KMime; maybe via a registry for factories for such 
delegates. Note, that I haven't actually looked at assembleHeaders().


Regards,
Ingo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20090714/b9b3ab70/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