# HG changeset patch # User Timo Sirainen # Date 1203532747 -7200 # Node ID c6afa177bbf1454af35fd08901a1b7ffc14b0142 # Parent af415b88ba1db049c551e6934ead23085c349382 Don't crash if trying to deliver mail to mailbox outside all namespaces. diff -r af415b88ba1d -r c6afa177bbf1 src/deliver/deliver.c --- a/src/deliver/deliver.c Wed Feb 20 20:02:37 2008 +0200 +++ b/src/deliver/deliver.c Wed Feb 20 20:39:07 2008 +0200 @@ -199,6 +199,12 @@ 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;