diff src/lda/main.c @ 10690:b7c8221cea5b HEAD

lib-storage: Removed input parameter from mailbox_alloc(), added mailbox_open_stream()
author Timo Sirainen <tss@iki.fi>
date Fri, 12 Feb 2010 23:27:16 +0200
parents 8b138b29dc01
children 638c4ea4a9ce
line wrap: on
line diff
--- a/src/lda/main.c	Fri Feb 12 21:31:49 2010 +0200
+++ b/src/lda/main.c	Fri Feb 12 23:27:16 2010 +0200
@@ -405,16 +405,20 @@
 	if (path == NULL) {
 		input = create_raw_stream(&ctx, 0, &mtime);
 		box = mailbox_alloc(raw_ns->list, "Dovecot Delivery Mail",
-				    input, MAILBOX_FLAG_NO_INDEX_FILES);
+				    MAILBOX_FLAG_NO_INDEX_FILES);
+		if (mailbox_open_stream(box, input) < 0) {
+			i_fatal("Can't open delivery mail as raw: %s",
+				mail_storage_get_last_error(box->storage, &error));
+		}
 		i_stream_unref(&input);
 	} else {
 		mtime = (time_t)-1;
-		box = mailbox_alloc(raw_ns->list, path, NULL,
+		box = mailbox_alloc(raw_ns->list, path,
 				    MAILBOX_FLAG_NO_INDEX_FILES);
-	}
-	if (mailbox_open(box) < 0) {
-		i_fatal("Can't open delivery mail as raw: %s",
-			mail_storage_get_last_error(box->storage, &error));
+		if (mailbox_open(box) < 0) {
+			i_fatal("Can't open delivery mail as raw: %s",
+				mail_storage_get_last_error(box->storage, &error));
+		}
 	}
 	if (mailbox_sync(box, 0) < 0) {
 		i_fatal("Can't sync delivery mail: %s",