Index: evolution-data-server-3.12.1/camel/providers/imapx/camel-imapx-input-stream.c
===================================================================
--- evolution-data-server-3.12.1.orig/camel/providers/imapx/camel-imapx-input-stream.c	2014-05-01 10:19:08.026783777 +0100
+++ evolution-data-server-3.12.1/camel/providers/imapx/camel-imapx-input-stream.c	2014-05-01 11:59:40.013129381 +0100
@@ -540,6 +540,9 @@
 
 		case IMAPX_TOK_STRING:
 			*out_bytes = g_bytes_new (token, len);
+			if (*out_bytes == NULL || len == 0)
+ 				g_warning("IMAPX_TOK_STRING: len %d *out_bytes %p", len, *out_bytes);
+			//g_warn_if_fail(*out_bytes);
 			return TRUE;
 
 		case IMAPX_TOK_LITERAL:
Index: evolution-data-server-3.12.1/camel/providers/imapx/camel-imapx-server.c
===================================================================
--- evolution-data-server-3.12.1.orig/camel/providers/imapx/camel-imapx-server.c	2014-05-01 10:19:08.026783777 +0100
+++ evolution-data-server-3.12.1/camel/providers/imapx/camel-imapx-server.c	2014-05-01 12:48:55.589446687 +0100
@@ -2403,11 +2403,21 @@
 			output_stream =
 				g_io_stream_get_output_stream (data->stream);
 
-			body_data = g_bytes_get_data (finfo->body, &body_size);
+			if (finfo->body == NULL)
+				g_warning("body is NULL");
+			if (finfo->body && g_bytes_get_size(finfo->body) == 0) {
+				g_warning("body %p size is %d", finfo->body, g_bytes_get_size(finfo->body));
+			}
 
-			success = g_output_stream_write_all (
-				output_stream, body_data, body_size,
-				NULL, cancellable, error);
+			body_data = g_bytes_get_data (finfo->body, &body_size);
+			if (!body_size) {
+				g_warning("body size is %d, data is %p", body_size, body_data);
+				success = TRUE;
+			} else {
+				success = g_output_stream_write_all (
+					output_stream, body_data, body_size,
+					NULL, cancellable, error);
+			}
 
 			if (!success) {
 				g_prefix_error (
