Skip to content

Commit 9b5a7c4

Browse files
committed
Merge branch 'rr/imap-send-unconfuse-from-line'
* rr/imap-send-unconfuse-from-line: imap-send: Remove limitation on message body
2 parents aa4beff + 4916c8f commit 9b5a7c4

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

Documentation/git-imap-send.txt

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ DESCRIPTION
1616
This command uploads a mailbox generated with 'git format-patch'
1717
into an IMAP drafts folder. This allows patches to be sent as
1818
other email is when using mail clients that cannot read mailbox
19-
files directly.
19+
files directly. The command also works with any general mailbox
20+
in which emails have the fields "From", "Date", and "Subject" in
21+
that order.
2022

2123
Typical usage is something like:
2224

@@ -122,12 +124,6 @@ Thunderbird in particular is known to be problematic. Thunderbird
122124
users may wish to visit this web page for more information:
123125
http://kb.mozillazine.org/Plain_text_e-mail_-_Thunderbird#Completely_plain_email
124126

125-
126-
BUGS
127-
----
128-
Doesn't handle lines starting with "From " in the message body.
129-
130-
131127
Author
132128
------
133129
Derived from isync 1.0.1 by Mike McCormack.

imap-send.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1431,8 +1431,14 @@ static int count_messages(struct msg_data *msg)
14311431

14321432
while (1) {
14331433
if (!prefixcmp(p, "From ")) {
1434+
p = strstr(p+5, "\nFrom: ");
1435+
if (!p) break;
1436+
p = strstr(p+7, "\nDate: ");
1437+
if (!p) break;
1438+
p = strstr(p+7, "\nSubject: ");
1439+
if (!p) break;
1440+
p += 10;
14341441
count++;
1435-
p += 5;
14361442
}
14371443
p = strstr(p+5, "\nFrom ");
14381444
if (!p)

0 commit comments

Comments
 (0)