Bug 85952 - Broken headers in message list with (online) IMAP
Summary: Broken headers in message list with (online) IMAP
Status: RESOLVED FIXED
Alias: None
Product: kmail
Classification: Applications
Component: IMAP (show other bugs)
Version: 1.6.82
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
: 86580 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-07-25 19:22 UTC by Andre Woebbeking
Modified: 2008-01-19 19:10 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
kmfolderimap.diff (766 bytes, text/x-diff)
2004-08-11 20:35 UTC, Carsten Burghardt
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andre Woebbeking 2004-07-25 19:22:32 UTC
Version:           1.6.82 (using KDE 3.2.92 (3.3 beta2), compiled sources)
Compiler:          gcc version 3.4.1 (Debian 3.4.1-2)
OS:                Linux (i686) release 2.6.7-1-k7

Hi,

I use online IMAP. In the message list view in the subject and sender column the number of spaces differs if a message is selected or not. Sometimes many spaces are reduced to one or one space is reduced to no space.


André
Comment 1 Carsten Burghardt 2004-07-26 19:44:23 UTC
What server are you using?

Comment 2 Andre Woebbeking 2004-07-26 20:51:12 UTC
Cyrus IMAP4 v2.0.16 und Web.de IMAP.

Comment 3 Carsten Burghardt 2004-07-26 22:45:26 UTC
This is a known problem of web.de - their imap implementation is simply broken. It happens sometimes with older cyrus versions, an update will help.
To be sure: please capture the traffic between your box and the imap server with ethereal when you select a folder that has new mails in it that show the described behaviour. Normally the server itself strips the whitespace.
Comment 4 Andre Woebbeking 2004-07-26 23:19:48 UTC
> update will help. To be sure: please capture the traffic between your
> box and the imap server with ethereal when you select a folder that
> has new mails in it that show the described behaviour.

the traffic is SSL encrypted. Is there a kdDebug output I can activate 
instead?

Comment 5 Andre Woebbeking 2004-07-27 11:52:03 UTC
> Cyrus IMAP4 v2.0.16 und Web.de IMAP.

BTW, with KDE 3.2.3 n spaces are always reduced to one.

Comment 6 Carsten Burghardt 2004-08-04 17:39:02 UTC
*** Bug 86580 has been marked as a duplicate of this bug. ***
Comment 7 Andre Woebbeking 2004-08-10 22:40:14 UTC
On Monday 26 July 2004 22:45, Carsten Burghardt wrote:
> It happens sometimes with older cyrus versions, an update will help.

I updated Cyrus IMAP to 2.2.3 and can still reproduce it.

Comment 8 Rutger ter Borg 2004-08-11 06:38:53 UTC
This bug is also present when using courier-imap-3.0.5.
Comment 9 Carsten Burghardt 2004-08-11 20:35:04 UTC
OK, can anyone please apply the attached patch and start kmail in a console? 
When the headers of new messages are downloaded the content is printed with 
"msg data:". If this is the same as kmail displays then it's a problem of the 
server.


Created an attachment (id=7080)
kmfolderimap.diff
Comment 10 Rutger ter Borg 2004-08-11 22:26:50 UTC
Well, I get this:

kmail: MESSAGE data:X-UID: 17404
X-Length: 562
X-Date: 11-Aug-2004 22:20:28 +0200
X-Flags: 32
From: Test,Test <test@test.com>
Sender: Test,Test <test@test.com>
Reply-To: Test,Test <test@test.com>

which displays incorrectly as "Test, Test". This debug statement only shows up on new messages (is that correct?), but the behaviour is on read messages as well.

Perhaps this also confirms the data of the server:

emailAddrAsAnchor('"Test,Test" <test@test.com>') returns:


I did find another way to reproduce the behaviour:

- click on mail (space gets added)
- move focus to another program (space gets removed)

hopefully this helps.















Comment 11 Carsten Burghardt 2004-08-11 22:37:05 UTC
> Well, I get this:
>
> kmail: MESSAGE data:X-UID: 17404
> X-Length: 562
> X-Date: 11-Aug-2004 22:20:28 +0200
> X-Flags: 32
> From: Test,Test <test test com>
> Sender: Test,Test <test test com>
> Reply-To: Test,Test <test test com>

