Happy-the-monk has asked for the wisdom of the Perl Monks concerning the following question:
Wise monks,
When I took over legacy POP3 mail processing production code years ago, it had a number of bugs to fix. Not having much time to do it, I fixed some of the bugs as time permitted.
A serious bug that's a bit over my head is when concurrent POP3-clients try to delete the same mail message using Mail::POP3Client -
each client would first fetch the mail at $id, read the headers to see if the message-id is the right one, then delete it on the POP3 server.
Imagine two clients trying to do that with the same message - each would fetch it, find it to be the right one and send the delete request. Add a little network latency and two different messages would be deleted.
I guess I am looking for a kind of file/Flock way to allow only one client at a time to prepare and execute a deletion, having the others wait until it has finished.
But I am certain, other people will have had the same problem before me and may have got better solutions. Could you point me towards it?
Cheers, Sören
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Locking a POP3 Mailbox
by exussum0 (Vicar) on May 01, 2004 at 13:02 UTC | |
|
Re: Locking a POP3 Mailbox
by kappa (Chaplain) on May 01, 2004 at 16:36 UTC | |
by exussum0 (Vicar) on May 02, 2004 at 05:12 UTC | |
|
Re: Locking a POP3 Mailbox
by sgifford (Prior) on May 01, 2004 at 16:10 UTC | |
by sgifford (Prior) on May 01, 2004 at 16:14 UTC |