From: Junio C Hamano Date: Sat, 3 Apr 2010 19:28:42 +0000 (-0700) Subject: Merge branch 'rr/imap-send-unconfuse-from-line' X-Git-Tag: v1.7.1-rc0~11 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9b5a7c447b72d10442858193b5aae03a19fb1720;hp=aa4beff4b5403a6d031d6be3d86f9ba27534dd53;p=git.git Merge branch 'rr/imap-send-unconfuse-from-line' * rr/imap-send-unconfuse-from-line: imap-send: Remove limitation on message body --- diff --git a/Documentation/git-imap-send.txt b/Documentation/git-imap-send.txt index 6cafbe2ec..57aba42e6 100644 --- a/Documentation/git-imap-send.txt +++ b/Documentation/git-imap-send.txt @@ -16,7 +16,9 @@ DESCRIPTION This command uploads a mailbox generated with 'git format-patch' into an IMAP drafts folder. This allows patches to be sent as other email is when using mail clients that cannot read mailbox -files directly. +files directly. The command also works with any general mailbox +in which emails have the fields "From", "Date", and "Subject" in +that order. Typical usage is something like: @@ -122,12 +124,6 @@ Thunderbird in particular is known to be problematic. Thunderbird users may wish to visit this web page for more information: http://kb.mozillazine.org/Plain_text_e-mail_-_Thunderbird#Completely_plain_email - -BUGS ----- -Doesn't handle lines starting with "From " in the message body. - - Author ------ Derived from isync 1.0.1 by Mike McCormack. diff --git a/imap-send.c b/imap-send.c index 7107923a3..9d0097ca0 100644 --- a/imap-send.c +++ b/imap-send.c @@ -1431,8 +1431,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)