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 <gargaditya08@live.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Aditya Garg committed Jun 20, 2025 at 12:10 UTC 5ec81b33b04124c6f52e165e898e99902c5f68af
1 file changed +12 -12
imap-send.c
+12 -12
@@ -211,7 +211,7 @@ static int ssl_socket_connect(struct imap_socket *sock UNUSED,
211 const struct imap_server_conf *cfg UNUSED,
212 int use_tls_only UNUSED)
213 {
214 - fprintf(stderr, "SSL requested but SSL support not compiled in\n");
214 + fprintf(stderr, "SSL requested, but SSL support is not compiled in\n");
215 return -1;
216 }
217
@@ -1019,7 +1019,7 @@ static int auth_cram_md5(struct imap_store *ctx, const char *prompt)
1019 ret = socket_write(&ctx->imap->buf.sock, response, strlen(response));
1020 if (ret != strlen(response)) {
1021 free(response);
1022 - return error("IMAP error: sending response failed");
1022 + return error("IMAP error: sending CRAM-MD5 response failed");
1023 }
1024
1025 free(response);
@@ -1159,7 +1159,7 @@ static struct imap_store *imap_open_store(struct imap_server_conf *srvc, const c
1159 imap->buf.sock.fd[0] = tunnel.out;
1160 imap->buf.sock.fd[1] = tunnel.in;
1161
1162 - imap_info("ok\n");
1162 + imap_info("OK\n");
1163 } else {
1164 #ifndef NO_IPV6
1165 struct addrinfo hints, *ai0, *ai;
@@ -1178,7 +1178,7 @@ static struct imap_store *imap_open_store(struct imap_server_conf *srvc, const c
1178 fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(gai));
1179 goto bail;
1180 }
1181 - imap_info("ok\n");
1181 + imap_info("OK\n");
1182
1183 for (ai0 = ai; ai; ai = ai->ai_next) {
1184 char addr[NI_MAXHOST];
@@ -1216,7 +1216,7 @@ static struct imap_store *imap_open_store(struct imap_server_conf *srvc, const c
1216 perror("gethostbyname");
1217 goto bail;
1218 }
1219 - imap_info("ok\n");
1219 + imap_info("OK\n");
1220
1221 addr.sin_addr.s_addr = *((int *) he->h_addr_list[0]);
1222
@@ -1230,7 +1230,7 @@ static struct imap_store *imap_open_store(struct imap_server_conf *srvc, const c
1230 }
1231 #endif
1232 if (s < 0) {
1233 - fputs("Error: unable to connect to server.\n", stderr);
1233 + fputs("error: unable to connect to server\n", stderr);
1234 goto bail;
1235 }
1236
@@ -1242,7 +1242,7 @@ static struct imap_store *imap_open_store(struct imap_server_conf *srvc, const c
1242 close(s);
1243 goto bail;
1244 }
1245 - imap_info("ok\n");
1245 + imap_info("OK\n");
1246 }
1247
1248 /* read the greeting string */
@@ -1295,12 +1295,12 @@ static struct imap_store *imap_open_store(struct imap_server_conf *srvc, const c
1295 if (try_auth_method(srvc, ctx, imap, "XOAUTH2", AUTH_XOAUTH2, auth_xoauth2))
1296 goto bail;
1297 } else {
1298 - fprintf(stderr, "Unknown authentication method:%s\n", srvc->host);
1298 + fprintf(stderr, "unknown authentication mechanism: %s\n", srvc->auth_method);
1299 goto bail;
1300 }
1301 } else {
1302 if (CAP(NOLOGIN)) {
1303 - fprintf(stderr, "Skipping account %s@%s, server forbids LOGIN\n",
1303 + fprintf(stderr, "skipping account %s@%s, server forbids LOGIN\n",
1304 srvc->user, srvc->host);
1305 goto bail;
1306 }
@@ -1804,7 +1804,7 @@ int cmd_main(int argc, const char **argv)
1804
1805 if (!server.host) {
1806 if (!server.tunnel) {
1807 - fprintf(stderr, "no imap host specified\n");
1807 + fprintf(stderr, "no IMAP host specified\n");
1808 ret = 1;
1809 goto out;
1810 }
@@ -1824,7 +1824,7 @@ int cmd_main(int argc, const char **argv)
1824 }
1825
1826 if (!server.folder) {
1827 - fprintf(stderr, "no imap store specified\n");
1827 + fprintf(stderr, "no IMAP store specified\n");
1828 ret = 1;
1829 goto out;
1830 }
@@ -1844,7 +1844,7 @@ int cmd_main(int argc, const char **argv)
1844
1845 total = count_messages(&all_msgs);
1846 if (!total) {
1847 - fprintf(stderr, "no messages to send\n");
1847 + fprintf(stderr, "no messages found to send\n");
1848 ret = 1;
1849 goto out;
1850 }