aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-04-09 22:22:44 -0700
committerJunio C Hamano <gitster@pobox.com>2010-04-09 22:22:44 -0700
commit2e5a40f0b59af243f83a14bf1db4b7f833c6c49d (patch)
treee6174bd5fb194dbaec3994bb7660aaeb03e1f8e7
parent581b26c82dd3232b052d5228a1ba2ea3cc03dc28 (diff)
parent4916c8f9535866210df6ec837ab910f3b8348784 (diff)
downloadgit-2e5a40f0b59af243f83a14bf1db4b7f833c6c49d.tar.gz
git-2e5a40f0b59af243f83a14bf1db4b7f833c6c49d.tar.xz
Merge branch 'rr/imap-send-unconfuse-from-line' into maint
* rr/imap-send-unconfuse-from-line: imap-send: Remove limitation on message body
-rw-r--r--Documentation/git-imap-send.txt10
-rw-r--r--imap-send.c8
2 files changed, 10 insertions, 8 deletions
diff --git a/Documentation/git-imap-send.txt b/Documentation/git-imap-send.txt
index 57db955bd..ad446b0e8 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:
@@ -118,12 +120,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 5631930bc..379dec491 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)