Bug 185681

Summary: kmail deletes seenUidList -> mail download doublettes (error #3 described below)
Product: [Unmaintained] kmail Reporter: reisenweber
Component: pop3Assignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED UNMAINTAINED    
Severity: normal CC: dominik.tritscher, gerlosgm, uzi18
Priority: NOR    
Version: 1.9.10   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: screenshot showing download of lots of old msgs
prefetch-cmd script to create backup of UIDL list, and restore in case of error. Needs edit for your specific account's filename

Description reisenweber 2009-02-27 09:05:06 UTC
Created attachment 31668 [details]
screenshot showing download of lots of old msgs

+++ This bug was initially created as a clone of Bug #185679 +++

Created an attachment (id=31666)
traceback of crash on error#2 described above

+++ This bug was initially created as a clone of Bug #185677 +++

Created an attachment (id=31665)
screenshot showing UIDL-requester

+++ This bug was initially created as a clone of Bug #157946 +++

Version:           1.9.10 (openSUSE 11.1)
Prerequisites/Preset:
POP3 account, msgs stay on server, (about 2500 msgs/25Meg on server).
Lots of mails in kmail (search msgtext takes some 10 min)

Reproduce (occurred >1 times. Though it's a timing issue, hard to reproduce - maybe with SIGSTOP KMail, or Netfilters):
During searching of local mails (50% CPU usage on a 2GHz dualcore system) POP3 UIDL obviously times out, opening requester stating the server allegedly "doesn't support UIDL"
o- Error requester "server does not support UIDL (see attachment)
This is bug #1: UIDL timeout mustn't be handled identically to error-response from server

o- i click "abort message download" at bottom right some times (because i know what will follow), then i click "ok" on error-requester **)
o- KONTACT coredumps (see attachment)
This is bug #2: kmail must NOT coredump

o- kmail deletes local list of mails already downloaded:
~/.kde/share/kmail/<user>@<serverdomain>:@pop.<serverdomain>:995 is void. 
seenUidList=<nullstring>
size before: ~121k, size after error: ~70byte
This is bug #3: list of downloaded mails MUST NOT be deleted on failure of UIDL.
This bug also appeared when kmail didn't segfault on error#2, it's directly related to UIDL-failure and 100% reproduceable (given you manage to get the UIDL not supported warning)


resulting problems: _all_msgs_ are downloaded a second time, to restore seenUidList. 


seen identically in SuSE10.1 version of Kontact

workaround: 
o- avoid lowmem/high-cpu-load when polling POP3.
o- when error happens: CANCEL DOWNLOAD IMMEDIATELY! Create filter to download all msgs older 1day to a temporary mail dir. Poll. (Disable filter. I keep it for catching errors during unattended polls)
o- *OR* CANCEL DOWNLOAD IMMEDIATELY! restore ~/.kde/share/kmail/<user>@<serverdomain>* from yesterday's backup.
o- then use <CTRL>+* to delete doublettes


jOERG
Comment 1 reisenweber 2010-03-12 12:30:48 UTC
Created attachment 41568 [details]
prefetch-cmd script to create backup of UIDL list, and restore in case of error. Needs edit for your specific account's filename
Comment 2 reisenweber 2010-03-12 12:33:19 UTC
problem persists on kmail-1.12.2 / Kontact-4.3.2

every once in a while internet connectivity is interrupted by e.g. 24h forced
disconnect just the moment while kmail is waiting for response from
pop3-server. Result is an "empty"
.kde/share/kmail/<user>@<serverdomain>:@pop.<serverdomain>:995 file as
described above.

attached a script to invoke in kmail's account-extended-prefetchCmd settings,
to catch the situation and recover in a somewhat sane way

jOERG
Comment 3 gerlos 2010-07-11 13:33:24 UTC
I got the same problem (duplicate messages) on Kmail 1.13.5 undek KDE SC 4.4.5 on Kubuntu 10.04, but just for my two Yahoo mail acocunts, it doesn't seem to happen for my other two acocunts on different providers.

I also got this error message:
Could not read file Risposta non valida dal server:
«.
».

I'm not sure that there's a CPU usage problem in my situation, since when I check for mail my CPU usage remains low.
Comment 4 gerlos 2010-07-12 13:39:52 UTC
I'm not sure if there's any relation with the origina problem, but when I get the error message:
Could not read file Risposta non valida dal server:
«.
».
kmail stops download mail from the server. I've seen also that I get this error more frequently when I set the language of the application in Italian. If I switch to "British English" kmail donwloads missing mails, and the error window appears less often.
Comment 5 Laurent Montel 2015-04-12 09:59:36 UTC
Thank you for taking the time to file a bug report.

KMail2 was released in 2011, and the entire code base went through significant changes. We are currently in the process of porting to Qt5 and KF5. It is unlikely that these bugs are still valid in KMail2.

We welcome you to try out KMail 2 with the KDE 4.14 release and give your feedback.