diff --git a/src/com/fsck/k9/mail/store/ImapStore.java b/src/com/fsck/k9/mail/store/ImapStore.java index 307d52e5b..30445c24c 100644 --- a/src/com/fsck/k9/mail/store/ImapStore.java +++ b/src/com/fsck/k9/mail/store/ImapStore.java @@ -1138,14 +1138,12 @@ public class ImapStore extends Store { String remoteDestName = encodeString(encodeFolderName(iFolder.getPrefixedName())); //TODO: Split this into multiple commands if the command exceeds a certain length. - mConnection.sendCommand(String.format("UID COPY %s %s", + List responses = executeSimpleCommand(String.format("UID COPY %s %s", Utility.combine(uids, ','), - remoteDestName), false); - ImapResponse response; - do { - response = mConnection.readResponse(); - handleUntaggedResponse(response); - } while (response.mTag == null); + remoteDestName)); + + // Get the tagged response for the UID COPY command + ImapResponse response = responses.get(responses.size() - 1); Map uidMap = null; if (response.size() > 1) { @@ -2659,7 +2657,7 @@ public class ImapStore extends Store { public List executeSimpleCommand(String command) throws IOException, ImapException, MessagingException { - return executeSimpleCommand(command, false); + return executeSimpleCommand(command, false, null); } public List executeSimpleCommand(String command, boolean sensitive) throws IOException,