dovecot-2.2: lda, lmtp: postmaster_address = postmaster@%d works...
dovecot at dovecot.org
dovecot at dovecot.org
Wed Mar 13 15:05:16 EET 2013
details: http://hg.dovecot.org/dovecot-2.2/rev/34d61f447433
changeset: 16019:34d61f447433
user: Timo Sirainen <tss at iki.fi>
date: Wed Mar 13 15:05:05 2013 +0200
description:
lda, lmtp: postmaster_address = postmaster@%d works now.
diffstat:
doc/example-config/conf.d/15-lda.conf | 2 +-
src/lda/main.c | 7 ++++++-
src/lib-lda/lda-settings.c | 2 +-
src/lmtp/commands.c | 6 +++++-
4 files changed, 13 insertions(+), 4 deletions(-)
diffs (75 lines):
diff -r dc4be035a038 -r 34d61f447433 doc/example-config/conf.d/15-lda.conf
--- a/doc/example-config/conf.d/15-lda.conf Mon Mar 11 17:25:46 2013 +0200
+++ b/doc/example-config/conf.d/15-lda.conf Wed Mar 13 15:05:05 2013 +0200
@@ -3,7 +3,7 @@
##
# Address to use when sending rejection mails.
-# Default is postmaster@<your domain>.
+# Default is postmaster@<your domain>. %d expands to recipient domain.
#postmaster_address =
# Hostname to use in various parts of sent mails (e.g. in Message-Id) and
diff -r dc4be035a038 -r 34d61f447433 src/lda/main.c
--- a/src/lda/main.c Mon Mar 11 17:25:46 2013 +0200
+++ b/src/lda/main.c Wed Mar 13 15:05:05 2013 +0200
@@ -276,6 +276,7 @@
struct mail_deliver_context ctx;
enum mail_storage_service_flags service_flags = 0;
const char *user, *errstr, *path;
+ struct lda_settings *lda_set;
struct mail_storage_service_ctx *storage_service;
struct mail_storage_service_user *service_user;
struct mail_storage_service_input service_input;
@@ -420,7 +421,11 @@
#ifdef SIGXFSZ
lib_signals_ignore(SIGXFSZ, TRUE);
#endif
- ctx.set = mail_storage_service_user_get_set(service_user)[1];
+ lda_set = mail_storage_service_user_get_set(service_user)[1];
+ settings_var_expand(&lda_setting_parser_info, lda_set,
+ ctx.dest_user->pool,
+ mail_user_var_expand_table(ctx.dest_user));
+ ctx.set = lda_set;
if (ctx.dest_user->mail_debug && *user_source != '\0') {
i_debug("userdb lookup skipped, username taken from %s",
diff -r dc4be035a038 -r 34d61f447433 src/lib-lda/lda-settings.c
--- a/src/lib-lda/lda-settings.c Mon Mar 11 17:25:46 2013 +0200
+++ b/src/lib-lda/lda-settings.c Wed Mar 13 15:05:05 2013 +0200
@@ -18,7 +18,7 @@
{ SET_DEFLIST, name, offsetof(struct lda_settings, field), defines }
static const struct setting_define lda_setting_defines[] = {
- DEF(SET_STR, postmaster_address),
+ DEF(SET_STR_VARS, postmaster_address),
DEF(SET_STR, hostname),
DEF(SET_STR, submission_host),
DEF(SET_STR, sendmail_path),
diff -r dc4be035a038 -r 34d61f447433 src/lmtp/commands.c
--- a/src/lmtp/commands.c Mon Mar 11 17:25:46 2013 +0200
+++ b/src/lmtp/commands.c Wed Mar 13 15:05:05 2013 +0200
@@ -620,6 +620,7 @@
struct mail_storage *storage;
const struct mail_storage_service_input *input;
const struct mail_storage_settings *mail_set;
+ struct lda_settings *lda_set;
struct mail_namespace *ns;
struct setting_parser_context *set_parser;
void **sets;
@@ -654,11 +655,14 @@
return -1;
}
sets = mail_storage_service_user_get_set(rcpt->service_user);
+ lda_set = sets[1];
+ settings_var_expand(&lda_setting_parser_info, lda_set, client->pool,
+ mail_user_var_expand_table(client->state.dest_user));
memset(&dctx, 0, sizeof(dctx));
dctx.session = session;
dctx.pool = session->pool;
- dctx.set = sets[1];
+ dctx.set = lda_set;
dctx.session_id = client->state.session_id;
dctx.src_mail = src_mail;
dctx.src_envelope_sender = client->state.mail_from;
More information about the dovecot-cvs
mailing list