aboutsummaryrefslogtreecommitdiffstats
path: root/imap-send.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-09-18 10:07:00 -0700
committerJunio C Hamano <gitster@pobox.com>2025-09-18 10:07:00 -0700
commit1c385d1bf8a5ec4e1b5d165a594f37a4bbdc3bdd (patch)
treea74d92e4e1e92ab419472a1b99154e89c2124b42 /imap-send.c
parent1fbfabfa71fc596383d221c7760e91c39f68c076 (diff)
parentf33b2207da792b45354e9af8948745a169f75651 (diff)
downloadgit-1c385d1bf8a5ec4e1b5d165a594f37a4bbdc3bdd.tar.gz
Merge branch 'ag/send-email-imap-sent'
"git send-email" learned to drive "git imap-send" to store already sent e-mails in an IMAP folder. * ag/send-email-imap-sent: send-email: enable copying emails to an IMAP folder without actually sending them send-email: add ability to send a copy of sent emails to an IMAP folder
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 254ec83ab7..4bd5b8aa0d 100644
--- a/imap-send.c
+++ b/imap-send.c
@@ -1442,14 +1442,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)