diff src/pop3/client.c @ 5178:bbe25ef34f03 HEAD

If INBOX can't be opened, give better error messages. The reason is never "INBOX doesn't exist for user".
author Timo Sirainen <tss@iki.fi>
date Thu, 22 Feb 2007 15:30:56 +0200
parents f8c2cf9e3267
children 4862cb37106c
line wrap: on
line diff
--- a/src/pop3/client.c	Thu Feb 22 15:08:31 2007 +0200
+++ b/src/pop3/client.c	Thu Feb 22 15:30:56 2007 +0200
@@ -128,6 +128,7 @@
 {
 	struct client *client;
         enum mailbox_open_flags flags;
+	const char *errmsg;
 	bool syntax_error, temporary_error;
 
 	/* always use nonblocking I/O */
@@ -156,11 +157,13 @@
 		flags |= MAILBOX_OPEN_KEEP_LOCKED;
 	client->mailbox = mailbox_open(storage, "INBOX", NULL, flags);
 	if (client->mailbox == NULL) {
-		i_error("Couldn't open INBOX: %s",
-			mail_storage_get_last_error(storage, &syntax_error,
-						    &temporary_error));
-		client_send_line(client, "-ERR No INBOX for user.");
-		client_destroy(client, "No INBOX for user");
+		errmsg = t_strdup_printf("Couldn't open INBOX: %s",
+				mail_storage_get_last_error(storage,
+							    &syntax_error,
+							    &temporary_error));
+		i_error("%s", errmsg);
+		client_send_line(client, "-ERR [IN-USE] %s", errmsg);
+		client_destroy(client, "Couldn't open INBOX");
 		return NULL;
 	}