]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lmtp: Added lmtp_save_to_detail_mailbox setting.
authorTimo Sirainen <tss@iki.fi>
Tue, 30 Nov 2010 22:38:05 +0000 (22:38 +0000)
committerTimo Sirainen <tss@iki.fi>
Tue, 30 Nov 2010 22:38:05 +0000 (22:38 +0000)
doc/example-config/conf.d/20-lmtp.conf
src/lmtp/commands.c
src/lmtp/lmtp-settings.c
src/lmtp/lmtp-settings.h

index 69d17b5aca02bbb66978c36ab047ceb426192980..7c5448185ab361ebd86a9710084aee0cfac37cae 100644 (file)
@@ -5,6 +5,11 @@
 # Support proxying to other LMTP/SMTP servers by performing passdb lookups.
 #lmtp_proxy = no
 
+# When recipient address includes the detail (e.g. user+detail), try to save
+# the mail to the detail mailbox. See also recipient_delimiter and
+# lda_mailbox_autocreate settings.
+#lmtp_save_to_detail_mailbox = no
+
 protocol lmtp {
   # Space separated list of plugins to load (default is global mail_plugins).
   #mail_plugins = $mail_plugins
index ba5cedbb3722f9f9fbf5006248de6a53673fba32..211abbf90069b7e320e8574c060f5ca155fc0bd6 100644 (file)
@@ -483,7 +483,9 @@ client_deliver(struct client *client, const struct mail_recipient *rcpt,
        if (dctx.dest_addr == NULL)
                dctx.dest_addr = rcpt->address;
        dctx.final_dest_addr = rcpt->address;
-       dctx.dest_mailbox_name = *rcpt->detail == '\0' ? "INBOX" : rcpt->detail;
+       dctx.dest_mailbox_name = *rcpt->detail != '\0' &&
+               client->lmtp_set->lmtp_save_to_detail_mailbox ?
+               rcpt->detail : "INBOX";
        dctx.save_dest_mail = array_count(&client->state.rcpt_to) > 1 &&
                client->state.first_saved_mail == NULL;
 
index f55895b300997bdf5b8c13639e086cb825dcda96..9d139aa1d2481c7522ab20c5de7113f7124b0667 100644 (file)
@@ -58,12 +58,14 @@ struct service_settings lmtp_service_settings = {
 
 static const struct setting_define lmtp_setting_defines[] = {
        DEF(SET_BOOL, lmtp_proxy),
+       DEF(SET_BOOL, lmtp_save_to_detail_mailbox),
 
        SETTING_DEFINE_LIST_END
 };
 
 static const struct lmtp_settings lmtp_default_settings = {
-       .lmtp_proxy = FALSE
+       .lmtp_proxy = FALSE,
+       .lmtp_save_to_detail_mailbox = FALSE
 };
 
 static const struct setting_parser_info *lmtp_setting_dependencies[] = {
index 58600060c031d50caa10d60d0d96643e3b1b2bd8..5cc73b0f19e24713e9e655fd558c57fd2ce6379f 100644 (file)
@@ -6,6 +6,7 @@ struct lmtp_settings;
 
 struct lmtp_settings {
        bool lmtp_proxy;
+       bool lmtp_save_to_detail_mailbox;
 };
 
 extern const struct setting_parser_info lmtp_setting_parser_info;