Document information

Document ID:4660
Subject:POP3 server get locked when using with iPhone/iPad. How to solve this problem
Creation date:12/14/15 4:35 PM
Last modified on:12/14/15 4:35 PM


iPhone/iPad problem with POP3

By design, a POP3 server only serve one instance of a user at a given time. Meaning if you have two or more POP3 clients connecting as same user, the server will only serve one client. Prior to serving a client, the POP3 server locks user's mailbox so that it cannot be opened by another client.

This is usually not a problem if you are only accessing your emails from one client, such as Outlook or Thunderbird. Often users want to fetch emails on their mobile devices such as iPhone or iPad.

The current version of iOS (v 5.0.1 - 9A405) does not close a POP3 connecting after fetching messages. This leaves the mailbox locked on the server. Consider the following example showing communication between iPhone and Xeams (this is true with any POP3 server, not just Xeams).


2012-03-02 15:22:34,836 - 3/2/12 3:22 PM - [       1] ************** New Connection from: 192.168.1.2 ************** 
2012-03-02 15:22:34,836 - 3/2/12 3:22 PM - [       1] S <-- +OK Synametrics POP3 server ready 3/2/12 3:22 PM
2012-03-02 15:22:34,856 - 3/2/12 3:22 PM - [       1] C --> USER iphone@xyz.com
2012-03-02 15:22:34,856 - 3/2/12 3:22 PM - [       1] S <-- +OK 
2012-03-02 15:22:34,856 - 3/2/12 3:22 PM - [       1] C --> PASS ********
2012-03-02 15:22:34,856 - 3/2/12 3:22 PM - [       1] S <-- +OK User successfully logged on.
2012-03-02 15:22:34,866 - 3/2/12 3:22 PM - [       1] C --> STAT
2012-03-02 15:22:34,876 - 3/2/12 3:22 PM - [       1] S <-- +OK 3 33726
2012-03-02 15:22:34,876 - 3/2/12 3:22 PM - [       1] C --> UIDL
2012-03-02 15:22:34,886 - 3/2/12 3:22 PM - [       1] S <-- +OK Mailbox scan listing follows
2012-03-02 15:22:34,886 - 3/2/12 3:22 PM - [       1] S <-- 1 Inbox:89681
2012-03-02 15:22:34,886 - 3/2/12 3:22 PM - [       1] S <-- 2 Inbox:89697
2012-03-02 15:22:34,886 - 3/2/12 3:22 PM - [       1] S <-- 3 Inbox:89699
2012-03-02 15:22:34,886 - 3/2/12 3:22 PM - [       1] S <-- .
2012-03-02 15:22:51,320 - 3/2/12 3:27 PM - [       1] C --> QUIT
2012-03-02 15:22:51,320 - 3/2/12 3:27 PM - [       1] S <-- +OK Chalo pachi milsu
2012-03-02 15:22:51,330 - 3/2/12 3:27 PM - [       1] ~~~~~~~~~~~~~~ Connection closed: 192.168.1.2 (16494 ms)~~~~~~~~~~~~~~ 
2012-03-02 15:22:51,390 - 3/2/12 3:27 PM - [       2] ************** New Connection from: 192.168.1.2 ************** 
2012-03-02 15:22:51,390 - 3/2/12 3:27 PM - [       2] S <-- +OK Synametrics POP3 server ready 3/2/12 3:22 PM
2012-03-02 15:22:51,410 - 3/2/12 3:27 PM - [       2] C --> USER iphone@xyz.com
2012-03-02 15:22:51,410 - 3/2/12 3:27 PM - [       2] S <-- +OK 
2012-03-02 15:22:51,410 - 3/2/12 3:27 PM - [       2] C --> PASS ********
2012-03-02 15:22:51,410 - 3/2/12 3:27 PM - [       2] S <-- +OK User successfully logged on.
2012-03-02 15:22:51,420 - 3/2/12 3:27 PM - [       2] C --> STAT
2012-03-02 15:22:51,430 - 3/2/12 3:27 PM - [       2] S <-- +OK 3 33726
2012-03-02 15:22:51,430 - 3/2/12 3:27 PM - [       2] C --> UIDL
2012-03-02 15:22:51,430 - 3/2/12 3:27 PM - [       2] S <-- +OK Mailbox scan listing follows
2012-03-02 15:22:51,430 - 3/2/12 3:27 PM - [       2] S <-- 1 Inbox:89681
2012-03-02 15:22:51,430 - 3/2/12 3:27 PM - [       2] S <-- 2 Inbox:89697
2012-03-02 15:22:51,430 - 3/2/12 3:27 PM - [       2] S <-- 3 Inbox:89699
2012-03-02 15:22:51,430 - 3/2/12 3:27 PM - [       2] S <-- .



The log displayed above show communication between an iPhone and Xeams for 2 connections, first displayed in blue and second in red. The problem is that iPhone does not send a QUIT command once it is done checking for emails. Check the lines highlighted in yellow. Although these lines are part of the same connection, they are five minutes apart.

The second connection was forced by clicking the refresh button on iPhone. It does not close the TCP/IP connection until the user refreshes the screen, or the connection times out.

Most POP3 servers will lock the user's account for about 10 minutes. This means once you check email from iPhone/iPad you cannot connect from any other POP3 client for the next 10 minutes.

The POP3 specification require that servers should lock the repository to prevent repository corruption. Therefore, changing this logic in Xeams would violate the rules in POP3 RFC.

User comments

Posted by Dwight Hugget on 3/13/12 1:39 PM

To work arround this do the following, example Dwight Hugget user: - create an account, say iphoneDH@domain.com - from my real account DH@domain.com, forward a copy of all incoming mail to iphoneDH@domain.com. - configure iphone to access iphoneDH account. Solved and this to me is clean and manageable.


Add a comment to this document

Do you have a helpful tip related to this document that you'd like to share with other users? Please add it below. Your name and tip will appear at the end of the document text.
Your name:
Your email:
Hide my email address
Verification code:
Enter the verification code you see above more submitting your tip
Tip:Please limit tips to 1000 characters