summaryrefslogtreecommitdiff
path: root/imap-send.c
diff options
context:
space:
mode:
authorRamkumar Ramachandra <artagnon@gmail.com>2010-03-22 18:07:52 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-03-24 18:00:25 (GMT)
commit4916c8f9535866210df6ec837ab910f3b8348784 (patch)
tree76608834da311aed3d7d952d1556c0bd36f54173 /imap-send.c
parent0b3dcfe721dc8734e2688f936afad055d8541d97 (diff)
downloadgit-4916c8f9535866210df6ec837ab910f3b8348784.zip
git-4916c8f9535866210df6ec837ab910f3b8348784.tar.gz
git-4916c8f9535866210df6ec837ab910f3b8348784.tar.bz2
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 <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'imap-send.c')
-rw-r--r--imap-send.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/imap-send.c b/imap-send.c
index 5631930..379dec4 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)