dovecot-2.0: lmtp: Fixes to handling "." correctly in DATA.

dovecot at dovecot.org dovecot at dovecot.org
Wed Jun 17 01:48:19 EEST 2009


details:   http://hg.dovecot.org/dovecot-2.0/rev/a04a3ce0764e
changeset: 9486:a04a3ce0764e
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Jun 16 18:48:14 2009 -0400
description:
lmtp: Fixes to handling "." correctly in DATA.

diffstat:

1 file changed, 6 insertions(+), 3 deletions(-)
src/lmtp/commands.c |    9 ++++++---

diffs (25 lines):

diff -r acbbd522be43 -r a04a3ce0764e src/lmtp/commands.c
--- a/src/lmtp/commands.c	Tue Jun 16 14:41:02 2009 -0400
+++ b/src/lmtp/commands.c	Tue Jun 16 18:48:14 2009 -0400
@@ -425,15 +425,18 @@ static void client_input_data_handle(str
 			}
 		} else if (client->state.data_end_idx == DATA_DOT_NEXT_POS) {
 			/* saw a dot at the beginning of line. drop it. */
-			if (client_input_add(client, data, i-1) < 0) {
+			if (client_input_add(client, data + start,
+					     i - start - 1) < 0) {
 				client_destroy(client, "451 4.3.0",
 					       "Temporary internal failure");
 				return;
 			}
 			start = i;
-			client->state.data_end_idx = 0;
+			client->state.data_end_idx =
+				data[i] == data_end[0] ? 1 : 0;
 		} else {
-			client->state.data_end_idx = 0;
+			client->state.data_end_idx =
+				data[i] == data_end[0] ? 1 : 0;
 		}
 	}
 	if (client->state.data_end_idx >= DATA_DOT_NEXT_POS) {


More information about the dovecot-cvs mailing list