iPhone leaving POP3 lock on mail server until powered off

Yesterday, I had a new iPhone user complain that they were getting a message about a POP3 lock when attempting to get new messages from the mail server after checking email on their iPhone.  I have been doing this for sometime and never noticed this issue, but decided to investigate further when I had time.

This morning, I ran a number of tests and was able to easily reproduce the lock message when attempting to check email after the iPhone had checked the POP3 server for email.  This is typical behavior that I have experienced when using multiple computers and one POP3 account.  The lock file is used to ensure that only one computer is updating the mailbox at one time (since typical POP3 behavior is to download messages AND remove them from the server). 

What I was surprised to find was that after I exited the Mail application on the iPhone and left it at the Home screen… the lock persisted on the mail server.  I waited a minute, and was still getting the message about the lock existing on my POP3 mail server.

I found through trial and error that it appears the iPhone continues to maintain the lock on the POP3 server until the phone is powered off.  In our case, 15secs after the iPhone is powered off, the lock is removed from the mail server (or at least allows the desktop mail client to download mails from that POP3 account).

After finding this, I realized that my common behavior would have never caused this to appear (for me).  My typical use case is that I check emails while out-and-about, or in a meeting.  When I have checked messages, I power off the phone.   I return to my computer and press Send/Receive (or Get Messages) and the new emails come down without an issue.  I guess I have never checked my email on my iPhone and while the phone is still on try to check them from my computer.