The following issue has been SUBMITTED. 
====================================================================== 
http://www.dbmail.org/mantis/view.php?id=483 
====================================================================== 
Reported By:                stsch
Assigned To:                
====================================================================== 
Project:                    DBMail
Issue ID:                   483
Category:                   POP3 daemon
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
target:                      
====================================================================== 
Date Submitted:             04-Jan-07 01:06 CET
Last Modified:              04-Jan-07 01:06 CET
====================================================================== 
Summary:                    Possible race condition when using dbmail-pop3d,
which results in receiving messages twice
Description: 
When using dbmail-pop3d you can run into a race condition which results
in receiving the same messages twice.

So, when a mail client sends the "QUIT" command at the end of a pop3
session,
dbmail-pop3d responds immediately with "+OK ...". After sending that
status the client disconnects and dbmail-pop3d is going on to do the
usual cleanup work which includes a call to the function
db_update_pop(..).
The function "db_update_pop" is responsible for executing an "update"
query for every deleted messages.

Calling db_update_pop(...) _after_ the client disconnects ( which is
possible because of the "+OK .." after the "QUIT" command ) , you can end
up in a situation where one dbmail-pop3d process is busy updating the
dbmail_messages table while another dbmail-pop3d process ( new pop3
session from the same client ! ) delivers the same mails to your client
twice ( the mails you received and deleted in the first pop3 session )

You can trigger this with a filled mailbox (
http://www.dbmail.org/mantis/view.php?id=173#1000 messages ) and a mail
client which starts immediately another pop3 session _after_ finishing the
first one.

So as long as the several hundred "update" queries are slower than the
"select" queries for the login of the second pop3 session ( right after
finishing the first one ) , you'll receive messages twice - race
condition.


  





====================================================================== 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
04-Jan-07 01:06 stsch          New Issue                                    
04-Jan-07 01:06 stsch          File Added: pop3_c.patch                     
======================================================================

_______________________________________________
Dbmail-dev mailing list
Dbmail-dev@dbmail.org
http://twister.fastxs.net/mailman/listinfo/dbmail-dev

Reply via email to