From: Timo Sirainen Date: Tue, 13 Aug 2013 18:02:04 +0000 (+0300) Subject: lmtp: Make it clear that the lda_settings is unexpanded in struct client. X-Git-Tag: 2.2.6~130 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=32efae185f1f86167b3f00ea84f8502940c6c677;p=thirdparty%2Fdovecot%2Fcore.git lmtp: Make it clear that the lda_settings is unexpanded in struct client. --- diff --git a/src/lmtp/client.c b/src/lmtp/client.c index 3b63758d7d..023991a59d 100644 --- a/src/lmtp/client.c +++ b/src/lmtp/client.c @@ -175,7 +175,7 @@ static void client_read_settings(struct client *client) mail_storage_service_get_var_expand_table(storage_service, &input)); client->service_set = master_service_settings_get(master_service); client->lmtp_set = lmtp_set; - client->set = lda_set; + client->unexpanded_lda_set = lda_set; } static void client_generate_session_id(struct client *client) @@ -241,7 +241,7 @@ struct client *client_create(int fd_in, int fd_out, client_read_settings(client); client_raw_user_create(client); client_generate_session_id(client); - client->my_domain = client->set->hostname; + client->my_domain = client->unexpanded_lda_set->hostname; client->lhlo = i_strdup("missing"); client->proxy_ttl = LMTP_PROXY_DEFAULT_TTL; diff --git a/src/lmtp/client.h b/src/lmtp/client.h index f1dd37c02f..18ef1f53da 100644 --- a/src/lmtp/client.h +++ b/src/lmtp/client.h @@ -41,7 +41,7 @@ struct client { pool_t pool; const struct setting_parser_info *user_set_info; - const struct lda_settings *set; + const struct lda_settings *unexpanded_lda_set; const struct lmtp_settings *lmtp_set; const struct master_service_settings *service_set; int fd_in, fd_out; diff --git a/src/lmtp/commands.c b/src/lmtp/commands.c index b3f2885646..bcfbe7dac7 100644 --- a/src/lmtp/commands.c +++ b/src/lmtp/commands.c @@ -222,7 +222,7 @@ static const char * address_add_detail(struct client *client, const char *username, const char *detail) { - const char *delim = client->set->recipient_delimiter; + const char *delim = client->unexpanded_lda_set->recipient_delimiter; const char *domain; domain = strchr(username, '@'); @@ -317,7 +317,7 @@ static bool client_proxy_rcpt(struct client *client, const char *address, struct lmtp_proxy_settings proxy_set; memset(&proxy_set, 0, sizeof(proxy_set)); - proxy_set.my_hostname = client->set->hostname; + proxy_set.my_hostname = client->my_domain; proxy_set.dns_client_socket_path = dns_client_socket_path; proxy_set.session_id = client->state.session_id; proxy_set.source_ip = client->remote_ip; @@ -383,11 +383,11 @@ static void rcpt_address_parse(struct client *client, const char *address, *username_r = address; *detail_r = ""; - if (*client->set->recipient_delimiter == '\0') + if (*client->unexpanded_lda_set->recipient_delimiter == '\0') return; domain = strchr(address, '@'); - p = strstr(address, client->set->recipient_delimiter); + p = strstr(address, client->unexpanded_lda_set->recipient_delimiter); if (p != NULL && (domain == NULL || p < domain)) { /* user+detail@domain */ *username_r = t_strdup_until(*username_r, p);