diff --git protocols-imap4/src/main/java/org/apache/james/imapserver/netty/IMAPServer.java protocols-imap4/src/main/java/org/apache/james/imapserver/netty/IMAPServer.java
index 5be3f07..8653439 100644
--- protocols-imap4/src/main/java/org/apache/james/imapserver/netty/IMAPServer.java
+++ protocols-imap4/src/main/java/org/apache/james/imapserver/netty/IMAPServer.java
@@ -40,7 +40,6 @@ import org.jboss.netty.channel.ChannelPipeline;
 import org.jboss.netty.channel.ChannelPipelineFactory;
 import org.jboss.netty.channel.ChannelUpstreamHandler;
 import org.jboss.netty.channel.group.ChannelGroup;
-import org.jboss.netty.handler.codec.frame.DelimiterBasedFrameDecoder;
 import org.jboss.netty.handler.codec.frame.Delimiters;
 import org.jboss.netty.handler.codec.oneone.OneToOneEncoder;
 import org.jboss.netty.handler.execution.ExecutionHandler;
@@ -155,7 +154,7 @@ public class IMAPServer extends AbstractConfigurableAsyncServer implements ImapC
 
                 // Add the text line decoder which limit the max line length,
                 // don't strip the delimiter and use CRLF as delimiter
-                pipeline.addLast(FRAMER, new DelimiterBasedFrameDecoder(maxLineLength, false, Delimiters.lineDelimiter()));
+                pipeline.addLast(FRAMER, new SwitchableDelimiterBasedFrameDecoder(maxLineLength, false, Delimiters.lineDelimiter()));
                
                 Encryption secure = getEncryption();
                 if (secure != null && !secure.isStartTLS()) {
diff --git protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java
index 8e15b23..83ed6ab 100644
--- protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java
+++ protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java
@@ -37,8 +37,8 @@ import org.jboss.netty.buffer.ChannelBuffer;
 import org.jboss.netty.buffer.ChannelBuffers;
 import org.jboss.netty.channel.Channel;
 import org.jboss.netty.channel.ChannelFutureListener;
-import org.jboss.netty.channel.ChannelHandler;
 import org.jboss.netty.channel.ChannelHandlerContext;
+import org.jboss.netty.channel.ChannelPipeline;
 import org.jboss.netty.channel.ChannelStateEvent;
 import org.jboss.netty.handler.codec.frame.FrameDecoder;
 
@@ -174,10 +174,8 @@ public class ImapRequestFrameDecoder extends FrameDecoder implements NettyConsta
                     reader.consumeLine();
                 }
                 
-                ChannelHandler handler = (ChannelHandler) attachment.remove(FRAMER);
-                if (handler != null) {
-                    channel.getPipeline().addFirst(FRAMER, handler);
-                }
+                ((SwitchableDelimiterBasedFrameDecoder) channel.getPipeline().get(FRAMER)).enableFraming();
+
                 attachment.clear();
                 return message;
             } catch (NettyImapRequestLineReader.NotEnoughDataException e) {
@@ -187,9 +185,11 @@ public class ImapRequestFrameDecoder extends FrameDecoder implements NettyConsta
                 // store the needed data size for later usage
                 attachment.put(NEEDED_DATA, neededData);
                 
+                final ChannelPipeline pipeline = channel.getPipeline();
+                final ChannelHandlerContext framerContext = pipeline.getContext(FRAMER);
 
-                ChannelHandler handler = channel.getPipeline().remove(FRAMER);
-                attachment.put(FRAMER, handler);
+                final SwitchableDelimiterBasedFrameDecoder framer = (SwitchableDelimiterBasedFrameDecoder) pipeline.get(FRAMER);
+                framer.disableFraming(framerContext);
                 
                 buffer.resetReaderIndex();
                 return null;
diff --git protocols-imap4/src/main/java/org/apache/james/imapserver/netty/SwitchableDelimiterBasedFrameDecoder.java protocols-imap4/src/main/java/org/apache/james/imapserver/netty/SwitchableDelimiterBasedFrameDecoder.java
new file mode 100644
index 0000000..7ac9002
--- /dev/null
+++ protocols-imap4/src/main/java/org/apache/james/imapserver/netty/SwitchableDelimiterBasedFrameDecoder.java
@@ -0,0 +1,64 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.imapserver.netty;
+
+import org.jboss.netty.buffer.ChannelBuffer;
+import org.jboss.netty.channel.ChannelHandlerContext;
+import org.jboss.netty.channel.Channels;
+import org.jboss.netty.channel.MessageEvent;
+import org.jboss.netty.handler.codec.frame.DelimiterBasedFrameDecoder;
+
+public class SwitchableDelimiterBasedFrameDecoder extends DelimiterBasedFrameDecoder {
+
+	private volatile boolean framingEnabled = true;
+	private volatile ChannelBuffer cumulation;
+
+	public SwitchableDelimiterBasedFrameDecoder(final int maxFrameLength, final boolean stripDelimiter, final ChannelBuffer... delimiters) {
+		super(maxFrameLength, stripDelimiter, delimiters);
+	}
+
+	@Override
+	public synchronized void messageReceived(final ChannelHandlerContext ctx, final MessageEvent e) throws Exception {
+		if(this.framingEnabled) {
+			super.messageReceived(ctx, e);
+		} else {
+			ctx.sendUpstream(e);
+		}
+	}
+
+	public synchronized void enableFraming() {
+		this.framingEnabled = true;
+
+	}
+
+	public synchronized void disableFraming(final ChannelHandlerContext ctx) {
+		this.framingEnabled = false;
+		if(this.cumulation != null && this.cumulation.readable()) {
+			final ChannelBuffer spareBytes = this.cumulation.readBytes(this.cumulation.readableBytes());
+			Channels.fireMessageReceived(ctx, spareBytes);
+		}
+	}
+
+	@Override
+	protected synchronized ChannelBuffer createCumulationDynamicBuffer(final ChannelHandlerContext ctx) {
+		this.cumulation = super.createCumulationDynamicBuffer(ctx);
+		return this.cumulation;
+	}
+}
