[PATCH] encode mail address when passing via KApplication::invokeMailer

Ingo Klöcker kloecker at kde.org
Sun Jan 16 23:04:55 GMT 2005


On Sunday 09 January 2005 11:48, Oswald Buddenhagen wrote:
> On Sun, Jan 09, 2005 at 11:44:13AM +0100, Ingo Klöcker wrote:
> > If you really think it's necessary to create (1) then I can copy it
> > to kapplication (as helper function).
>
> i'd be very much in favour. there is a lot of broken stuff out there.

Okay, the attached patch fixes the original problem correctly by 
encoding the whole to, cc and bcc address lists in one RFC2047-like 
encoded blob. Technically this isn't correct, but without a full 
RFC2822-compliant parser for email addresses a better solution isn't 
possible. Since this hack is only used when KMail is invoked and KMail 
decodes the blob correctly this hack is IMO acceptable for now.

While improving Tobias patch I also fixed the code which builds the 
mailto: URL by using the static helper function splitEmailAddressList() 
instead of QStringList::split( ',', * ). Moreover, the protocol of the 
URL is set to "mailto".

Anyway, I've ported the patch to kdelibs 3_3 (which I'm still using) and 
I've tested it with KMail and a testscript (as kmail replacement) 
sending a message to a contact from KAddressBook and clicking on a few
mailto: links (even with multiple tos, ccs and bccs). I have even 
verified that Mutt understands the generated URLs.

Everybody happy? Okay to commit?

Regards,
Ingo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 3.4-kdelibs-kdecore-fix_invokeMailer2.diff
Type: text/x-diff
Size: 6980 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20050117/a958e5db/attachment.diff>
-------------- 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-core-devel/attachments/20050117/a958e5db/attachment.sig>


More information about the kde-core-devel mailing list