As you see the envelope that is reported by the server says 
"Test,Test" (without space) and this information is saved as local cache.

> which displays incorrectly as "Test, Test". This debug statement only shows
> up on new messages (is that correct?), but the behaviour is on read
> messages as well.

Of course: when you retrieve the complete email the server sends this "as is" 
and the sender is "Test, Test". This information is displayed when you click 
on the email. You can view the source of the email - it will be "Test, Test".
So the situation is: the server reports different things when you retrieve 
only the envelope and the complete email. As the envelope is stored in the 
index (and not updated) you only see the space in the headerlist when you 
click on it. I don't know any way to work around this as the information 
provided by the server is simply wrong.

Carsten

Comment 12 Rutger ter Borg 2004-08-11 22:57:57 UTC
AFAIK, the server is reporting it correctly. In my earlier message, I wrote  "Test,Test" without a space. In checked the source of the message, which also states "Test,Test" <test@test.com>. So, I am convinced the server is not doing anything wrong.

Of course, now we want to know what happens if I write a mail with "Test, Test" with a space in between. Now the server reports:

MESSAGE data:X-UID: 17407
X-Length: 564
X-Date: 11-Aug-2004 22:49:22 +0200
X-Flags: 32
From: Test, Test <test@test.com>
Sender: Test, Test <test@test.com>
Reply-To: Test, Test <test@test.com>

and this:

kmail: KMMessage::emailAddrAsAnchor('"Test, Test" <test@test.com>') returns:
And the source says: From: "Test, Test" <test@test.com>

However, no bug occurs in kmail in this case, i.e. if a space is in the original message. Stated briefly:

Bug: "Test,Test" in original message
No bug: "Test, Test" in original message


Comment 13 Andre Woebbeking 2004-08-11 23:38:04 UTC
On Wednesday 11 August 2004 20:35, Carsten Burghardt wrote:
> OK, can anyone please apply the attached patch and start
> kmail in a console? When the headers of new messages are downloaded
> the content is printed with "msg data:". If this is the same as kmail
> displays then it's a problem of the server.

Is the debug output the original data sent by the server or is it 
already parsed by the IMAP ioslave?

Comment 14 Andre Woebbeking 2004-08-11 23:49:35 UTC
BTW, I can't reproduce this with Thunderbird 0.7.3. Neither with Cyrus 
nor with web.de.

Comment 15 Carsten Burghardt 2004-08-12 22:21:23 UTC
CVS commit by burghard: 

Do not remove white spaces from the subject. This is the fix for the kioslave,
the sender/receiver have to be fixed in kmail.  
CCMAIL: 85952@bugs.kde.org


  M +1 -1      imapparser.cc   1.87


--- kdepim/kioslaves/imap4/imapparser.cc  #1.86:1.87
@@ -679,5 +679,5 @@ mailHeader * imapParser::parseEnvelope (
 
   //subject
-  envelope->setSubjectEncoded(parseLiteralC(inWords));
+  envelope->setSubject(parseLiteralC(inWords));
 
   QPtrList<mailAddress> list;


Comment 16 Carsten Burghardt 2004-08-31 21:24:27 UTC
CVS commit by burghard: 

Quote email adresses and thus display the sender/receiver correctly in kmail.
Thanks Marc ;-)
CCMAIL: 85952-done@bugs.kde.org


  M +3 -2      Makefile.am   1.25
  M +2 -0      mailaddress.cc   1.14


--- kdepim/kioslaves/imap4/mailaddress.cc  #1.13:1.14
@@ -26,4 +26,5 @@
 #include "rfcdecoder.h"
 #include "mimehdrline.h"
+#include <kmime_util.h>
 
 mailAddress::mailAddress ()
@@ -203,4 +204,5 @@ mailAddress::getStr ()
   if (!rawFullName.isEmpty ())
   {
+    KMime::addQuotes( rawFullName, false );
     retVal = rawFullName + " ";
   }

--- kdepim/kioslaves/imap4/Makefile.am  #1.24:1.25
@@ -1,3 +1,4 @@
-INCLUDES= -I$(srcdir)/.. $(SSL_INCLUDES) $(all_includes)
+INCLUDES= -I$(top_srcdir)/libkdenetwork \
+    -I$(srcdir)/.. $(SSL_INCLUDES) $(all_includes)
 
 ####### Files
