dovecot: If save failed for non-first namespace, we got a wrong ...

dovecot at dovecot.org dovecot at dovecot.org
Mon Jul 23 08:11:03 EEST 2007


details:   http://hg.dovecot.org/dovecot/rev/291135c986b3
changeset: 6140:291135c986b3
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Jul 23 08:10:59 2007 +0300
description:
If save failed for non-first namespace, we got a wrong error message.

diffstat:

1 file changed, 8 insertions(+), 1 deletion(-)
src/deliver/deliver.c |    9 ++++++++-

diffs (26 lines):

diff -r cd0f9be6f8ad -r 291135c986b3 src/deliver/deliver.c
--- a/src/deliver/deliver.c	Mon Jul 23 08:09:05 2007 +0300
+++ b/src/deliver/deliver.c	Mon Jul 23 08:10:59 2007 +0300
@@ -754,6 +754,7 @@ int main(int argc, char *argv[])
 	if (mail_set_seq(mail, 1) < 0)
 		i_fatal("mail_set_seq() failed");
 
+	storage = NULL;
 	default_mailbox_name = mailbox;
 	if (deliver_mail == NULL)
 		ret = -1;
@@ -786,7 +787,13 @@ int main(int argc, char *argv[])
 		enum mail_error error;
 		int ret;
 
-		error_string = mail_storage_get_last_error(ns->storage, &error);
+		if (storage == NULL) {
+			/* This shouldn't happen */
+			i_error("BUG: Saving failed for unknown storage");
+			return EX_TEMPFAIL;
+		}
+
+		error_string = mail_storage_get_last_error(storage, &error);
 		if (error != MAIL_ERROR_NOSPACE ||
 		    getenv("QUOTA_FULL_TEMPFAIL") != NULL) {
 			/* Saving to INBOX should always work unless


More information about the dovecot-cvs mailing list