Mercurial > dovecot > core-2.2
changeset 12486:d7886c6d9ba5
lmtp: Added lmtp_save_to_detail_mailbox setting.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Tue, 30 Nov 2010 22:38:05 +0000 |
parents | 6e6d3a1cf799 |
children | e12572ca4454 |
files | doc/example-config/conf.d/20-lmtp.conf src/lmtp/commands.c src/lmtp/lmtp-settings.c src/lmtp/lmtp-settings.h |
diffstat | 4 files changed, 12 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/doc/example-config/conf.d/20-lmtp.conf Tue Nov 30 15:01:06 2010 +0000 +++ b/doc/example-config/conf.d/20-lmtp.conf Tue Nov 30 22:38:05 2010 +0000 @@ -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
--- a/src/lmtp/commands.c Tue Nov 30 15:01:06 2010 +0000 +++ b/src/lmtp/commands.c Tue Nov 30 22:38:05 2010 +0000 @@ -483,7 +483,9 @@ 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;
--- a/src/lmtp/lmtp-settings.c Tue Nov 30 15:01:06 2010 +0000 +++ b/src/lmtp/lmtp-settings.c Tue Nov 30 22:38:05 2010 +0000 @@ -58,12 +58,14 @@ 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[] = {