james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r1161999 - in /james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor: LSubProcessor.java ListProcessor.java
Date Fri, 26 Aug 2011 05:47:03 GMT
Author: norman
Date: Fri Aug 26 05:47:02 2011
New Revision: 1161999

URL: http://svn.apache.org/viewvc?rev=1161999&view=rev
Log:
Make sure we also decode/encode the LSUB/LIST/XLIST reference and mailboxname when filter
for mailboxes. See IMAP-330

Modified:
    james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/LSubProcessor.java
    james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/ListProcessor.java

Modified: james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/LSubProcessor.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/LSubProcessor.java?rev=1161999&r1=1161998&r2=1161999&view=diff
==============================================================================
--- james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/LSubProcessor.java
(original)
+++ james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/LSubProcessor.java
Fri Aug 26 05:47:02 2011
@@ -24,6 +24,7 @@ import java.util.Collection;
 
 import org.apache.james.imap.api.ImapCommand;
 import org.apache.james.imap.api.ImapSessionUtils;
+import org.apache.james.imap.api.display.CharsetUtil;
 import org.apache.james.imap.api.display.HumanReadableText;
 import org.apache.james.imap.api.message.response.StatusResponseFactory;
 import org.apache.james.imap.api.process.ImapProcessor;
@@ -59,12 +60,12 @@ public class LSubProcessor extends Abstr
         boolean isRelative = ((finalReferencename + mailboxName).charAt(0) != MailboxConstants.NAMESPACE_PREFIX_CHAR);
         MailboxPath basePath = null;
         if (isRelative) {
-            basePath = new MailboxPath(MailboxConstants.USER_NAMESPACE, mailboxSession.getUser().getUserName(),
finalReferencename);
+            basePath = new MailboxPath(MailboxConstants.USER_NAMESPACE, mailboxSession.getUser().getUserName(),
CharsetUtil.decodeModifiedUTF7(finalReferencename));
         } else {
-            basePath = buildFullPath(session, finalReferencename);
+            basePath = buildFullPath(session, CharsetUtil.decodeModifiedUTF7(finalReferencename));
         }
 
-        final MailboxQuery expression = new MailboxQuery(basePath, mailboxName, mailboxSession.getPathDelimiter());
+        final MailboxQuery expression = new MailboxQuery(basePath, CharsetUtil.decodeModifiedUTF7(mailboxName),
mailboxSession.getPathDelimiter());
         final Collection<String> mailboxResponses = new ArrayList<String>();
         for (final String mailbox : mailboxes) {
             respond(responder, expression, mailbox, true, mailboxes, mailboxResponses, mailboxSession.getPathDelimiter());

Modified: james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/ListProcessor.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/ListProcessor.java?rev=1161999&r1=1161998&r2=1161999&view=diff
==============================================================================
--- james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/ListProcessor.java
(original)
+++ james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/ListProcessor.java
Fri Aug 26 05:47:02 2011
@@ -25,6 +25,7 @@ import java.util.List;
 import org.apache.james.imap.api.ImapCommand;
 import org.apache.james.imap.api.ImapMessage;
 import org.apache.james.imap.api.ImapSessionUtils;
+import org.apache.james.imap.api.display.CharsetUtil;
 import org.apache.james.imap.api.display.HumanReadableText;
 import org.apache.james.imap.api.message.response.ImapResponseMessage;
 import org.apache.james.imap.api.message.response.StatusResponseFactory;
@@ -112,6 +113,7 @@ public class ListProcessor extends Abstr
                     } else {
                         referenceRoot = referenceName.substring(0, firstDelimiter);
                     }
+                    referenceRoot = CharsetUtil.decodeModifiedUTF7(referenceRoot);
                 } else {
                     // A relative reference name, return "" to indicate it is
                     // non-rooted
@@ -154,6 +156,8 @@ public class ListProcessor extends Abstr
                 // Is the interpreted (combined) pattern relative?
                 isRelative = ((finalReferencename + mailboxName).charAt(0) != MailboxConstants.NAMESPACE_PREFIX_CHAR);
 
+                finalReferencename = CharsetUtil.decodeModifiedUTF7(finalReferencename);
+
                 MailboxPath basePath = null;
                 if (isRelative) {
                     basePath = new MailboxPath(MailboxConstants.USER_NAMESPACE, user, finalReferencename);
@@ -161,7 +165,7 @@ public class ListProcessor extends Abstr
                     basePath = buildFullPath(session, finalReferencename);
                 }
 
-                results = getMailboxManager().search(new MailboxQuery(basePath, mailboxName,
mailboxSession.getPathDelimiter()), mailboxSession);
+                results = getMailboxManager().search(new MailboxQuery(basePath, CharsetUtil.decodeModifiedUTF7(mailboxName),
mailboxSession.getPathDelimiter()), mailboxSession);
             }
 
             for (final MailboxMetaData metaData : results) {



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message