From: Timo Sirainen Date: Tue, 30 Nov 2010 22:38:05 +0000 (+0000) Subject: lmtp: Added lmtp_save_to_detail_mailbox setting. X-Git-Tag: 2.0.8~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=70af4db1c95a5ea3749213da539359b76abcfcd1;p=thirdparty%2Fdovecot%2Fcore.git lmtp: Added lmtp_save_to_detail_mailbox setting. --- diff --git a/doc/example-config/conf.d/20-lmtp.conf b/doc/example-config/conf.d/20-lmtp.conf index 69d17b5aca..7c5448185a 100644 --- a/doc/example-config/conf.d/20-lmtp.conf +++ b/doc/example-config/conf.d/20-lmtp.conf @@ -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 diff --git a/src/lmtp/commands.c b/src/lmtp/commands.c index ba5cedbb37..211abbf900 100644 --- a/src/lmtp/commands.c +++ b/src/lmtp/commands.c @@ -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; diff --git a/src/lmtp/lmtp-settings.c b/src/lmtp/lmtp-settings.c index f55895b300..9d139aa1d2 100644 --- a/src/lmtp/lmtp-settings.c +++ b/src/lmtp/lmtp-settings.c @@ -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[] = { diff --git a/src/lmtp/lmtp-settings.h b/src/lmtp/lmtp-settings.h index 58600060c0..5cc73b0f19 100644 --- a/src/lmtp/lmtp-settings.h +++ b/src/lmtp/lmtp-settings.h @@ -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;