Skip to content

Commit 5ec81b3

Browse files
AdityaGarg8gitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent bf22c37 commit 5ec81b3

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

imap-send.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ static int ssl_socket_connect(struct imap_socket *sock UNUSED,
211211
const struct imap_server_conf *cfg UNUSED,
212212
int use_tls_only UNUSED)
213213
{
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");
215215
return -1;
216216
}
217217

@@ -1019,7 +1019,7 @@ static int auth_cram_md5(struct imap_store *ctx, const char *prompt)
10191019
ret = socket_write(&ctx->imap->buf.sock, response, strlen(response));
10201020
if (ret != strlen(response)) {
10211021
free(response);
1022-
return error("IMAP error: sending response failed");
1022+
return error("IMAP error: sending CRAM-MD5 response failed");
10231023
}
10241024

10251025
free(response);
@@ -1159,7 +1159,7 @@ static struct imap_store *imap_open_store(struct imap_server_conf *srvc, const c
11591159
imap->buf.sock.fd[0] = tunnel.out;
11601160
imap->buf.sock.fd[1] = tunnel.in;
11611161

1162-
imap_info("ok\n");
1162+
imap_info("OK\n");
11631163
} else {
11641164
#ifndef NO_IPV6
11651165
struct addrinfo hints, *ai0, *ai;
@@ -1178,7 +1178,7 @@ static struct imap_store *imap_open_store(struct imap_server_conf *srvc, const c
11781178
fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(gai));
11791179
goto bail;
11801180
}
1181-
imap_info("ok\n");
1181+
imap_info("OK\n");
11821182

11831183
for (ai0 = ai; ai; ai = ai->ai_next) {
11841184
char addr[NI_MAXHOST];
@@ -1216,7 +1216,7 @@ static struct imap_store *imap_open_store(struct imap_server_conf *srvc, const c
12161216
perror("gethostbyname");
12171217
goto bail;
12181218
}
1219-
imap_info("ok\n");
1219+
imap_info("OK\n");
12201220

12211221
addr.sin_addr.s_addr = *((int *) he->h_addr_list[0]);
12221222

@@ -1230,7 +1230,7 @@ static struct imap_store *imap_open_store(struct imap_server_conf *srvc, const c
12301230
}
12311231
#endif
12321232
if (s < 0) {
1233-
fputs("Error: unable to connect to server.\n", stderr);
1233+
fputs("error: unable to connect to server\n", stderr);
12341234
goto bail;
12351235
}
12361236

@@ -1242,7 +1242,7 @@ static struct imap_store *imap_open_store(struct imap_server_conf *srvc, const c
12421242
close(s);
12431243
goto bail;
12441244
}
1245-
imap_info("ok\n");
1245+
imap_info("OK\n");
12461246
}
12471247

12481248
/* read the greeting string */
@@ -1295,12 +1295,12 @@ static struct imap_store *imap_open_store(struct imap_server_conf *srvc, const c
12951295
if (try_auth_method(srvc, ctx, imap, "XOAUTH2", AUTH_XOAUTH2, auth_xoauth2))
12961296
goto bail;
12971297
} else {
1298-
fprintf(stderr, "Unknown authentication method:%s\n", srvc->host);
1298+
fprintf(stderr, "unknown authentication mechanism: %s\n", srvc->auth_method);
12991299
goto bail;
13001300
}
13011301
} else {
13021302
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",
13041304
srvc->user, srvc->host);
13051305
goto bail;
13061306
}
@@ -1804,7 +1804,7 @@ int cmd_main(int argc, const char **argv)
18041804

18051805
if (!server.host) {
18061806
if (!server.tunnel) {
1807-
fprintf(stderr, "no imap host specified\n");
1807+
fprintf(stderr, "no IMAP host specified\n");
18081808
ret = 1;
18091809
goto out;
18101810
}
@@ -1824,7 +1824,7 @@ int cmd_main(int argc, const char **argv)
18241824
}
18251825

18261826
if (!server.folder) {
1827-
fprintf(stderr, "no imap store specified\n");
1827+
fprintf(stderr, "no IMAP store specified\n");
18281828
ret = 1;
18291829
goto out;
18301830
}
@@ -1844,7 +1844,7 @@ int cmd_main(int argc, const char **argv)
18441844

18451845
total = count_messages(&all_msgs);
18461846
if (!total) {
1847-
fprintf(stderr, "no messages to send\n");
1847+
fprintf(stderr, "no messages found to send\n");
18481848
ret = 1;
18491849
goto out;
18501850
}

0 commit comments

Comments
 (0)