dovecot: Don't crash if trying to deliver mail to mailbox outsid...

dovecot at dovecot.org dovecot at dovecot.org
Wed Feb 20 20:37:47 EET 2008


details:   http://hg.dovecot.org/dovecot/rev/e041d85a6236
changeset: 7267:e041d85a6236
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Feb 20 20:39:03 2008 +0200
description:
Don't crash if trying to deliver mail to mailbox outside all namespaces.

diffstat:

1 file changed, 6 insertions(+)
src/deliver/deliver.c |    6 ++++++

diffs (16 lines):

diff -r ac5d76fc8eb2 -r e041d85a6236 src/deliver/deliver.c
--- a/src/deliver/deliver.c	Wed Feb 20 20:02:30 2008 +0200
+++ b/src/deliver/deliver.c	Wed Feb 20 20:39:03 2008 +0200
@@ -199,6 +199,12 @@ int deliver_save(struct mail_namespace *
 	mailbox_name = str_sanitize(mailbox, 80);
 	box = mailbox_open_or_create_synced(namespaces, storage_r, mailbox);
 	if (box == NULL) {
+		if (*storage_r == NULL) {
+			deliver_log(mail,
+				    "save failed to %s: Unknown namespace",
+				    mailbox_name);
+			return -1;
+		}
 		deliver_log(mail, "save failed to %s: %s", mailbox_name,
 			    mail_storage_get_last_error(*storage_r, &error));
 		return -1;


More information about the dovecot-cvs mailing list