@@ -8,5 +9,5 @@
   mimeheader.cc rfcdecoder.cc imap4.cc imapinfo.cc imapparser.cc mailheader.cc \
   mimehdrline.cc  mimeio.cc
-kio_imap4_la_LIBADD  = -lkdesasl $(LIB_KIO)
+kio_imap4_la_LIBADD  = -lkdesasl $(LIB_KIO) ../../libkdenetwork/libkdenetwork.la
 kio_imap4_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) -module $(KDE_PLUGIN)
 


Comment 17 Andre Woebbeking 2005-01-23 09:26:30 UTC
I still have this problem with KDE from CVS HEAD and web.de. Mozilla Thunderbird shows the same things without any problems.
Comment 18 Carsten Burghardt 2005-01-23 13:50:22 UTC
> ------- Additional Comments From woebbeking web de  2005-01-23 09:26
> ------- I still have this problem with KDE from CVS HEAD and web.de.

Can you provide a testmail or describe what problem you see?

Comment 19 Andre Woebbeking 2005-01-23 16:30:51 UTC
An example is your reply I got from KDE's bug tracker. It's the original issue.   In the sender column of the message list sometimes I see Carsten Burghardt and sometimes CarstenBurghardt. This toggles if I select/deselect the mail.
Comment 20 Carsten Burghardt 2005-01-23 23:52:28 UTC
On Sunday 23 January 2005 16:30, Andre Woebbeking wrote:
> An example is your reply I got from KDE's bug tracker. It's the
> original issue.   In the sender column of the message list sometimes I see
> Carsten Burghardt and sometimes CarstenBurghardt. This toggles if I
> select/deselect the mail. 

It's unfortunately still the problem of web.de. I copied the mail to my web.de 
account and then requested the envelope information which we use to display 
the headers:

* 1 FETCH (UID 341000269 ENVELOPE ("Sun, 23 Jan 2005 13:49:19 +0100" "Re: [Bug 
85952] Broken headers in message list with (online) 
IMAP" (("CarstenBurghardt" NIL "burghardt" "kde.org")) (("CarstenBurghardt" 
NIL "burghardt" "kde.org")) (("CarstenBurghardt" NIL "burghardt" "kde.org")) 
((NIL NIL "85952" "bugs.kde.org")) NIL NIL 
"<20050123082635.8577.qmail@ktown.kde.org>" 
"<200501231349.20013.burghardt@kde.org>"))
. OK UID FETCH Completed

As you can see the spaces are missing in the response from the server. I 
already sent a report about this problem to web.de months ago but they never 
answered.

Comment 21 Andre Woebbeking 2005-01-24 00:02:46 UTC
On Sunday 23 January 2005 23:52, Carsten Burghardt wrote:
>
> As you can see the spaces are missing in the response from the
> server. I already sent a report about this problem to web.de months
> ago but they never answered.

But why does it work with Thunderbird?

Comment 22 Carsten Burghardt 2005-01-24 07:51:27 UTC
> But why does it work with Thunderbird?

Thunderbird obviously decided to use several workaounds for broken servers
or mails and this seems to be one of them. The only thing I can imagine is
that they use the information from the complete email to update the
headerlist.
Does Thunderbird show the headers correctly when you have not clicked on
the email yet? Can you check with ethereal what it actually requests from
the server?

Comment 23 Rutger ter Borg 2005-03-16 17:22:13 UTC
Kmail version 1.7.2, KDE 3.3.2., Gentoo packages.

I have isolated another testcase which is not handled correctly. If I receive a mail with a From: field which looks like

"Test Test (Test)" <test@test.com>

then that is alternately shown as

"Test Test (Test)" <test@test.com>
"Test Test" <test@test.com>

in a similar way the space used to be shown and not shown, as described in my comments #10 and #12. 

Comment 24 Ingo Klöcker 2008-01-19 19:10:15 UTC
The problem with addresses of the form

"Test Test (Test)" <test@test.com>

does not occur with IMAP servers that send correct envelope information. Setting bug to fixed again.