]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lda, lmtp: postmaster_address = postmaster@%d works now.
authorTimo Sirainen <tss@iki.fi>
Wed, 13 Mar 2013 13:05:05 +0000 (15:05 +0200)
committerTimo Sirainen <tss@iki.fi>
Wed, 13 Mar 2013 13:05:05 +0000 (15:05 +0200)
doc/example-config/conf.d/15-lda.conf
src/lda/main.c
src/lib-lda/lda-settings.c
src/lmtp/commands.c

index 09bb43a9aa9b79bda95d8b12039084efd9661031..bcee86c5553015b2365e03bf7c25abef3799e70a 100644 (file)
@@ -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
index a7d660e75530e2da4b87badb81c13ef1ef56b216..447168fac82905d278a77715691963b3757ecfc7 100644 (file)
@@ -276,6 +276,7 @@ int main(int argc, char *argv[])
        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 @@ int main(int argc, char *argv[])
 #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",
index af66a9161e51d26fc91913cfa8753eff9e537f68..e66f8932297263947b1f4f0f5262866dec8037a0 100644 (file)
@@ -18,7 +18,7 @@ static bool lda_settings_check(void *_set, pool_t pool, const char **error_r);
        { 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),
index 2bbbeffb4e508d586fdf0fea03abaa9f1ea0640c..3dc9539178e12ffc2d3cbc3a68d2611db5b1d0db 100644 (file)
@@ -620,6 +620,7 @@ client_deliver(struct client *client, const struct mail_recipient *rcpt,
        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 @@ client_deliver(struct client *client, const struct mail_recipient *rcpt,
                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;