james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r1134574 - in /james/imap/trunk: api/src/main/java/org/apache/james/imap/api/display/HumanReadableText.java message/src/main/java/org/apache/james/imap/decode/DecoderUtils.java
Date Sat, 11 Jun 2011 11:52:53 GMT
Author: norman
Date: Sat Jun 11 11:52:52 2011
New Revision: 1134574

URL: http://svn.apache.org/viewvc?rev=1134574&view=rev
Log:
Return tagged BAD if a client tries to set/unset the recent flag via the STORE command. See
IMAP-316

Modified:
    james/imap/trunk/api/src/main/java/org/apache/james/imap/api/display/HumanReadableText.java
    james/imap/trunk/message/src/main/java/org/apache/james/imap/decode/DecoderUtils.java

Modified: james/imap/trunk/api/src/main/java/org/apache/james/imap/api/display/HumanReadableText.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/api/src/main/java/org/apache/james/imap/api/display/HumanReadableText.java?rev=1134574&r1=1134573&r2=1134574&view=diff
==============================================================================
--- james/imap/trunk/api/src/main/java/org/apache/james/imap/api/display/HumanReadableText.java
(original)
+++ james/imap/trunk/api/src/main/java/org/apache/james/imap/api/display/HumanReadableText.java
Sat Jun 11 11:52:52 2011
@@ -61,6 +61,8 @@ public class HumanReadableText {
     public static final HumanReadableText INVALID_MESSAGESET = new HumanReadableText("org.apache.james.imap.INVALID_MESSAGESET",
"failed. Invalid messageset.");
 
     public static final HumanReadableText INVALID_COMMAND = new HumanReadableText("org.apache.james.imap.INVALID_COMMAND",
"failed. Command not valid in this state.");
+   
+    public static final HumanReadableText INVALID_SYSTEM_FLAG = new HumanReadableText("org.apache.james.imap.INVALID_SYSTEM_FLAG",
"Invalid system flag \\RECENT.");
 
     public static final HumanReadableText ILLEGAL_TAG = new HumanReadableText("org.apache.james.imap.ILLEGAL_TAG",
"Illegal tag.");
 

Modified: james/imap/trunk/message/src/main/java/org/apache/james/imap/decode/DecoderUtils.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/message/src/main/java/org/apache/james/imap/decode/DecoderUtils.java?rev=1134574&r1=1134573&r2=1134574&view=diff
==============================================================================
--- james/imap/trunk/message/src/main/java/org/apache/james/imap/decode/DecoderUtils.java
(original)
+++ james/imap/trunk/message/src/main/java/org/apache/james/imap/decode/DecoderUtils.java
Sat Jun 11 11:52:52 2011
@@ -63,7 +63,7 @@ public final class DecoderUtils {
 
     private static final int ALL_MONTH_BITS = JAN_BIT | FEB_BIT | MAR_BIT | APR_BIT | MAY_BIT
| JUN_BIT | JUL_BIT | AUG_BIT | SEP_BIT | OCT_BIT | NOV_BIT | DEC_BIT;
 
-    public static void setFlag(final String flagString, final Flags flags) {
+    public static void setFlag(final String flagString, final Flags flags) throws DecodingException{
         if (flagString.equalsIgnoreCase(MessageFlags.ANSWERED_ALL_CAPS)) {
             flags.add(Flags.Flag.ANSWERED);
         } else if (flagString.equalsIgnoreCase(MessageFlags.DELETED_ALL_CAPS)) {
@@ -78,8 +78,11 @@ public final class DecoderUtils {
             if (flagString.equalsIgnoreCase(MessageFlags.RECENT_ALL_CAPS)) { // NOPMD
                                                                              // keep
                                                                              // comment
-                // RFC3501 specifically excludes /Recent
-                // The /Recent flag should be set automatically by the server
+                // RFC3501 specifically excludes \Recent
+                // The \Recent flag should be set automatically by the server so throw Exception
+                //
+                // See IMAP-316
+                throw new DecodingException(HumanReadableText.INVALID_SYSTEM_FLAG, "\\Recent
flag is now allowed to set.");
             } else {
                 // RFC3501 allows novel flags
                 flags.add(flagString);



---------------------------------------------------------------------
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