IMAP: fix 564, Moving / copying messages in public mailbox
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@2287 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
ad404804ad
commit
446f841a1e
|
@ -156,12 +156,7 @@ public class ImapConnection extends AbstractConnection {
|
||||||
session = ExchangeSessionFactory.getInstance(session, userName, password);
|
session = ExchangeSessionFactory.getInstance(session, userName, password);
|
||||||
if ("lsub".equalsIgnoreCase(command) || "list".equalsIgnoreCase(command)) {
|
if ("lsub".equalsIgnoreCase(command) || "list".equalsIgnoreCase(command)) {
|
||||||
if (tokens.hasMoreTokens()) {
|
if (tokens.hasMoreTokens()) {
|
||||||
String folderContext;
|
String folderContext = buildFolderContext(tokens.nextToken());
|
||||||
if (baseMailboxPath == null) {
|
|
||||||
folderContext = BASE64MailboxDecoder.decode(tokens.nextToken());
|
|
||||||
} else {
|
|
||||||
folderContext = baseMailboxPath + BASE64MailboxDecoder.decode(tokens.nextToken());
|
|
||||||
}
|
|
||||||
if (tokens.hasMoreTokens()) {
|
if (tokens.hasMoreTokens()) {
|
||||||
String folderQuery = folderContext + BASE64MailboxDecoder.decode(tokens.nextToken());
|
String folderQuery = folderContext + BASE64MailboxDecoder.decode(tokens.nextToken());
|
||||||
if (folderQuery.endsWith("%/%") && !"/%/%".equals(folderQuery)) {
|
if (folderQuery.endsWith("%/%") && !"/%/%".equals(folderQuery)) {
|
||||||
|
@ -344,7 +339,7 @@ public class ImapConnection extends AbstractConnection {
|
||||||
} else if ("copy".equalsIgnoreCase(subcommand) || "move".equalsIgnoreCase(subcommand)) {
|
} else if ("copy".equalsIgnoreCase(subcommand) || "move".equalsIgnoreCase(subcommand)) {
|
||||||
try {
|
try {
|
||||||
UIDRangeIterator uidRangeIterator = new UIDRangeIterator(currentFolder.messages, tokens.nextToken());
|
UIDRangeIterator uidRangeIterator = new UIDRangeIterator(currentFolder.messages, tokens.nextToken());
|
||||||
String targetName = BASE64MailboxDecoder.decode(tokens.nextToken());
|
String targetName = buildFolderContext(tokens.nextToken());
|
||||||
if (!uidRangeIterator.hasNext()) {
|
if (!uidRangeIterator.hasNext()) {
|
||||||
sendClient(commandId + " NO " + "No message found");
|
sendClient(commandId + " NO " + "No message found");
|
||||||
} else {
|
} else {
|
||||||
|
@ -708,6 +703,14 @@ public class ImapConnection extends AbstractConnection {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected String buildFolderContext(String folderToken) {
|
||||||
|
if (baseMailboxPath == null) {
|
||||||
|
return BASE64MailboxDecoder.decode(folderToken);
|
||||||
|
} else {
|
||||||
|
return baseMailboxPath + BASE64MailboxDecoder.decode(folderToken);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send expunge untagged response for removed IMAP message uids.
|
* Send expunge untagged response for removed IMAP message uids.
|
||||||
*
|
*
|
||||||
|
@ -1947,4 +1950,4 @@ public class ImapConnection extends AbstractConnection {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue