changeset 9117:a9f61b63dc3d HEAD

lmtp: Minor cleanup.
author Timo Sirainen <tss@iki.fi>
date Thu, 16 Apr 2009 18:09:36 -0400
parents b1e9bb291e70
children 03fe226e85d4
files src/lda/main.c
diffstat 1 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/lda/main.c	Wed Apr 15 20:24:53 2009 -0400
+++ b/src/lda/main.c	Thu Apr 16 18:09:36 2009 -0400
@@ -40,7 +40,7 @@
 #define MAIL_MAX_MEMORY_BUFFER (1024*128)
 
 static const char *wanted_headers[] = {
-	"From", "Message-ID", "Subject", "Return-Path",
+	"From", "To", "Message-ID", "Subject", "Return-Path",
 	NULL
 };
 
@@ -367,6 +367,7 @@
 	t = mailbox_transaction_begin(box, 0);
 	headers_ctx = mailbox_header_lookup_init(box, wanted_headers);
 	ctx.src_mail = mail_alloc(t, 0, headers_ctx);
+	mailbox_header_lookup_unref(&headers_ctx);
 	mail_set_seq(ctx.src_mail, 1);
 
 	if (ctx.dest_addr == NULL) {
@@ -377,11 +378,10 @@
 		}
 	}
 
-	ret = mail_deliver(&ctx, &storage);
-	if (ret < 0) {
+	if (mail_deliver(&ctx, &storage) < 0) {
 		if (storage == NULL) {
 			/* This shouldn't happen */
-			i_error("BUG: Saving failed for unknown storage");
+			i_error("BUG: Saving failed to unknown storage");
 			return EX_TEMPFAIL;
 		}
 
@@ -414,7 +414,6 @@
 	}
 
 	mail_free(&ctx.src_mail);
-	mailbox_header_lookup_unref(&headers_ctx);
 	mailbox_transaction_rollback(&t);
 	mailbox_close(&box);