diff options
author | Jeremy Harris <jgh146exb@wizmail.org> | 2020-05-01 11:42:35 +0100 |
---|---|---|
committer | Jeremy Harris <jgh146exb@wizmail.org> | 2020-05-01 11:51:09 +0100 |
commit | 37c0e209412be42f04a4599ecad6f901bff46f08 (patch) | |
tree | ce613c9a46bd954820e64f962a9f86802aa6ea71 /src | |
parent | 062364db7665faad5273818ac2c8f605ea48fdbe (diff) |
Fix $local_part_verified for remote-delivery routing following local. Bug 2565
Diffstat (limited to 'src')
-rw-r--r-- | src/src/deliver.c | 1 | ||||
-rw-r--r-- | src/src/globals.c | 1 | ||||
-rw-r--r-- | src/src/macros.h | 2 | ||||
-rw-r--r-- | src/src/route.c | 25 | ||||
-rw-r--r-- | src/src/structs.h | 1 |
5 files changed, 15 insertions, 15 deletions
diff --git a/src/src/deliver.c b/src/src/deliver.c index 810eb6452..c8d7e837a 100644 --- a/src/src/deliver.c +++ b/src/src/deliver.c @@ -220,6 +220,7 @@ if (!addr->next) address_item *addr_orig; deliver_localpart = addr->local_part; + deliver_localpart_verified = addr->local_part_verified; deliver_localpart_prefix = addr->prefix; deliver_localpart_prefix_v = addr->prefix_v; deliver_localpart_suffix = addr->suffix; diff --git a/src/src/globals.c b/src/src/globals.c index d00df9731..d630df030 100644 --- a/src/src/globals.c +++ b/src/src/globals.c @@ -187,6 +187,7 @@ const uschar **address_expansions[ADDRESS_EXPANSIONS_COUNT] = { CUSS &deliver_domain_orig, CUSS &deliver_domain_parent, CUSS &deliver_localpart, + CUSS &deliver_localpart_verified, CUSS &deliver_localpart_data, CUSS &deliver_localpart_orig, CUSS &deliver_localpart_parent, diff --git a/src/src/macros.h b/src/src/macros.h index a6dbbf44d..a507bbf83 100644 --- a/src/src/macros.h +++ b/src/src/macros.h @@ -119,7 +119,7 @@ don't make the file descriptors two-way. */ verifying. This has to be explicit because it is referenced in more than one source module. */ -#define ADDRESS_EXPANSIONS_COUNT 18 +#define ADDRESS_EXPANSIONS_COUNT 19 /* The maximum permitted number of command-line (-D) macro definitions. We need a limit only to make it easier to generate argument vectors for re-exec diff --git a/src/src/route.c b/src/src/route.c index d0fbc8c5a..cee2f74c1 100644 --- a/src/src/route.c +++ b/src/src/route.c @@ -959,7 +959,8 @@ if (r->check_local_user) r->name, addr->local_part); return SKIP; } - deliver_localpart_verified = string_copy(US (*pw)->pw_name); + addr->local_part_verified = + deliver_localpart_verified = string_copy(US (*pw)->pw_name); deliver_home = string_copy(US (*pw)->pw_dir); local_user_gid = (*pw)->pw_gid; local_user_uid = (*pw)->pw_uid; @@ -973,22 +974,19 @@ confusing. */ if (r->router_home_directory) { - uschar *router_home = expand_string(r->router_home_directory); - if (!router_home) - { - if (!f.expand_string_forcedfail) - { - *perror = string_sprintf("failed to expand \"%s\" for " - "router_home_directory: %s", r->router_home_directory, - expand_string_message); - return DEFER; - } - } - else + uschar * router_home = expand_string(r->router_home_directory); + if (router_home) { setflag(addr, af_home_expanded); /* Note set from router_home_directory */ deliver_home = router_home; } + else if (!f.expand_string_forcedfail) + { + *perror = string_sprintf("failed to expand \"%s\" for " + "router_home_directory: %s", r->router_home_directory, + expand_string_message); + return DEFER; + } } /* Skip if the sender condition is not met. We leave this one till after the @@ -1696,7 +1694,6 @@ for (r = addr->start_router ? addr->start_router : routers; r; r = nextr) the local part sorted. */ router_name = r->name; - deliver_localpart_verified = NULL; deliver_set_expansions(addr); /* For convenience, the pre-router checks are in a separate function, which diff --git a/src/src/structs.h b/src/src/structs.h index c6700d513..ae37f3461 100644 --- a/src/src/structs.h +++ b/src/src/structs.h @@ -553,6 +553,7 @@ typedef struct address_item { uschar *cc_local_part; /* caseful local part */ uschar *lc_local_part; /* lowercased local part */ uschar *local_part; /* points to cc or lc version */ + uschar *local_part_verified; /* result from check_local_user */ uschar *prefix; /* stripped prefix of local part */ uschar *prefix_v; /* variable part of above */ uschar *suffix; /* stripped suffix of local part */ |