mail-api icon indicating copy to clipboard operation
mail-api copied to clipboard

UID MOVE/COPY support

Open glassfishrobot opened this issue 6 years ago • 2 comments

When trying to switch a client to use moveUIDMessages instead of moveMessages, I noticed that the IMAPProtocol still issues a MOVE command with sequence numbers to move the messages. Instead, the only difference seems to be the parsing of the COPYUID tagged response.

I had expected it to use the UID MOVE command, especially since the moveuid method already depends on both the MOVE and UIDPLUS extensions, and copymoveUIDMessages already fetches UID information for all messages.

The same applies to copyUIDMessages and UID COPY, except that it does not rely on the MOVE extension.

The only releated issue I could find is #167. The conversaion seems to imply that the correct way to support this would be new methods (moveMessagesByUID, copyMessagesByUID), which of course would also be fine to keep backwards-compatibility, even though the existing methods seem fitting (from my layman's perspective).

glassfishrobot avatar Aug 09 '18 15:08 glassfishrobot

  • Issue Imported From: https://github.com/javaee/javamail/issues/329
  • Original Issue Raised By:@oxc
  • Original Issue Assigned To: Unassigned

glassfishrobot avatar Sep 10 '18 06:09 glassfishrobot

@bshannon Commented Is this causing any problem? Is anything not working correctly because of this?

The IMAP protocol was designed with sequence numbers as the primary way to identify messages, and that's what JavaMail uses. If both the UID and the sequence number for a message are known, the sequence number is preferred. There's an issue requesting better support for a UID-only model, but that's a significant change to JavaMail.

Adding the "ByUID" methods is still worth considering as a workaround for the case where you have the UIDs of the messages but not the Message objects.

glassfishrobot avatar Aug 15 '18 23:08 glassfishrobot