summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0b3dcfe)
raw | patch | inline | side by side (parent: 0b3dcfe)
author | Ramkumar Ramachandra <artagnon@gmail.com> | |
Mon, 22 Mar 2010 18:07:52 +0000 (23:37 +0530) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 24 Mar 2010 18:00:25 +0000 (11:00 -0700) |
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>
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>
Documentation/git-imap-send.txt | patch | blob | history | |
imap-send.c | patch | blob | history |
index 57db955bd4cc82f643ed5b932b33d440d8cf409a..ad446b0e8b521d6fb8f779d943889b091b29e701 100644 (file)
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:
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 5631930bc3462c5d85d29e7e840f1cf24cd7111b..379dec491f63c24406644c40f94390a021519ddb 100644 (file)
--- a/imap-send.c
+++ b/imap-send.c
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)