Search code examples
pop3openpop

Does POP client ignores new emails for a connected client?


I was trying to get new emails using OpenPop.Net. I see this example and noticed this example assumes that when we are connected to pop client, email indexes(ids) will not change (when uses index to fetch new email).

    for(int i = 0; i<uids.Count; i++)
    {
       //...
       //then
       Message unseenMessage = client.GetMessage(i + 1);
       //...
    }

However it is possible that we receive new email(s).

Is this assumption true even if we receive new email(s)?

EDIT: I do not speak about UID. I mean, we use the for loop to get the i-th new email with client.GetMessage(i), but if we receive a new email when we are in loop and it change index (this new email can be geted by client.GetMessage(1)). doesn't it mean we lost an email or for connected client this new one will ignore?


Solution

  • The way the POP3 protocol works is that new messages are ignored until you log out and log back in again.

    In other words, when you authenticate to the server, what your client sees is a snapshot of that moment in time when you first logged in. In order to see new messages, you will need to reconnect.