[Kde-pim] mailto: url dragging

Ingo Klöcker kloecker at kde.org
Tue Aug 4 23:21:16 BST 2009


On Tuesday 04 August 2009, Thomas McGuire wrote:
> Hi,
>
> On Tuesday 04 August 2009 18:02:44 you wrote:
> > I'm about to look into https://bugs.kde.org/show_bug.cgi?id=138725
> > which shows the RFC2047 encoded mail address when one drops an
> > address from one mailreader windows header to a composer window.
> >
> > My idea to fix this is the following:
> >
> > Index: kmlineeditspell.cpp
> > ===================================================================
> > --- kmlineeditspell.cpp (Revision 1005628)
> > +++ kmlineeditspell.cpp (Arbeitskopie)
> > @@ -130,7 +130,12 @@
> >        // email-address.
> >        if ( url.protocol() == "mailto" ) {
> >          KABC::Addressee addressee;
> > -        addressee.insertEmail( url.path(), true /* preferred */ );
> > +        QString address = url.path();
> > +        if ( address.startsWith( "=?" ) ) {
> > +          // RFC2047 encoded string, decode it
> > +          address = KMMsgBase::decodeRFC2047String(
> > address.toLatin1() ); +        }
> > +        addressee.insertEmail( address, true /* preferred */ );
> >          list += addressee;
> >        }
> >
> >
> > however, it's not clear for me if the Drag object itself shouldn't
> > already contain the decoded path ? Otherwise each receiver of this
> > drag object needs to do the decoding.
>
> I had a very quick look at RFC2368, which specifies the URI scheme
> for mailto, and it says "8-bit characters in mailto URLs are
> forbidden. MIME encoded words (as defined in [RFC2047]) are permitted
> in header values".
> That means that indeed the receiver of such a mail drag has to deal
> with it.

Exactly. That's why we introduced the RFC2047 encoding of addresses put 
into mailto URLs.


> The above patch is not correct, consider:
> mailto:Ingo =%3Futf-8%3Fq%3FKl=C3=B6cker%3F= <kloecker at kde.org>
> There, the =? is not at the start, which is what the patch assumes.

The check can be omitted. One can always do
  address = KMMsgBase::decodeRFC2047String( address.toLatin1() );
If address was not RFC2047 encoded then KMMsgBase::decodeRFC2047String() 
simply returns the input string.


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/20090805/1e27ab06/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