[Kde-pim] I lose sometimes mail from pop3

Thomas McGuire mcguire at kde.org
Wed Aug 24 07:00:26 BST 2011


Hi,

On Tuesday, August 23, 2011 10:58:11 PM laurent Montel wrote:
> I don't know where is the bug but I lose some mails (not a lot but I lose
> some email) from pop3.
> I have all my email on server (I use pop3 + keep message on server)
> so I can see that some mails is losing.
> 
> Perhaps a pb when I close kmail (which shutdown resource I configurate my
> kmail to stop pop3 ressource when I close kmail).
> 
> I don't know how to reproduce it and how to test it but I know that some
> email is loosing.
> 
> Thomas could you look at it I don't know pop3 resource code. but we need to
> fix it.

What are you leave on server settings? Are all messages left on the server or 
only the last x, y days or z megabytes?
For debugging this, we need the debug output of the POP3 resource.

I can't think of anything that would cause this if leaving all messages on the 
server. If you have rules like last x, y days or z megabytes, then there 
probably is a bug in the logic of which mails to select for deletion.

POP3 is a fairly simple protocol (see 
http://en.wikipedia.org/wiki/Post_Office_Protocol), basically it uses the 
following commands in a sequence, which is done all in one big switch 
statement within POP3Resource::doStateStep():
1) Login
2) Listing mails by ID / size
 C: LIST
 S: +OK
    1 2340
    2 220
    3 329423
The first number is the ID, which is not persistant between sessions. The 
second number is the size of the mail. In this case there are 3 mails
3) Listing by ID / UID
 C: UIDL
 S: +OK
    1 whqtswO00WBw418f9t5JxYwZ
    2 aksdjfilsmadv
    3 0osdifasdkfj
First number is the ID, second number is the UID (unique ID). The UID is 
persistant across sessions.
4) Download mails by IDs
 C: RETR 1
 S: +OK
    <message>
 C: RETR 2
 S: +OK
    <message>
Here we download all mails we haven't yet downloaded before. To detect which 
mails we have downloaded before, we save the list of already downloaded UIDs 
into a config file.
5) Delete mails from server
 C: DELE 1
 S: +OK
 C: DELE 2
 S: +OK
In this last step, we delete mails we downloaded from the server and don't 
need on the server anymore, depending on the "leave on server" rules.
Without sending these commands, no mail is deleted. The function 
POP3Resource::idsToDelete() decides which IDs to delete from the server, I 
assume the bug can only be in there. In there, the logic is quite 
straightforward if there are no special leave rules, and get a bit more 
complicated if there are rules like "leave only the last x, y days or z 
megabytes".
Note the debug output "kDebug() << "Going to delete" << ..." is going to tell 
if the POP3 resource is actually going to delete mail, please double-check 
that it is indeed the resource deleting them.

I hope that helps a bit in debugging. We really need the debug output though, 
or a way to reproduce. And please tell what kind of leave on server rules you 
are using.

Regards,
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20110824/48d6833c/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