Tk Library Source Code

View Ticket
Login
Ticket UUID: 501577
Title: Delete reorders requests?
Type: Bug Version: None
Submitter: dnew Created on: 2002-01-10 00:55:31
Subsystem: pop3 Assigned To: andreas_kupries
Priority: 8 Severity:
Status: Closed Last Modified: 2003-04-10 08:17:22
Resolution: Works For Me Closed By: andreas_kupries
    Closed on: 2003-04-10 01:17:22
Description:
On a mailbox with multiple messages, the following does not process all of them:

package require pop3 ; # from TclLib

proc checkmail {} {
    set chan [::pop3::open pop-server.san.rr.com xxxxx secret]
    set x [lindex [::pop3::status $chan] 0]
    puts "x=$x"
    for {set i 0} {$i < $x} {incr i} {
        set msg [::pop3::retrieve $chan [expr $i+1]]
        puts "len msg=[string length $msg]"
        ::pop3::delete $chan [expr $i + 1]
    }
    ::pop3::close $chan
}

checkmail

Instead, it seems to only process the first few messages, failing to retrieve or delete the others.

If the messages are being renumbered by the deletion, then the man page entry stating
Note, the indices are not reordered on the server,
should be fixed, but that doesn't seem to be the problem.
User Comments: andreas_kupries added on 2003-04-10 08:17:22:
Logged In: YES 
user_id=75003

We cannot repro this, and the testsuite doesn't find any 
inconsistencies either. Closing.

andreas_kupries added on 2002-12-09 08:12:01:
Logged In: YES 
user_id=75003

Darren, if possible have a look at this over x-mas.

andreas_kupries added on 2002-10-15 04:00:35:
Logged In: YES 
user_id=75003

Commit done.

andreas_kupries added on 2002-10-15 03:55:26:
Logged In: YES 
user_id=75003

More info. When I tried to log the server side the testsuite did 
not hang. ... I used a custom log procedure to divert the 
output of package 'log' into the server log file. ... Removing 
this hangs on ... Supressing log messages. No hang again.

Tentative conclusion: The output of log messages by the 
server to stdout/err hangs the system somehow, when a pipe 
or whatever fills up and then blocks, causing the server to 
hang in the log output routine.

However that does not match your experience, as you talked 
to an external server. Hm.

Despite this I will update the testsuite to more than 10 
messages and supressed log output, for you to use in testing 
the other server.

andreas_kupries added on 2002-10-15 03:15:58:
Logged In: YES 
user_id=75003

The STAT command is not coming back.

andreas_kupries added on 2002-10-15 03:12:39:
Logged In: YES 
user_id=75003

Extended to 10 messages, tried testsuite. It hangs itself 
when trying to retrieve message number 7. The first 6 are ok. 
Now I can look deeper into what is happening.

andreas_kupries added on 2002-09-04 04:36:03:
Logged In: YES 
user_id=75003

Ok, the CVS head now uses the 'log' module of tcllib to trace 
the activity of the pop3 client. Places where logging was 
adding:

pop3::send
pop3::RetrFast
pop3::RetrSlow

Everything send to and retrieved from the server goes through 
these three commands.

Can you use that to create a trace of the problem when 
talking with your pop3 server ?

andreas_kupries added on 2002-09-04 04:22:45:
Logged In: YES 
user_id=75003

Allowing more than one connection to the same maildrop is 
not allowed according to the RFC (1939, see pop3d module).

dnew added on 2002-09-04 03:55:22:
Logged In: YES 
user_id=37425

Closing and reopening the connection was the work-around I used, yes. That renumbers the messages (except on 
an Exchange server, if you don't delay long enough. Strange one, that, letting multiple users modify the mailbox at 
once.)

andreas_kupries added on 2002-09-04 03:50:19:
Logged In: YES 
user_id=75003

I know, the delay is completely my responsibility. Got to work 
on the pop3 testsuite last weekend.

... Checking.
... The pop3::delete maps msgid 0 to msgid 1, but does no 
increment on the id.

What happens if you do close the connection after each 
retrieve/delete and always retrieve the first message, until 
status returns 0 messages ?

I will add log statements to the client in the evening so that 
we can trace commands, their arguments, and server 
responses.

dnew added on 2002-09-04 03:38:32:
Logged In: YES 
user_id=37425

It's been a while, but if I remember properly, it skips alternate messages. (Against the "real" pop3 servers I've tried, 
not the pop3 server in TclLib.) I just sent myself eight messages, "TEST ONE" thru "TEST EIGHT", in that order. I 
then ran this program (modified to print out the message itself as well) and the output was

x=8
msg len=940
msg= ... TEST ONE ...
msg len=980
msg= ... TEST TWO ...
msg len=950
msg= ... TEST THREE ...
msg len=960
msg= ... TEST FOUR ...
msg len=0
msg len=0
msg len=0
msg len=0

Then when I went to fetch my mail, TEST FIVE, TEST SIX, TEST SEVEN, and TEST EIGHT were still in my inbox.

Perhaps the ::pop3::delete is implicitly incrementing the message number even if given a specific message 
number?

andreas_kupries added on 2002-09-04 02:33:17:
Logged In: YES 
user_id=75003

Extended the pop3 testsuite (CVS head after Sep 3, 2002, 
12:30pm Westcoast TZ). The supplied script was used as 
template for the test. This uncovered a bug in the pop3 server 
of tcllib, introduced while fixing other bugs during the 
weekend. Fixed this bug.

I was unable to reproduce the bug. Maybe I am not using 
enough messages in the maildrop ? The server (srv.tcl) is 
currently hardwired to provide 3 messages per user, fvor two 
users.

The RFC regarding pop3 states that the server must not 
renumber messages after the deletion of a message until 
after the connection was properly closed (QUIT command). 
During the transaction message ids stay the same, and 
trying to retrieve or delete a deleted message cause a 
negative response (-ERR something).

Can you supply me with more data ? Now that we have a 
testsuite this should become easier.

andreas_kupries added on 2002-09-04 00:22:11:
Logged In: YES 
user_id=75003

This can now be tested through the pop3 testsuite.