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>
This commit is contained in:
parent
0b3dcfe721
commit
4916c8f953
@ -16,7 +16,9 @@ DESCRIPTION
|
|||||||
This command uploads a mailbox generated with 'git format-patch'
|
This command uploads a mailbox generated with 'git format-patch'
|
||||||
into an IMAP drafts folder. This allows patches to be sent as
|
into an IMAP drafts folder. This allows patches to be sent as
|
||||||
other email is when using mail clients that cannot read mailbox
|
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:
|
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:
|
users may wish to visit this web page for more information:
|
||||||
http://kb.mozillazine.org/Plain_text_e-mail_-_Thunderbird#Completely_plain_email
|
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
|
Author
|
||||||
------
|
------
|
||||||
Derived from isync 1.0.1 by Mike McCormack.
|
Derived from isync 1.0.1 by Mike McCormack.
|
||||||
|
@ -1306,8 +1306,14 @@ static int count_messages(struct msg_data *msg)
|
|||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
if (!prefixcmp(p, "From ")) {
|
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++;
|
count++;
|
||||||
p += 5;
|
|
||||||
}
|
}
|
||||||
p = strstr(p+5, "\nFrom ");
|
p = strstr(p+5, "\nFrom ");
|
||||||
if (!p)
|
if (!p)
|
||||||
|
Loading…
Reference in New Issue
Block a user