dovecot-2.1: imapc: Handle missing BODY[] reply by returning an ...

dovecot at dovecot.org dovecot at dovecot.org
Wed Dec 14 11:58:11 EET 2011


details:   http://hg.dovecot.org/dovecot-2.1/rev/69f388aa7ce9
changeset: 13857:69f388aa7ce9
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Dec 14 11:57:20 2011 +0200
description:
imapc: Handle missing BODY[] reply by returning an empty mail instead of disconnecting.

diffstat:

 src/lib-storage/index/imapc/imapc-mail.c |  10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diffs (20 lines):

diff -r e7ec5649655a -r 69f388aa7ce9 src/lib-storage/index/imapc/imapc-mail.c
--- a/src/lib-storage/index/imapc/imapc-mail.c	Wed Dec 14 10:55:11 2011 +0200
+++ b/src/lib-storage/index/imapc/imapc-mail.c	Wed Dec 14 11:57:20 2011 +0200
@@ -157,7 +157,15 @@
 
 		if (data->stream == NULL) {
 			imapc_mail_failed(_mail, "BODY[]");
-			return -1;
+			/* this could be either a temporary server bug, or the
+			   server may permanently just not return anything for
+			   this mail. the latter happens at least with Exchange
+			   when trying to fetch calendar "mails", so we'll just
+			   return them as empty mails instead of disconnecting
+			   the client. */
+			mail->body_fetched = TRUE;
+			data->stream = i_stream_create_from_data(NULL, 0);
+			imapc_mail_init_stream(mail, TRUE);
 		}
 	}
 


More information about the dovecot-cvs mailing list