X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=imap-send.c;h=9d0097ca02960460ff3a104f1739982fee453987;hb=685359cf2d1996aed2f1b1e2857528819d27105d;hp=fa703838cf3374a52f8a1b6fecf455fb0ca4fef9;hpb=2bb76e139e3ab503992d227103f2bbb806b1f04b;p=git.git diff --git a/imap-send.c b/imap-send.c index fa703838c..9d0097ca0 100644 --- a/imap-send.c +++ b/imap-send.c @@ -1207,7 +1207,7 @@ static struct store *imap_open_store(struct imap_server_conf *srvc) if (!srvc->pass) { char prompt[80]; sprintf(prompt, "Password (%s@%s): ", srvc->user, srvc->host); - arg = getpass(prompt); + arg = git_getpass(prompt); if (!arg) { perror("getpass"); exit(1); @@ -1226,9 +1226,6 @@ static struct store *imap_open_store(struct imap_server_conf *srvc) fprintf(stderr, "Skipping account %s@%s, server forbids LOGIN\n", srvc->user, srvc->host); goto bail; } - if (!imap->buf.sock.ssl) - imap_warn("*** IMAP Warning *** Password is being " - "sent in the clear\n"); if (srvc->auth_method) { struct imap_cmd_cb cb; @@ -1253,6 +1250,9 @@ static struct store *imap_open_store(struct imap_server_conf *srvc) goto bail; } } else { + if (!imap->buf.sock.ssl) + imap_warn("*** IMAP Warning *** Password is being " + "sent in the clear\n"); if (imap_exec(ctx, NULL, "LOGIN \"%s\" \"%s\"", srvc->user, srvc->pass) != RESP_OK) { fprintf(stderr, "IMAP error: LOGIN failed\n"); goto bail; @@ -1431,8 +1431,14 @@ static int count_messages(struct msg_data *msg) 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)