[dovecot-cvs] dovecot/src/pop3 client.c,1.72,1.73

tss at dovecot.org tss at dovecot.org
Thu Feb 22 13:30:59 UTC 2007


Update of /var/lib/cvs/dovecot/src/pop3
In directory talvi:/tmp/cvs-serv12770

Modified Files:
	client.c 
Log Message:
If INBOX can't be opened, give better error messages. The reason is never
"INBOX doesn't exist for user".



Index: client.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/pop3/client.c,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -d -r1.72 -r1.73
--- client.c	5 Feb 2007 11:42:50 -0000	1.72
+++ client.c	22 Feb 2007 13:30:56 -0000	1.73
@@ -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;
 	}
 



More information about the dovecot-cvs mailing list