author | Junio C Hamano <gitster@pobox.com> | |
Sat, 3 Apr 2010 19:28:42 +0000 (12:28 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 3 Apr 2010 19:28:42 +0000 (12:28 -0700) |
* rr/imap-send-unconfuse-from-line:
imap-send: Remove limitation on message body
imap-send: Remove limitation on message body
Documentation/git-imap-send.txt | patch | blob | history | |
imap-send.c | patch | blob | history |
index 6cafbe2ec191b2e2b35e7855c71837fa0f231785..57aba42e6654e3d32617c3c7b17d18e8dd85852b 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 7107923a39247b5c18ad443dc2309971e44abdb4..9d0097ca02960460ff3a104f1739982fee453987 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)