From 4916c8f9535866210df6ec837ab910f3b8348784 Mon Sep 17 00:00:00 2001 From: Ramkumar Ramachandra Date: Mon, 22 Mar 2010 23:37:52 +0530 Subject: imap-send: Remove limitation on message body There is a documented limitation on the body of any email not being able to contain lines starting with "From ". This patch removes that limitation by improving the parser to search for "From", "Date", and "Subject" fields in the email before considering it to be an email. Signed-off-by: Ramkumar Ramachandra Signed-off-by: Junio C Hamano --- imap-send.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'imap-send.c') diff --git a/imap-send.c b/imap-send.c index 5631930bc3..379dec491f 100644 --- a/imap-send.c +++ b/imap-send.c @@ -1306,8 +1306,14 @@ static int count_messages(struct msg_data *msg) while (1) { if (!prefixcmp(p, "From ")) { + p = strstr(p+5, "\nFrom: "); + if (!p) break; + p = strstr(p+7, "\nDate: "); + if (!p) break; + p = strstr(p+7, "\nSubject: "); + if (!p) break; + p += 10; count++; - p += 5; } p = strstr(p+5, "\nFrom "); if (!p) -- cgit v1.2.3