Revision 622052

Go back to digest for 14th January 2007

Bug Fixes in KDE-PIM

Reinhold Kainhofer committed changes in /branches/KDE/3.5/kdepim/kmail:

Make RFC 2231-encoded attachment names work. Patch approved by Ingo (the issues he had were corrected).

RFC 2231 defines an enhanced encoding for attachment filenames, and thunderbird apparently implemented this encoding. RFC 2231 allows one field to be split across multiple numbered entries of the form fieldname*0=....;
fieldname*1=...; fieldname*2=...; or fieldname*0=....; fieldname*1=...; fieldname*2=...;
All these entries first need to be concatenated to form the full value of the field.

Here's a real-life example:

Content-Type: application/;
Content-Transfer-Encoding: base64
Content-Disposition: inline;

As a result, KMail shows %39%2E%78%6C%73 as the file name in both the message preview panel as well as in the mime tree.

With this patch, KMail correctly shows the proper filename.
The patch adds one static method to collect all parts of rfc 2231-encoded params into one single string. That method is then used in two different places for the name and the filename props.

One minor problem remains, though: As the mime library does not have support for rfc2231 encoded attachments, the message is not shown with the attachment icon in the message list.

File Changes

Modified 4 files
  • /branches/KDE/3.5/kdepim/kmail
  •   /kmmessage.cpp
  •   /kmmsgbase.cpp
  •   /kmmsgbase.h
  •   /kmmsgpart.cpp
4 files changed in total