Q: How can I tell which messages are new with POP3?
A: The POP3 protocol doesn't provide support for any permanent flags so the RECENT flag is of no use. The com.sun.mail.pop3 package documentation discusses several strategies for dealing with this problem. Q: Why does hasNewMessages() always return false when using POP3?
A: The POP3 protocol provides no way to determine whether a folder has new messages. 

解决方案 »

  1.   

    "The com.sun.mail.pop3 package documentation discusses several strategies for dealing with this problem"
      我没有找到其文档中有关于这个问题地描述,能否直接给出这些解决方案的
    描述?
      我的问题:要写一个客户程序,它从pop3服务器中获取新邮件,但是并不
    将其删除,但是不排除其他客户端对其删除的情况。等到退出后第二次登陆
    pop3服务器时,我应该知道在这两次登陆期间新到的然而未被其他客户端删除
    的那些邮件列表。在解决方案中,我设想了一个,但不可靠:
        /* 读取 Received Date(存在于,邮件消息诸个Received头部中的第一个)
          取各个邮件的最大值,存于本地,作为下次查询新邮件的条件,凡是大于
          此Received Date的邮件均为新邮件。
          正如你所说,Received Date不可靠。*/