Index: src/test/org/apache/james/imapserver/client/FetchCommand.java
===================================================================
--- src/test/org/apache/james/imapserver/client/FetchCommand.java	(revision 466857)
+++ src/test/org/apache/james/imapserver/client/FetchCommand.java	(working copy)
@@ -30,6 +30,10 @@
     private boolean fetchRfc822Size;
     
     private FetchBody body;
+    
+    private boolean oneSwitchOnly = false;
+    
+    private boolean oneMessageOnly = false;
 
     public FetchCommand(MimeMessage[] msgs, long from, long to) {
         statusResponse = "OK FETCH completed.";
@@ -37,6 +41,18 @@
         this.from = from;
         this.to = to;
     }
+
+    public FetchCommand(MimeMessage[] msgs, long from) {
+        statusResponse = "OK FETCH completed.";
+        this.msgs = msgs;
+        this.from = from;
+        this.to = from;
+        this.oneMessageOnly = true;
+    }
+
+    public void setOneSwitchOnly(boolean oneSwitchOnly) {
+		this.oneSwitchOnly = oneSwitchOnly;
+	}
     
     public void setUids(long[] uids) {
         this.uids=uids;
@@ -48,33 +64,45 @@
         if (uid) {
             command += "UID ";
         }
-        command += "fetch " + from + ":";
-        if (to > 0) {
-            command += to;
+        command += "fetch " + from ;
+        if (!oneMessageOnly) {
+	        if (to > 0) {
+	            command += ":"+to;
+	        } else {
+	            command += ":*";
+	        }
+        }
+        if (oneSwitchOnly) {
+        	if (fetchFlags) {
+        		command += " FLAGS\n";
+        	} else if (fetchRfc822Size) {
+        		command += " RFC822.SIZE\n";
+        	} else if (body!=null) {
+        		command += " "+body.getCommand()+'\n';
+        	}
         } else {
-            command += "*";
+	        command += " (";
+	        String items="";
+	        // FLAGS
+	        if (fetchFlags) {
+	            items += " FLAGS";  
+	        }
+	        // RFC822.SIZE
+	        if (fetchRfc822Size) {
+	            items += " RFC822.SIZE";
+	        }
+	        // BODY
+	        if (body!=null) {
+	            items += " "+body.getCommand();
+	        }
+	        
+	        
+	        if (items.length()>0) {
+	            items=items.substring(1);
+	        }
+	
+	        command += items+")\n";
         }
-        command += " (";
-        String items="";
-        // FLAGS
-        if (fetchFlags) {
-            items += " FLAGS";  
-        }
-        // RFC822.SIZE
-        if (fetchRfc822Size) {
-            items += " RFC822.SIZE";
-        }
-        // BODY
-        if (body!=null) {
-            items += " "+body.getCommand();
-        }
-        
-        
-        if (items.length()>0) {
-            items=items.substring(1);
-        }
-
-        command += items+")\n";
         return command;
     }
 
Index: src/test/org/apache/james/imapserver/handler/session/BodyFetchSessionTest.java
===================================================================
--- src/test/org/apache/james/imapserver/handler/session/BodyFetchSessionTest.java	(revision 466857)
+++ src/test/org/apache/james/imapserver/handler/session/BodyFetchSessionTest.java	(working copy)
@@ -117,4 +117,15 @@
         verifyCommandOrdered(fc);
     }        
 
+    public void testSimpleFetch() throws ProtocolException, IOException, MessagingException, MailboxManagerException {
+        verifyCommand(new LoginCommand(USER_NAME,USER_PASSWORD));
+        verifyCommand(new SelectCommand("INBOX", msgs, getUidValidity(USER_MAILBOX_ROOT+".INBOX")));
+        msgs=getMessages(USER_MAILBOX_ROOT+".INBOX");
+        
+        FetchCommand fc=new FetchCommand(msgs,1);
+        fc.setFetchBody(new FetchBody(true));
+        fc.setOneSwitchOnly(true);
+        verifyCommandOrdered(fc);
+    	
+    }
 }
