You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by Al Caponi <do...@yahoo.com.sg> on 2006/04/24 05:50:47 UTC

Wrong email deleted with concurrent delete and receive operations

Hi All,

I have a scenario where the wrong emails are being deleted from the user's
inbox. Has anyone encountered such problem and/or resolved it? Any help or
pointers for further troubleshooting or fix is most welcome.

VERSION:
========
Server: Apache James 2.2
Client: Chilkat 7.5 .NET Components
========

SCENARIO:
=========
1. The scenario starts with 100 messages (1st batch) in user A's inbox.

2. User A starts up his client (using Chilkat .NET components v.7.5) and
begins downloading and deleting (using the API's deleteByUIDL) each of these
100 messages one by one.
Almost simultaneously, from another client (this one using JavaMail), I send
another 100 email (2nd batch) to user A inbox.

3. User A successfully downloads all 100 from 1st batch.

4. On inspection of his inbox folder, I found 
	3 messages from 1st batch and (Expected 0)
	97 messages from 2nd batch!   (Expected 100)
	===>> It seems that at some point the 'delete' operations have
targetted the wrong messages.
=========

JAMES LOG:
==========
Here are the 100 DELE commands I extracted from the pop log (and there's
only 100). The numbering (order num?) is not consistent(?). 
This is a test server and all the DELE commands are for this scenario.

Does the DELE command come directly from the client or is there some kind of
mapping (Between UIDL and message order num) being maintained and resolved
by James?:
24/04/06 10:54:14 DEBUG pop3server: Command received: DELE 1
24/04/06 10:54:18 DEBUG pop3server: Command received: DELE 1
24/04/06 10:54:22 DEBUG pop3server: Command received: DELE 1
24/04/06 10:54:27 DEBUG pop3server: Command received: DELE 1
24/04/06 10:54:31 DEBUG pop3server: Command received: DELE 1
24/04/06 10:54:35 DEBUG pop3server: Command received: DELE 1
24/04/06 10:54:39 DEBUG pop3server: Command received: DELE 1
24/04/06 10:54:44 DEBUG pop3server: Command received: DELE 1
24/04/06 10:54:48 DEBUG pop3server: Command received: DELE 1
24/04/06 10:54:52 DEBUG pop3server: Command received: DELE 1
24/04/06 10:54:56 DEBUG pop3server: Command received: DELE 1
24/04/06 10:55:00 DEBUG pop3server: Command received: DELE 1
24/04/06 10:55:04 DEBUG pop3server: Command received: DELE 1
24/04/06 10:55:08 DEBUG pop3server: Command received: DELE 1
24/04/06 10:55:13 DEBUG pop3server: Command received: DELE 1
24/04/06 10:55:17 DEBUG pop3server: Command received: DELE 1
24/04/06 10:55:21 DEBUG pop3server: Command received: DELE 1
24/04/06 10:55:25 DEBUG pop3server: Command received: DELE 1
24/04/06 10:55:29 DEBUG pop3server: Command received: DELE 1
24/04/06 10:55:33 DEBUG pop3server: Command received: DELE 1
24/04/06 10:55:37 DEBUG pop3server: Command received: DELE 1
24/04/06 10:55:43 DEBUG pop3server: Command received: DELE 1
24/04/06 10:55:49 DEBUG pop3server: Command received: DELE 9
24/04/06 10:55:55 DEBUG pop3server: Command received: DELE 23
24/04/06 10:56:00 DEBUG pop3server: Command received: DELE 31
24/04/06 10:56:06 DEBUG pop3server: Command received: DELE 31
24/04/06 10:56:11 DEBUG pop3server: Command received: DELE 31
24/04/06 10:56:15 DEBUG pop3server: Command received: DELE 31
24/04/06 10:56:20 DEBUG pop3server: Command received: DELE 31
24/04/06 10:56:24 DEBUG pop3server: Command received: DELE 32
24/04/06 10:56:29 DEBUG pop3server: Command received: DELE 32
24/04/06 10:56:33 DEBUG pop3server: Command received: DELE 32
24/04/06 10:56:37 DEBUG pop3server: Command received: DELE 32
24/04/06 10:56:41 DEBUG pop3server: Command received: DELE 32
24/04/06 10:56:46 DEBUG pop3server: Command received: DELE 32
24/04/06 10:56:50 DEBUG pop3server: Command received: DELE 32
24/04/06 10:56:54 DEBUG pop3server: Command received: DELE 33
24/04/06 10:56:59 DEBUG pop3server: Command received: DELE 33
24/04/06 10:57:03 DEBUG pop3server: Command received: DELE 37
24/04/06 10:57:09 DEBUG pop3server: Command received: DELE 37
24/04/06 10:57:13 DEBUG pop3server: Command received: DELE 37
24/04/06 10:57:17 DEBUG pop3server: Command received: DELE 39
24/04/06 10:57:22 DEBUG pop3server: Command received: DELE 40
24/04/06 10:57:26 DEBUG pop3server: Command received: DELE 40
24/04/06 10:57:30 DEBUG pop3server: Command received: DELE 40
24/04/06 10:57:35 DEBUG pop3server: Command received: DELE 40
24/04/06 10:57:39 DEBUG pop3server: Command received: DELE 41
24/04/06 10:57:43 DEBUG pop3server: Command received: DELE 42
24/04/06 10:57:48 DEBUG pop3server: Command received: DELE 43
24/04/06 10:57:52 DEBUG pop3server: Command received: DELE 43
24/04/06 10:57:56 DEBUG pop3server: Command received: DELE 43
24/04/06 10:58:00 DEBUG pop3server: Command received: DELE 46
24/04/06 10:58:04 DEBUG pop3server: Command received: DELE 48
24/04/06 10:58:09 DEBUG pop3server: Command received: DELE 49
24/04/06 10:58:14 DEBUG pop3server: Command received: DELE 49
24/04/06 10:58:18 DEBUG pop3server: Command received: DELE 49
24/04/06 10:58:23 DEBUG pop3server: Command received: DELE 56
24/04/06 10:58:27 DEBUG pop3server: Command received: DELE 57
24/04/06 10:58:32 DEBUG pop3server: Command received: DELE 63
24/04/06 10:58:36 DEBUG pop3server: Command received: DELE 63
24/04/06 10:58:40 DEBUG pop3server: Command received: DELE 67
24/04/06 10:58:44 DEBUG pop3server: Command received: DELE 67
24/04/06 10:58:48 DEBUG pop3server: Command received: DELE 68
24/04/06 10:58:52 DEBUG pop3server: Command received: DELE 69
24/04/06 10:58:56 DEBUG pop3server: Command received: DELE 69
24/04/06 10:59:00 DEBUG pop3server: Command received: DELE 70
24/04/06 10:59:05 DEBUG pop3server: Command received: DELE 70
24/04/06 10:59:09 DEBUG pop3server: Command received: DELE 70
24/04/06 10:59:14 DEBUG pop3server: Command received: DELE 70
24/04/06 10:59:18 DEBUG pop3server: Command received: DELE 70
24/04/06 10:59:22 DEBUG pop3server: Command received: DELE 78
24/04/06 10:59:26 DEBUG pop3server: Command received: DELE 78
24/04/06 10:59:30 DEBUG pop3server: Command received: DELE 78
24/04/06 10:59:34 DEBUG pop3server: Command received: DELE 80
24/04/06 10:59:38 DEBUG pop3server: Command received: DELE 80
24/04/06 10:59:43 DEBUG pop3server: Command received: DELE 80
24/04/06 10:59:47 DEBUG pop3server: Command received: DELE 80
24/04/06 10:59:51 DEBUG pop3server: Command received: DELE 81
24/04/06 10:59:55 DEBUG pop3server: Command received: DELE 81
24/04/06 10:59:59 DEBUG pop3server: Command received: DELE 81
24/04/06 11:00:03 DEBUG pop3server: Command received: DELE 81
24/04/06 11:00:07 DEBUG pop3server: Command received: DELE 82
24/04/06 11:00:11 DEBUG pop3server: Command received: DELE 83
24/04/06 11:00:17 DEBUG pop3server: Command received: DELE 84
24/04/06 11:00:22 DEBUG pop3server: Command received: DELE 84
24/04/06 11:00:26 DEBUG pop3server: Command received: DELE 87
24/04/06 11:00:30 DEBUG pop3server: Command received: DELE 87
24/04/06 11:00:34 DEBUG pop3server: Command received: DELE 87
24/04/06 11:00:38 DEBUG pop3server: Command received: DELE 88
24/04/06 11:00:42 DEBUG pop3server: Command received: DELE 88
24/04/06 11:00:47 DEBUG pop3server: Command received: DELE 88
24/04/06 11:00:51 DEBUG pop3server: Command received: DELE 92
24/04/06 11:00:55 DEBUG pop3server: Command received: DELE 94
24/04/06 11:00:59 DEBUG pop3server: Command received: DELE 96
24/04/06 11:01:04 DEBUG pop3server: Command received: DELE 100
24/04/06 11:01:08 DEBUG pop3server: Command received: DELE 100
24/04/06 11:01:13 DEBUG pop3server: Command received: DELE 100
24/04/06 11:01:18 DEBUG pop3server: Command received: DELE 100
24/04/06 11:01:24 DEBUG pop3server: Command received: DELE 101
24/04/06 11:01:28 DEBUG pop3server: Command received: DELE 101
==========

Regards,
Al

Send instant messages to your online friends http://asia.messenger.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Wrong email deleted with concurrent delete and receive operations

Posted by Danny Angus <Da...@slc.co.uk>.
Guys, remember the significant difference between UIDL and the number from
normal list operations, UIDL provides unique ID's which should be
consistent *across* sessions, normal numbers only apply duing one session.

d.



Stefano Bagnara <ap...@bago.org> wrote on 26/04/2006 09:13:59:

> Al Caponi wrote:
> > Hi again,
> > What is the reasoning behind assigning a random number to new messages
such
> > that the latter would come and disrupt the sequence (but not the
ordering)
> > of existing emails?
>
> There is no such thing "number assignment" in James.
> We simply put messages in repositories, read messages from repositories.
> Repositories don't have a "positional" information.
>
> > It seems more intuitive to me to add new messages at the end of a list
-
> > even though the POP3 protocol does not apparently require it.
>
> That's right POP3 protocol does not require it. It neither suggest it,
> if I remember correctly.
>
> > [..]
> > Any thoughts or clarifications?
> > I have some apprehensions due to James behaving in such an 'odd way' -
which
> > I hope you can help to rationalize.
>
> It is not odd if you read the POP3 rfc.
> imho it's odd the way Chilkat  delete messages in different sessions.
>
> If this is critical to you, you can change the way the repository
> returns the message list adding a time condition.
>
> Look at the AvalonMailRepository (if using file repositories) or
> JDBCMailRepository (if using db).
> You can even implement your own CustomMailRepository extending the
> bundled one and changing only the list method.
>
> Stefano
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
>


***************************************************************************
The information in this e-mail is confidential and for use by the addressee(s) only. If you are not the intended recipient (or responsible for delivery of the message to the intended recipient) please notify us immediately on 0141 306 2050 and delete the message from your computer. You may not copy or forward it or use or disclose its contents to any other person. As Internet communications are capable of data corruption Student Loans Company Limited does not accept any  responsibility for changes made to this message after it was sent. For this reason it may be inappropriate to rely on advice or opinions contained in an e-mail without obtaining written confirmation of it. Neither Student Loans Company Limited or the sender accepts any liability or responsibility for viruses as it is your responsibility to scan attachments (if any). Opinions and views expressed in this e-mail are those of the sender and may not reflect the opinions and views of The Student Loans Company Limit
 ed.

This footnote also confirms that this email message has been swept for the presence of computer viruses.

**************************************************************************

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Wrong email deleted with concurrent delete and receive operations

Posted by Stefano Bagnara <ap...@bago.org>.
Al Caponi wrote:
> Hi again,
> What is the reasoning behind assigning a random number to new messages such
> that the latter would come and disrupt the sequence (but not the ordering)
> of existing emails?

There is no such thing "number assignment" in James.
We simply put messages in repositories, read messages from repositories.
Repositories don't have a "positional" information.

> It seems more intuitive to me to add new messages at the end of a list -
> even though the POP3 protocol does not apparently require it.

That's right POP3 protocol does not require it. It neither suggest it, 
if I remember correctly.

> [..]
> Any thoughts or clarifications?
> I have some apprehensions due to James behaving in such an 'odd way' - which
> I hope you can help to rationalize.

It is not odd if you read the POP3 rfc.
imho it's odd the way Chilkat  delete messages in different sessions.

If this is critical to you, you can change the way the repository 
returns the message list adding a time condition.

Look at the AvalonMailRepository (if using file repositories) or 
JDBCMailRepository (if using db).
You can even implement your own CustomMailRepository extending the 
bundled one and changing only the list method.

Stefano


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


RE: Wrong email deleted with concurrent delete and receive operations

Posted by Al Caponi <do...@yahoo.com.sg>.
Hi again,
What is the reasoning behind assigning a random number to new messages such
that the latter would come and disrupt the sequence (but not the ordering)
of existing emails?

It seems more intuitive to me to add new messages at the end of a list -
even though the POP3 protocol does not apparently require it.
I guess that Cyrus is adding new msgs at the end of the list thus explaining
our inability to reproduce the problem there then.

After looking at the UIDL listing for a James mailbox before and after
inserting new emails, I realized that the messages actually preserve their
_ordering_ across sessions but new messages will come and offset parts of
the existing list at different random points.

The UIDL responses below show how two new messages disrupted the _sequence_
but NOT the _ordering_.

_BEFORE_NEW_MESSAGES_			_AFTER_NEW_MESSAGES_

#	UID				#	UID
(Prev #)
1	Mail1145932157811-2379	1	Mail1145987288808-2619 <<-- (NEW)
2	Mail1145932156155-2367	2	Mail1145932157811-2379 <<-- (1) 
3	Mail1145932175686-2489	3	Mail1145932156155-2367 <<-- (2)
4	Mail1145932065343-2273	4	Mail1145932175686-2489 <<-- (3)
5	Mail1145932158077-2381	5	Mail1145932065343-2273 <<-- (4)
6	Mail1145932149920-2323	6	Mail1145932158077-2381 <<-- (5)
7	Mail1145932167420-2445	7	Mail1145932149920-2323 <<-- (6)
8	Mail1145932165405-2431	8	Mail1145987289230-2623 <<-- (NEW)
9	Mail1145932172389-2469	9	Mail1145932167420-2445 <<-- (7)
10	Mail1145932169483-2459	10	Mail1145932165405-2431 <<-- (8)
11	Mail1145932163514-2417	11	Mail1145932172389-2469 <<-- (9)
12	Mail1145932160795-2401	12	Mail1145932169483-2459 <<-- (10)
13	Mail1145932175530-2487	13	Mail1145932163514-2417 <<-- (11)
					14	Mail1145932160795-2401 <<--
(12)
					15	Mail1145932175530-2487 <<--
(13)

Any thoughts or clarifications?
I have some apprehensions due to James behaving in such an 'odd way' - which
I hope you can help to rationalize.

Cheers,
Al.

> -----Original Message-----
> From: Al Caponi [mailto:don_alcaponi@yahoo.com.sg] 
> Sent: Tuesday, April 25, 2006 11:52 AM
> To: 'James Users List'
> Subject: RE: Wrong email deleted with concurrent delete and 
> receive operations
> 
> From today's test - Chilkat sent the DELE commands without 
> any UIDL within a
> totally new session.
> So this is not accurate as there is no guarantee of the 
> msg_num (the param
> passed to DELE) for a message to remain the same across 
> different sessions.
> And this would be the reason for the deletion operations 
> possibly going
> haywire, specially when new messages are coming in concurrently.
> 
> Log command extracts for one of the messages downloaded by Chilkat -
> (UIDL,RETR) and (DELE) cmds are in different sessions:
> -----------------------------------------------------
> 25/04/06 10:29:43 DEBUG pop3sserver: [default Worker #19] 
> Command received:
> USER chilkat
> 25/04/06 10:29:43 DEBUG pop3sserver: [default Worker #19] 
> Command received:
> PASS <password omitted>
> 25/04/06 10:29:44 DEBUG pop3sserver: [default Worker #19] 
> Command received:
> STAT
> 25/04/06 10:29:44 DEBUG pop3sserver: [default Worker #19] 
> Command received:
> UIDL
> 25/04/06 10:29:44 DEBUG pop3sserver: [default Worker #19] 
> Command received:
> RETR 27
> 25/04/06 10:29:44 DEBUG pop3sserver: [default Worker #19] 
> Command received:
> QUIT
> 25/04/06 10:29:44 DEBUG pop3sserver: [default Worker #15] 
> Command received:
> USER chilkat
> 25/04/06 10:29:44 DEBUG pop3sserver: [default Worker #15] 
> Command received:
> PASS <password omitted>
> 25/04/06 10:29:44 DEBUG pop3sserver: [default Worker #15] 
> Command received:
> STAT
> 25/04/06 10:29:44 DEBUG pop3sserver: [default Worker #15] 
> Command received:
> DELE 27
> 25/04/06 10:29:44 DEBUG pop3sserver: [default Worker #15] 
> Command received:
> QUIT
> -----------------------------------------------------
> 
> Log command extracts from a JavaMail test client - all 
> operations are done
> within the same session:
> -----------------------------------------------------
> 24/04/06 21:10:45 DEBUG pop3server: [default Worker #13] 
> Command received:
> USER javaclient
> 24/04/06 21:10:45 DEBUG pop3server: [default Worker #13] 
> Command received:
> PASS <password omitted>
> 24/04/06 21:10:45 DEBUG pop3server: [default Worker #13] 
> Command received:
> STAT
> 24/04/06 21:10:45 DEBUG pop3server: [default Worker #13] 
> Command received:
> NOOP
> 24/04/06 21:10:45 DEBUG pop3server: [default Worker #13] 
> Command received:
> UIDL 1
> 24/04/06 21:10:45 DEBUG pop3server: [default Worker #13] 
> Command received:
> TOP 1 0
> 24/04/06 21:10:45 DEBUG pop3server: [default Worker #13] 
> Command received:
> RETR 1
> ...
> 24/04/06 21:10:51 DEBUG pop3server: [default Worker #13] 
> Command received:
> DELE 1
> ...
> 24/04/06 21:10:51 DEBUG pop3server: [default Worker #13] 
> Command received:
> QUIT
> -----------------------------------------------------
> 
> 
> Also, I omitted to reply about DELE9 without DELE2-7. You 
> might have figured
> out that we were doing selective 'download and delete'. That 
> would explain
> the non-consecutive msg nums.
> 
> I'll leave the JIRA alone for the time being as it's not an issue with
> James.
> 
> Thanks for the help.
> Cheers,
> Al.
> 
> > -----Original Message-----
> > From: Al Caponi [mailto:don_alcaponi@yahoo.com.sg] 
> > Sent: Monday, April 24, 2006 8:34 PM
> > To: 'James Users List'
> > Subject: RE: Wrong email deleted with concurrent delete and 
> > receive operations
> > 
> > 
> > > > 
> > > > 2. "DELE 1" commands
> > > > As for the 'DELE 1' cmds being from different connections, 
> > > I can't confirm
> > > > that as I didn't log the thread name. 
> > > > I'll need some time to re-simulate that as the client code 
> > > has changed.
> > > 
> > > What about the DELE9 with no previous DELE2-7 ?
> > > 
> > > Are the connections made concurrently?
> > > 
> > > James does not lock the pop3 inbox, so multiple concurrent 
> > > connections 
> > > for the same user may ends to unknown behaviours.
> > > 
> > > You said that you have 100 messages and you start reading them.
> > > Then you send to the same inbox more messages.
> > > 
> > > If the client close and reopen connections then it will 
> see the new 
> > > messages too.
> > > 
> > 
> > > No one ensure that the messages in pop3 are shown in 
> arrival order.
> > > 
> > 
> > Each  'download and delete' was made sequentially from a 
> > single client. The
> > latter does the following:
> > 1. Start a session.
> > 2. Grab the list of messages in the inbox.
> > 3. For each message on that list,
> > 	i.	Scan header for some proprietary meta-info to 
> > determine if
> > download is required. 
> > 	ii.	Download the message and then issue the deleteByUIDL
> > command.
> > 
> > We're processing all the messages in a single thread but we 
> > don't know yet
> > whether Chilkat handles each download and/or delete with a 
> > new session or
> > not.
> > We'll run the original code and add the thread name logging 
> > in James. Until
> > the Chilkat folks get back to us, that'll be the only 
> > guideline that we
> > have.
> > Will keep you updated.
> > 
> 
> Send instant messages to your online friends 
> http://asia.messenger.yahoo.com 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
> 

Send instant messages to your online friends http://asia.messenger.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


RE: Wrong email deleted with concurrent delete and receive operations

Posted by Al Caponi <do...@yahoo.com.sg>.
>From today's test - Chilkat sent the DELE commands without any UIDL within a
totally new session.
So this is not accurate as there is no guarantee of the msg_num (the param
passed to DELE) for a message to remain the same across different sessions.
And this would be the reason for the deletion operations possibly going
haywire, specially when new messages are coming in concurrently.

Log command extracts for one of the messages downloaded by Chilkat -
(UIDL,RETR) and (DELE) cmds are in different sessions:
-----------------------------------------------------
25/04/06 10:29:43 DEBUG pop3sserver: [default Worker #19] Command received:
USER chilkat
25/04/06 10:29:43 DEBUG pop3sserver: [default Worker #19] Command received:
PASS <password omitted>
25/04/06 10:29:44 DEBUG pop3sserver: [default Worker #19] Command received:
STAT
25/04/06 10:29:44 DEBUG pop3sserver: [default Worker #19] Command received:
UIDL
25/04/06 10:29:44 DEBUG pop3sserver: [default Worker #19] Command received:
RETR 27
25/04/06 10:29:44 DEBUG pop3sserver: [default Worker #19] Command received:
QUIT
25/04/06 10:29:44 DEBUG pop3sserver: [default Worker #15] Command received:
USER chilkat
25/04/06 10:29:44 DEBUG pop3sserver: [default Worker #15] Command received:
PASS <password omitted>
25/04/06 10:29:44 DEBUG pop3sserver: [default Worker #15] Command received:
STAT
25/04/06 10:29:44 DEBUG pop3sserver: [default Worker #15] Command received:
DELE 27
25/04/06 10:29:44 DEBUG pop3sserver: [default Worker #15] Command received:
QUIT
-----------------------------------------------------

Log command extracts from a JavaMail test client - all operations are done
within the same session:
-----------------------------------------------------
24/04/06 21:10:45 DEBUG pop3server: [default Worker #13] Command received:
USER javaclient
24/04/06 21:10:45 DEBUG pop3server: [default Worker #13] Command received:
PASS <password omitted>
24/04/06 21:10:45 DEBUG pop3server: [default Worker #13] Command received:
STAT
24/04/06 21:10:45 DEBUG pop3server: [default Worker #13] Command received:
NOOP
24/04/06 21:10:45 DEBUG pop3server: [default Worker #13] Command received:
UIDL 1
24/04/06 21:10:45 DEBUG pop3server: [default Worker #13] Command received:
TOP 1 0
24/04/06 21:10:45 DEBUG pop3server: [default Worker #13] Command received:
RETR 1
...
24/04/06 21:10:51 DEBUG pop3server: [default Worker #13] Command received:
DELE 1
...
24/04/06 21:10:51 DEBUG pop3server: [default Worker #13] Command received:
QUIT
-----------------------------------------------------


Also, I omitted to reply about DELE9 without DELE2-7. You might have figured
out that we were doing selective 'download and delete'. That would explain
the non-consecutive msg nums.

I'll leave the JIRA alone for the time being as it's not an issue with
James.

Thanks for the help.
Cheers,
Al.

> -----Original Message-----
> From: Al Caponi [mailto:don_alcaponi@yahoo.com.sg] 
> Sent: Monday, April 24, 2006 8:34 PM
> To: 'James Users List'
> Subject: RE: Wrong email deleted with concurrent delete and 
> receive operations
> 
> 
> > > 
> > > 2. "DELE 1" commands
> > > As for the 'DELE 1' cmds being from different connections, 
> > I can't confirm
> > > that as I didn't log the thread name. 
> > > I'll need some time to re-simulate that as the client code 
> > has changed.
> > 
> > What about the DELE9 with no previous DELE2-7 ?
> > 
> > Are the connections made concurrently?
> > 
> > James does not lock the pop3 inbox, so multiple concurrent 
> > connections 
> > for the same user may ends to unknown behaviours.
> > 
> > You said that you have 100 messages and you start reading them.
> > Then you send to the same inbox more messages.
> > 
> > If the client close and reopen connections then it will see the new 
> > messages too.
> > 
> 
> > No one ensure that the messages in pop3 are shown in arrival order.
> > 
> 
> Each  'download and delete' was made sequentially from a 
> single client. The
> latter does the following:
> 1. Start a session.
> 2. Grab the list of messages in the inbox.
> 3. For each message on that list,
> 	i.	Scan header for some proprietary meta-info to 
> determine if
> download is required. 
> 	ii.	Download the message and then issue the deleteByUIDL
> command.
> 
> We're processing all the messages in a single thread but we 
> don't know yet
> whether Chilkat handles each download and/or delete with a 
> new session or
> not.
> We'll run the original code and add the thread name logging 
> in James. Until
> the Chilkat folks get back to us, that'll be the only 
> guideline that we
> have.
> Will keep you updated.
> 

Send instant messages to your online friends http://asia.messenger.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


RE: Wrong email deleted with concurrent delete and receive operations

Posted by Al Caponi <do...@yahoo.com.sg>.
> > 
> > 2. "DELE 1" commands
> > As for the 'DELE 1' cmds being from different connections, 
> I can't confirm
> > that as I didn't log the thread name. 
> > I'll need some time to re-simulate that as the client code 
> has changed.
> 
> What about the DELE9 with no previous DELE2-7 ?
> 
> Are the connections made concurrently?
> 
> James does not lock the pop3 inbox, so multiple concurrent 
> connections 
> for the same user may ends to unknown behaviours.
> 
> You said that you have 100 messages and you start reading them.
> Then you send to the same inbox more messages.
> 
> If the client close and reopen connections then it will see the new 
> messages too.
> 

> No one ensure that the messages in pop3 are shown in arrival order.
> 

Each  'download and delete' was made sequentially from a single client. The
latter does the following:
1. Start a session.
2. Grab the list of messages in the inbox.
3. For each message on that list,
	i.	Scan header for some proprietary meta-info to determine if
download is required. 
	ii.	Download the message and then issue the deleteByUIDL
command.

We're processing all the messages in a single thread but we don't know yet
whether Chilkat handles each download and/or delete with a new session or
not.
We'll run the original code and add the thread name logging in James. Until
the Chilkat folks get back to us, that'll be the only guideline that we
have.
Will keep you updated.

> > 4. Mail repository
> > We're using the file repository. Any special recommendation 
> for or against
> > it?
> 
> No, I just wanted to gather more informations.

Well, we went with the file repository because it was the default setting. I
hope to have the time to explore the other options.


Hi Danny,
Thanks for the response, will raise it in JIRA

Send instant messages to your online friends http://asia.messenger.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Wrong email deleted with concurrent delete and receive operations

Posted by Stefano Bagnara <ap...@bago.org>.
Al Caponi wrote:
> Hi Stefano and All,
> Thanks for the quick reply.
> 
> 2. "DELE 1" commands
> As for the 'DELE 1' cmds being from different connections, I can't confirm
> that as I didn't log the thread name. 
> I'll need some time to re-simulate that as the client code has changed.

What about the DELE9 with no previous DELE2-7 ?

Are the connections made concurrently?

James does not lock the pop3 inbox, so multiple concurrent connections 
for the same user may ends to unknown behaviours.

You said that you have 100 messages and you start reading them.
Then you send to the same inbox more messages.

If the client close and reopen connections then it will see the new 
messages too.

No one ensure that the messages in pop3 are shown in arrival order.

> 3. UIDL support
> I do see UIDLs being generated by James and I also see James responding to
> UIDL commands. I telnet in and issued the commmand and it responded.
> Do you mean 'does not fully support'? Where could we have more details?

Sorry, I was wrong. I was remembering that James pop3server was not 
supporting the UIDL command, but I just checked that it does.

> 4. Mail repository
> We're using the file repository. Any special recommendation for or against
> it?

No, I just wanted to gather more informations.

Stefano


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


RE: Wrong email deleted with concurrent delete and receive operations

Posted by Al Caponi <do...@yahoo.com.sg>.
Hi Stefano and All,
Thanks for the quick reply.

1. Bug in Chilkat
In order to narrow down our troubleshooting scope, we ran the same tests
_repeatedly_ against a Cyrus POP3 v2.0.17 email server and there was no
problem w.r.t to the message deletion.
This seemed to tell me that the problem might lie elsewhere. But I wouldn't
say that it cleared any one of Chilkat or James.
Similarly, I've been unable to reproduce the error with my test JavaMail
client and James in the same scenario.

2. "DELE 1" commands
As for the 'DELE 1' cmds being from different connections, I can't confirm
that as I didn't log the thread name. 
I'll need some time to re-simulate that as the client code has changed.

3. UIDL support
I do see UIDLs being generated by James and I also see James responding to
UIDL commands. I telnet in and issued the commmand and it responded.
Do you mean 'does not fully support'? Where could we have more details?

4. Mail repository
We're using the file repository. Any special recommendation for or against
it?


Thanks again,
Al

-----Original Message-----
From: Stefano Bagnara [mailto:apache@bago.org] 
Sent: Monday, April 24, 2006 3:26 PM
To: James Users List
Subject: Re: Wrong email deleted with concurrent delete and receive
operations

I think this is a bug in "Chilkat .NET components".
You receive a bunch of "DELE 1" while it should never delete the same 
message again and again.
If the "DELE 1" are from different connections then I can't explain the 
DELE 9 with no previous DELE 1 to DELE 7.

James pop3 server does not support UIDL. It is not mandatory for POP3 
protocol.
James pop3 server does keep track of message numbers and deletes the 
correct message (based on the order returned to the LIST command).

What mail repository do you use? db / dbfile / file ?

Stefano

Al Caponi wrote:
> Hi All,
> 
> I have a scenario where the wrong emails are being deleted from the user's
> inbox. Has anyone encountered such problem and/or resolved it? Any help or
> pointers for further troubleshooting or fix is most welcome.
> 
> VERSION:
> ========
> Server: Apache James 2.2
> Client: Chilkat 7.5 .NET Components
> ========
> 24/04/06 10:55:17 DEBUG pop3server: Command received: DELE 1
> 24/04/06 10:55:21 DEBUG pop3server: Command received: DELE 1
> 24/04/06 10:55:25 DEBUG pop3server: Command received: DELE 1
> 24/04/06 10:55:29 DEBUG pop3server: Command received: DELE 1
> 24/04/06 10:55:33 DEBUG pop3server: Command received: DELE 1
> 24/04/06 10:55:37 DEBUG pop3server: Command received: DELE 1
> 24/04/06 10:55:43 DEBUG pop3server: Command received: DELE 1
> 24/04/06 10:55:49 DEBUG pop3server: Command received: DELE 9
> 24/04/06 10:55:55 DEBUG pop3server: Command received: DELE 23
> 24/04/06 10:56:00 DEBUG pop3server: Command received: DELE 31


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org

Send instant messages to your online friends http://asia.messenger.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Wrong email deleted with concurrent delete and receive operations

Posted by Stefano Bagnara <ap...@bago.org>.
I think this is a bug in "Chilkat .NET components".
You receive a bunch of "DELE 1" while it should never delete the same 
message again and again.
If the "DELE 1" are from different connections then I can't explain the 
DELE 9 with no previous DELE 1 to DELE 7.

James pop3 server does not support UIDL. It is not mandatory for POP3 
protocol.
James pop3 server does keep track of message numbers and deletes the 
correct message (based on the order returned to the LIST command).

What mail repository do you use? db / dbfile / file ?

Stefano

Al Caponi wrote:
> Hi All,
> 
> I have a scenario where the wrong emails are being deleted from the user's
> inbox. Has anyone encountered such problem and/or resolved it? Any help or
> pointers for further troubleshooting or fix is most welcome.
> 
> VERSION:
> ========
> Server: Apache James 2.2
> Client: Chilkat 7.5 .NET Components
> ========
> 24/04/06 10:55:17 DEBUG pop3server: Command received: DELE 1
> 24/04/06 10:55:21 DEBUG pop3server: Command received: DELE 1
> 24/04/06 10:55:25 DEBUG pop3server: Command received: DELE 1
> 24/04/06 10:55:29 DEBUG pop3server: Command received: DELE 1
> 24/04/06 10:55:33 DEBUG pop3server: Command received: DELE 1
> 24/04/06 10:55:37 DEBUG pop3server: Command received: DELE 1
> 24/04/06 10:55:43 DEBUG pop3server: Command received: DELE 1
> 24/04/06 10:55:49 DEBUG pop3server: Command received: DELE 9
> 24/04/06 10:55:55 DEBUG pop3server: Command received: DELE 23
> 24/04/06 10:56:00 DEBUG pop3server: Command received: DELE 31


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Wrong email deleted with concurrent delete and receive operations

Posted by Danny Angus <da...@gmail.com>.
I think this may be a defect in James, but would need to re-read the
POP3 spec before I can be sure. Please raise this as an issue in the
JIRA issue tracker.

http://issues.apache.org/jira/secure/Dashboard.jspa

d.

On 24/04/06, Al Caponi <do...@yahoo.com.sg> wrote:
> Hi All,
>
> I have a scenario where the wrong emails are being deleted from the user's
> inbox. Has anyone encountered such problem and/or resolved it? Any help or
> pointers for further troubleshooting or fix is most welcome.
>
> VERSION:
> ========
> Server: Apache James 2.2
> Client: Chilkat 7.5 .NET Components
> ========
>
> SCENARIO:
> =========
> 1. The scenario starts with 100 messages (1st batch) in user A's inbox.
>
> 2. User A starts up his client (using Chilkat .NET components v.7.5) and
> begins downloading and deleting (using the API's deleteByUIDL) each of these
> 100 messages one by one.
> Almost simultaneously, from another client (this one using JavaMail), I send
> another 100 email (2nd batch) to user A inbox.
>
> 3. User A successfully downloads all 100 from 1st batch.
>
> 4. On inspection of his inbox folder, I found
>         3 messages from 1st batch and (Expected 0)
>         97 messages from 2nd batch!   (Expected 100)
>         ===>> It seems that at some point the 'delete' operations have
> targetted the wrong messages.
> =========
>
> JAMES LOG:
> ==========
> Here are the 100 DELE commands I extracted from the pop log (and there's
> only 100). The numbering (order num?) is not consistent(?).
> This is a test server and all the DELE commands are for this scenario.
>
> Does the DELE command come directly from the client or is there some kind of
> mapping (Between UIDL and message order num) being maintained and resolved
> by James?:
> 24/04/06 10:54:14 DEBUG pop3server: Command received: DELE 1
> 24/04/06 10:54:18 DEBUG pop3server: Command received: DELE 1
> 24/04/06 10:54:22 DEBUG pop3server: Command received: DELE 1
> 24/04/06 10:54:27 DEBUG pop3server: Command received: DELE 1
> 24/04/06 10:54:31 DEBUG pop3server: Command received: DELE 1
> 24/04/06 10:54:35 DEBUG pop3server: Command received: DELE 1
> 24/04/06 10:54:39 DEBUG pop3server: Command received: DELE 1
> 24/04/06 10:54:44 DEBUG pop3server: Command received: DELE 1
> 24/04/06 10:54:48 DEBUG pop3server: Command received: DELE 1
> 24/04/06 10:54:52 DEBUG pop3server: Command received: DELE 1
> 24/04/06 10:54:56 DEBUG pop3server: Command received: DELE 1
> 24/04/06 10:55:00 DEBUG pop3server: Command received: DELE 1
> 24/04/06 10:55:04 DEBUG pop3server: Command received: DELE 1
> 24/04/06 10:55:08 DEBUG pop3server: Command received: DELE 1
> 24/04/06 10:55:13 DEBUG pop3server: Command received: DELE 1
> 24/04/06 10:55:17 DEBUG pop3server: Command received: DELE 1
> 24/04/06 10:55:21 DEBUG pop3server: Command received: DELE 1
> 24/04/06 10:55:25 DEBUG pop3server: Command received: DELE 1
> 24/04/06 10:55:29 DEBUG pop3server: Command received: DELE 1
> 24/04/06 10:55:33 DEBUG pop3server: Command received: DELE 1
> 24/04/06 10:55:37 DEBUG pop3server: Command received: DELE 1
> 24/04/06 10:55:43 DEBUG pop3server: Command received: DELE 1
> 24/04/06 10:55:49 DEBUG pop3server: Command received: DELE 9
> 24/04/06 10:55:55 DEBUG pop3server: Command received: DELE 23
> 24/04/06 10:56:00 DEBUG pop3server: Command received: DELE 31
> 24/04/06 10:56:06 DEBUG pop3server: Command received: DELE 31
> 24/04/06 10:56:11 DEBUG pop3server: Command received: DELE 31
> 24/04/06 10:56:15 DEBUG pop3server: Command received: DELE 31
> 24/04/06 10:56:20 DEBUG pop3server: Command received: DELE 31
> 24/04/06 10:56:24 DEBUG pop3server: Command received: DELE 32
> 24/04/06 10:56:29 DEBUG pop3server: Command received: DELE 32
> 24/04/06 10:56:33 DEBUG pop3server: Command received: DELE 32
> 24/04/06 10:56:37 DEBUG pop3server: Command received: DELE 32
> 24/04/06 10:56:41 DEBUG pop3server: Command received: DELE 32
> 24/04/06 10:56:46 DEBUG pop3server: Command received: DELE 32
> 24/04/06 10:56:50 DEBUG pop3server: Command received: DELE 32
> 24/04/06 10:56:54 DEBUG pop3server: Command received: DELE 33
> 24/04/06 10:56:59 DEBUG pop3server: Command received: DELE 33
> 24/04/06 10:57:03 DEBUG pop3server: Command received: DELE 37
> 24/04/06 10:57:09 DEBUG pop3server: Command received: DELE 37
> 24/04/06 10:57:13 DEBUG pop3server: Command received: DELE 37
> 24/04/06 10:57:17 DEBUG pop3server: Command received: DELE 39
> 24/04/06 10:57:22 DEBUG pop3server: Command received: DELE 40
> 24/04/06 10:57:26 DEBUG pop3server: Command received: DELE 40
> 24/04/06 10:57:30 DEBUG pop3server: Command received: DELE 40
> 24/04/06 10:57:35 DEBUG pop3server: Command received: DELE 40
> 24/04/06 10:57:39 DEBUG pop3server: Command received: DELE 41
> 24/04/06 10:57:43 DEBUG pop3server: Command received: DELE 42
> 24/04/06 10:57:48 DEBUG pop3server: Command received: DELE 43
> 24/04/06 10:57:52 DEBUG pop3server: Command received: DELE 43
> 24/04/06 10:57:56 DEBUG pop3server: Command received: DELE 43
> 24/04/06 10:58:00 DEBUG pop3server: Command received: DELE 46
> 24/04/06 10:58:04 DEBUG pop3server: Command received: DELE 48
> 24/04/06 10:58:09 DEBUG pop3server: Command received: DELE 49
> 24/04/06 10:58:14 DEBUG pop3server: Command received: DELE 49
> 24/04/06 10:58:18 DEBUG pop3server: Command received: DELE 49
> 24/04/06 10:58:23 DEBUG pop3server: Command received: DELE 56
> 24/04/06 10:58:27 DEBUG pop3server: Command received: DELE 57
> 24/04/06 10:58:32 DEBUG pop3server: Command received: DELE 63
> 24/04/06 10:58:36 DEBUG pop3server: Command received: DELE 63
> 24/04/06 10:58:40 DEBUG pop3server: Command received: DELE 67
> 24/04/06 10:58:44 DEBUG pop3server: Command received: DELE 67
> 24/04/06 10:58:48 DEBUG pop3server: Command received: DELE 68
> 24/04/06 10:58:52 DEBUG pop3server: Command received: DELE 69
> 24/04/06 10:58:56 DEBUG pop3server: Command received: DELE 69
> 24/04/06 10:59:00 DEBUG pop3server: Command received: DELE 70
> 24/04/06 10:59:05 DEBUG pop3server: Command received: DELE 70
> 24/04/06 10:59:09 DEBUG pop3server: Command received: DELE 70
> 24/04/06 10:59:14 DEBUG pop3server: Command received: DELE 70
> 24/04/06 10:59:18 DEBUG pop3server: Command received: DELE 70
> 24/04/06 10:59:22 DEBUG pop3server: Command received: DELE 78
> 24/04/06 10:59:26 DEBUG pop3server: Command received: DELE 78
> 24/04/06 10:59:30 DEBUG pop3server: Command received: DELE 78
> 24/04/06 10:59:34 DEBUG pop3server: Command received: DELE 80
> 24/04/06 10:59:38 DEBUG pop3server: Command received: DELE 80
> 24/04/06 10:59:43 DEBUG pop3server: Command received: DELE 80
> 24/04/06 10:59:47 DEBUG pop3server: Command received: DELE 80
> 24/04/06 10:59:51 DEBUG pop3server: Command received: DELE 81
> 24/04/06 10:59:55 DEBUG pop3server: Command received: DELE 81
> 24/04/06 10:59:59 DEBUG pop3server: Command received: DELE 81
> 24/04/06 11:00:03 DEBUG pop3server: Command received: DELE 81
> 24/04/06 11:00:07 DEBUG pop3server: Command received: DELE 82
> 24/04/06 11:00:11 DEBUG pop3server: Command received: DELE 83
> 24/04/06 11:00:17 DEBUG pop3server: Command received: DELE 84
> 24/04/06 11:00:22 DEBUG pop3server: Command received: DELE 84
> 24/04/06 11:00:26 DEBUG pop3server: Command received: DELE 87
> 24/04/06 11:00:30 DEBUG pop3server: Command received: DELE 87
> 24/04/06 11:00:34 DEBUG pop3server: Command received: DELE 87
> 24/04/06 11:00:38 DEBUG pop3server: Command received: DELE 88
> 24/04/06 11:00:42 DEBUG pop3server: Command received: DELE 88
> 24/04/06 11:00:47 DEBUG pop3server: Command received: DELE 88
> 24/04/06 11:00:51 DEBUG pop3server: Command received: DELE 92
> 24/04/06 11:00:55 DEBUG pop3server: Command received: DELE 94
> 24/04/06 11:00:59 DEBUG pop3server: Command received: DELE 96
> 24/04/06 11:01:04 DEBUG pop3server: Command received: DELE 100
> 24/04/06 11:01:08 DEBUG pop3server: Command received: DELE 100
> 24/04/06 11:01:13 DEBUG pop3server: Command received: DELE 100
> 24/04/06 11:01:18 DEBUG pop3server: Command received: DELE 100
> 24/04/06 11:01:24 DEBUG pop3server: Command received: DELE 101
> 24/04/06 11:01:28 DEBUG pop3server: Command received: DELE 101
> ==========
>
> Regards,
> Al
>
> Send instant messages to your online friends http://asia.messenger.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org