Bug 159995 - Address fields encoded incorrectly
Summary: Address fields encoded incorrectly
Status: RESOLVED FIXED
Alias: None
Product: kmail
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-28 09:57 UTC by Sergei Beilin
Modified: 2008-03-31 09:59 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
a patch approach (1.25 KB, patch)
2008-03-29 10:51 UTC, Sergei Beilin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sergei Beilin 2008-03-28 09:57:18 UTC
Version:            (using Devel)
Installed from:    Compiled sources
Compiler:          gcc (GCC) 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2) 
OS:                Linux

The To, From, Cc and Bcc fields are encoded incorrectly, if contatin non-Latin chars. Only the display name must be encoded, while the mail address itself should left as-is.

For example, my work email address, with my name in Russian, gets encoded as

=?utf-8?B?0KHQtdGA0LPQtdC5INCR0LXQudC70LjQvSA8c2JlaWxpbkBsYWItbS5ydT4=?=

while must be (domain name hidden to avoid spam)

"=?utf-8?b?0KHQtdGA0LPQtdC5INCR0LXQudC70LjQvQ==?= <sbeilin@MYWORK.ru>"

This error leads to the following message (kmmessage.cpp:2251)

 kmail(4815) KMMessage::splitAddrField: Error in address splitting: parseAddressList returned false!

and messages stay in Outbox.

Reverting kmmsgbase.h and kmmsgbase.cpp to revision r788000 fixes the problem.

It seems that the following commit 
r788330 | tmcguire | 2008-03-21 15:36:46 +0400 (Fri, 21 Mar 2008) | 2 lines
Use decode/encodeRFC2047String from KMime instead of rolling our own.
is the source.
Comment 1 Sergei Beilin 2008-03-29 10:51:29 UTC
Created attachment 24114 [details]
a patch approach

The following code seems to be working. Hope it helps.
Comment 2 Thomas McGuire 2008-03-31 00:40:02 UTC
SVN commit 792011 by tmcguire:

Revert parts of: 
>SVN commit 788330 by tmcguire:


>Use decode/encodeRFC2047String from KMime instead of rolling our own.


The reason is that our encodeRFC2047String does not encode quoted words (e.g. the 
address part of a mailbox), while the encodeRFC2047String from KMime does, and
I couldn't find a method in KMime which does not encode quoted words.

BUG: 159995


 M  +92 -5     kmmsgbase.cpp  
 M  +3 -0      kmmsgbase.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=792011
Comment 3 Thomas McGuire 2008-03-31 00:41:06 UTC
> a patch approach 
> The following code seems to be working. Hope it helps. 
Thanks for the bug report. I didn't use your patch, because it was hardcoded to use utf-8. Instead I just reverted my earlier commit which broke things.
Comment 4 Sergei Beilin 2008-03-31 09:59:31 UTC
Hi Thomas!

> Thanks for the bug report. I didn't use your patch, because it was hardcoded to use utf-8. Instead I just reverted my earlier commit which broke things.



Oops! My fault, a copy-paste from a wrong window ;) 
You can change "utf-8" constant to variable 'cset', it works for me.


--
    Best regards, Sergei A. Beilin
    Jabber ID: SAABeilin@jabber.ru