imap-send: suppress warning about cleartext password with CRAM-MD5

If a CRAM-MD5 challenge-response is used to authenticate to the IMAP server,
git imap-send shouldn't warn about the password being sent in the clear.

Signed-off-by: Chris Webb <chris@arachsys.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Chris Webb 2010-03-27 15:00:19 +00:00 committed by Junio C Hamano
parent 5e4f614742
commit 10439d89eb

View File

@ -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); fprintf(stderr, "Skipping account %s@%s, server forbids LOGIN\n", srvc->user, srvc->host);
goto bail; goto bail;
} }
if (!imap->buf.sock.ssl)
imap_warn("*** IMAP Warning *** Password is being "
"sent in the clear\n");
if (srvc->auth_method) { if (srvc->auth_method) {
struct imap_cmd_cb cb; struct imap_cmd_cb cb;
@ -1253,6 +1250,9 @@ static struct store *imap_open_store(struct imap_server_conf *srvc)
goto bail; goto bail;
} }
} else { } 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) { if (imap_exec(ctx, NULL, "LOGIN \"%s\" \"%s\"", srvc->user, srvc->pass) != RESP_OK) {
fprintf(stderr, "IMAP error: LOGIN failed\n"); fprintf(stderr, "IMAP error: LOGIN failed\n");
goto bail; goto bail;