dovecot-2.2: pop3: Code cleanup: INBOX always exists, no need to...

dovecot at dovecot.org dovecot at dovecot.org
Sat Feb 16 17:33:34 EET 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/928deb8a0b8c
changeset: 15784:928deb8a0b8c
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Feb 16 17:33:27 2013 +0200
description:
pop3: Code cleanup: INBOX always exists, no need to check for it here.

diffstat:

 src/pop3/pop3-client.c |  12 +++---------
 1 files changed, 3 insertions(+), 9 deletions(-)

diffs (35 lines):

diff -r 502a50925641 -r 928deb8a0b8c src/pop3/pop3-client.c
--- a/src/pop3/pop3-client.c	Sat Feb 16 17:17:14 2013 +0200
+++ b/src/pop3/pop3-client.c	Sat Feb 16 17:33:27 2013 +0200
@@ -278,7 +278,6 @@
 			     struct mail_storage_service_user *service_user,
 			     const struct pop3_settings *set)
 {
-	struct mail_namespace *ns;
 	struct mail_storage *storage;
 	const char *ident;
 	struct client *client;
@@ -320,20 +319,15 @@
 	pop3_client_count++;
 	DLLIST_PREPEND(&pop3_clients, client);
 
-	ns = mail_namespace_find_inbox(user->namespaces);
-	if (ns == NULL) {
-		client_send_line(client, "-ERR [IN-USE] No INBOX namespace for user.");
-		client_destroy(client, "No INBOX namespace for user.");
-		return NULL;
-	}
-	client->inbox_ns = ns;
+	client->inbox_ns = mail_namespace_find_inbox(user->namespaces);
+	i_assert(client->inbox_ns != NULL);
 
 	flags = MAILBOX_FLAG_POP3_SESSION;
 	if (!set->pop3_no_flag_updates)
 		flags |= MAILBOX_FLAG_DROP_RECENT;
 	if (set->pop3_lock_session)
 		flags |= MAILBOX_FLAG_KEEP_LOCKED;
-	client->mailbox = mailbox_alloc(ns->list, "INBOX", flags);
+	client->mailbox = mailbox_alloc(client->inbox_ns->list, "INBOX", flags);
 	storage = mailbox_get_storage(client->mailbox);
 	if (mailbox_open(client->mailbox) < 0) {
 		errmsg = t_strdup_printf("Couldn't open INBOX: %s",


More information about the dovecot-cvs mailing list