summaryrefslogtreecommitdiff
path: root/imap-send.c
diff options
context:
space:
mode:
Diffstat (limited to 'imap-send.c')
-rw-r--r--imap-send.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/imap-send.c b/imap-send.c
index f5a656ac71..44de0c5a77 100644
--- a/imap-send.c
+++ b/imap-send.c
@@ -1441,14 +1441,24 @@ static int count_messages(struct strbuf *all_msgs)
while (1) {
if (starts_with(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++;
+ if (starts_with(p, "From git-send-email")) {
+ p = strstr(p+5, "\nFrom: ");
+ if (!p) break;
+ p += 7;
+ p = strstr(p, "\nTo: ");
+ if (!p) break;
+ p += 5;
+ count++;
+ } else {
+ 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 = strstr(p+5, "\nFrom ");
if (!p)