git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] imap-send: improve error messages for missing configuration

From
Jörg Thalheim <joerg@thalheim.io>
Date
Jun 19, 2025, 08:53 UTC
Message-ID
<8af387d5007b15cce49c924104d0e88522812e42@thalheim.io>

The error message 'no imap store specified' was confusing because it referred to 'store' when the actual missing configuration was 'imap.folder'. Similarly, the host error message provided no guidance on how to fix the issue.

Improve both error messages to:
- Clearly state what configuration is missing
- Provide hints showing the exact git config commands needed
- Include examples of typical values

This helps users quickly understand and resolve configuration issues when using git imap-send.

Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
---
 imap-send.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/imap-send.c b/imap-send.c
index 2e812f5a6e..a2d6f6d3f6 100644
--- a/imap-send.c
+++ b/imap-send.c
@@ -1539,13 +1539,17 @@ int cmd_main(int argc, const char **argv)
 		server.port = server.use_ssl ? 993 : 143;
 
 	if (!server.folder) {
-		fprintf(stderr, "no imap store specified\n");
+		fprintf(stderr, "error: no imap folder specified\n");
+		fprintf(stderr, "hint: set the target folder with 'git config imap.folder <folder>'\n");
+		fprintf(stderr, "      (e.g., 'git config imap.folder Drafts')\n");
 		ret = 1;
 		goto out;
 	}
 	if (!server.host) {
 		if (!server.tunnel) {
-			fprintf(stderr, "no imap host specified\n");
+			fprintf(stderr, "error: no imap host specified\n");
+			fprintf(stderr, "hint: set the imap host with 'git config imap.host <host>'\n");
+			fprintf(stderr, "      (e.g., 'git config imap.host imaps://imap.example.com')\n");
 			ret = 1;
 			goto out;
 		}
-- 
2.49.0
Next: Junio C Hamano
Message 1 of 11 in “imap-send: improve error messages for missing configuration”
  1. imap-send: improve error messages for missing configurationJörg Thalheim, Jun 19, 2025
  2. Junio C HamanoJun 20, 2025
  3. Aditya GargJun 20, 2025
  4. Aditya GargJun 20, 2025
  5. 0/2 imap-send: improve error messages for missing configurationJoerg Thalheim, Jun 20, 2025
  6. 1/2 imap-send: fix confusing 'store' terminology in error messageJoerg Thalheim, Jun 20, 2025
  7. 2/2 imap-send: improve error messages with configuration hintsJoerg Thalheim, Jun 20, 2025
  8. Junio C HamanoJun 20, 2025
  9. 0/2 imap-send: improve error messages for missing configurationJoerg Thalheim, Jun 20, 2025
  10. 1/2 imap-send: fix confusing 'store' terminology in error messageJoerg Thalheim, Jun 20, 2025
  11. 2/2 imap-send: improve error messages with configuration hintsJoerg Thalheim, Jun 20, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.