From: Aditya Garg Date: Fri, 20 Jun 2025 06:40:33 +0000 (+0530) Subject: imap-send: fix minor mistakes in the logs X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5ec81b33b04124c6f52e165e898e99902c5f68af;p=thirdparty%2Fgit.git imap-send: fix minor mistakes in the logs Some minor mistakes have been found in the logs. Most of them include error messages starting with a capital letter, and ending with a period. Abbreviations like "IMAP" and "OK" should also be in uppercase. Another mistake was that the error message showing unknown authentication mechanism used was displaying the host rather than the mechanism in the logs. Fix them. Signed-off-by: Aditya Garg Signed-off-by: Junio C Hamano --- diff --git a/imap-send.c b/imap-send.c index 2a445edcda..8f4801dc07 100644 --- a/imap-send.c +++ b/imap-send.c @@ -211,7 +211,7 @@ static int ssl_socket_connect(struct imap_socket *sock UNUSED, const struct imap_server_conf *cfg UNUSED, int use_tls_only UNUSED) { - fprintf(stderr, "SSL requested but SSL support not compiled in\n"); + fprintf(stderr, "SSL requested, but SSL support is not compiled in\n"); return -1; } @@ -1019,7 +1019,7 @@ static int auth_cram_md5(struct imap_store *ctx, const char *prompt) ret = socket_write(&ctx->imap->buf.sock, response, strlen(response)); if (ret != strlen(response)) { free(response); - return error("IMAP error: sending response failed"); + return error("IMAP error: sending CRAM-MD5 response failed"); } free(response); @@ -1159,7 +1159,7 @@ static struct imap_store *imap_open_store(struct imap_server_conf *srvc, const c imap->buf.sock.fd[0] = tunnel.out; imap->buf.sock.fd[1] = tunnel.in; - imap_info("ok\n"); + imap_info("OK\n"); } else { #ifndef NO_IPV6 struct addrinfo hints, *ai0, *ai; @@ -1178,7 +1178,7 @@ static struct imap_store *imap_open_store(struct imap_server_conf *srvc, const c fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(gai)); goto bail; } - imap_info("ok\n"); + imap_info("OK\n"); for (ai0 = ai; ai; ai = ai->ai_next) { char addr[NI_MAXHOST]; @@ -1216,7 +1216,7 @@ static struct imap_store *imap_open_store(struct imap_server_conf *srvc, const c perror("gethostbyname"); goto bail; } - imap_info("ok\n"); + imap_info("OK\n"); addr.sin_addr.s_addr = *((int *) he->h_addr_list[0]); @@ -1230,7 +1230,7 @@ static struct imap_store *imap_open_store(struct imap_server_conf *srvc, const c } #endif if (s < 0) { - fputs("Error: unable to connect to server.\n", stderr); + fputs("error: unable to connect to server\n", stderr); goto bail; } @@ -1242,7 +1242,7 @@ static struct imap_store *imap_open_store(struct imap_server_conf *srvc, const c close(s); goto bail; } - imap_info("ok\n"); + imap_info("OK\n"); } /* read the greeting string */ @@ -1295,12 +1295,12 @@ static struct imap_store *imap_open_store(struct imap_server_conf *srvc, const c if (try_auth_method(srvc, ctx, imap, "XOAUTH2", AUTH_XOAUTH2, auth_xoauth2)) goto bail; } else { - fprintf(stderr, "Unknown authentication method:%s\n", srvc->host); + fprintf(stderr, "unknown authentication mechanism: %s\n", srvc->auth_method); goto bail; } } else { if (CAP(NOLOGIN)) { - fprintf(stderr, "Skipping account %s@%s, server forbids LOGIN\n", + fprintf(stderr, "skipping account %s@%s, server forbids LOGIN\n", srvc->user, srvc->host); goto bail; } @@ -1804,7 +1804,7 @@ int cmd_main(int argc, const char **argv) if (!server.host) { if (!server.tunnel) { - fprintf(stderr, "no imap host specified\n"); + fprintf(stderr, "no IMAP host specified\n"); ret = 1; goto out; } @@ -1824,7 +1824,7 @@ int cmd_main(int argc, const char **argv) } if (!server.folder) { - fprintf(stderr, "no imap store specified\n"); + fprintf(stderr, "no IMAP store specified\n"); ret = 1; goto out; } @@ -1844,7 +1844,7 @@ int cmd_main(int argc, const char **argv) total = count_messages(&all_msgs); if (!total) { - fprintf(stderr, "no messages to send\n"); + fprintf(stderr, "no messages found to send\n"); ret = 1; goto out; }