title: getting the 'seen' flag doesn't seem to work
body: <p>I'm playing around with java's default pop3 implementation and having trouble getting it to read the actual state of flags (i think).</p>
  
  <p>Here's the (abbreviated) code:</p>
  
  <pre><code>Store store = null;
  Folder folder = null;
  try
  {
      Session mailSession = Session.getInstance(new Properties(), null);
      store = mailSession.getStore("pop3");
      store.connect(host, addr, pwd);
      folder = store.getFolder("INBOX");
      folder.open(Folder.READ_WRITE);
  
      for (Message msg : folder.getMessages())
      {
          if (msg.isSet(Flag.SEEN))
              continue;
  
          LOG.debug("processing email titled '" + msg.getSubject()
                  + "' from '" + msg.getFrom()[0] + "'");
  
          ... do some stuff
  
          msg.setFlag(Flag.SEEN, true);
      }
  }
  finally
  {
          if (folder != null)
              folder.close(true);
          if (store != null)
              store.close();
  }
  </code></pre>
  
  <p>The problem is that each time the above code is executed, the same messages (all of them) are processed because the call to <code>msg.isSet(Flag.SEEN)</code> always returns false, even though I have set it to true in the previous iteration.</p>
  
  <p>The webmail client even reflects the flag being set (title changes from bold to normal font).</p>
  
  <p>Does anyone know what I'm doing wrong?</p>
  
  <p>thanks, p.</p>