dovecot-2.0: lmtp: With lmtp_save_to_detail_mailbox=yes, save ma...

dovecot at dovecot.org dovecot at dovecot.org
Mon May 9 17:41:54 EEST 2011


details:   http://hg.dovecot.org/dovecot-2.0/rev/622d42376fe0
changeset: 12775:622d42376fe0
user:      Timo Sirainen <tss at iki.fi>
date:      Mon May 09 17:41:45 2011 +0300
description:
lmtp: With lmtp_save_to_detail_mailbox=yes, save mail to <inbox ns prefix>detail.
The previous behavior required using prefix="" namespace to work.

diffstat:

 src/lmtp/commands.c |  13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diffs (30 lines):

diff -r 840e27a52e51 -r 622d42376fe0 src/lmtp/commands.c
--- a/src/lmtp/commands.c	Thu May 05 18:13:55 2011 +0200
+++ b/src/lmtp/commands.c	Mon May 09 17:41:45 2011 +0300
@@ -452,6 +452,7 @@
 	struct mail_deliver_context dctx;
 	struct mail_storage *storage;
 	const struct mail_storage_service_input *input;
+	struct mail_namespace *ns;
 	void **sets;
 	const char *error, *username;
 	enum mail_error mail_error;
@@ -485,9 +486,15 @@
 	if (dctx.dest_addr == NULL)
 		dctx.dest_addr = rcpt->address;
 	dctx.final_dest_addr = rcpt->address;
-	dctx.dest_mailbox_name = *rcpt->detail != '\0' &&
-		client->lmtp_set->lmtp_save_to_detail_mailbox ?
-		rcpt->detail : "INBOX";
+	if (rcpt->detail == '\0' ||
+	    !client->lmtp_set->lmtp_save_to_detail_mailbox)
+		dctx.dest_mailbox_name = "INBOX";
+	else {
+		ns = mail_namespace_find_inbox(dctx.dest_user->namespaces);
+		dctx.dest_mailbox_name =
+			t_strconcat(ns->prefix, rcpt->detail, NULL);
+	}
+
 	dctx.save_dest_mail = array_count(&client->state.rcpt_to) > 1 &&
 		client->state.first_saved_mail == NULL;
 


More information about the dovecot-cvs mailing list