X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/1ed70f64c0df2c1428057c2ad5b3d43260087396..90bd3832bc0f:/src/src/routers/redirect.c diff --git a/src/src/routers/redirect.c b/src/src/routers/redirect.c index 6a26de9ee..6b27c82b0 100644 --- a/src/src/routers/redirect.c +++ b/src/src/routers/redirect.c @@ -2,9 +2,10 @@ * Exim - an Internet mail transport agent * *************************************************/ +/* Copyright (c) The Exim Maintainers 2020 - 2022 */ /* Copyright (c) University of Cambridge 1995 - 2018 */ -/* Copyright (c) The Exim Maintainers 2020 - 2021 */ /* See the file NOTICE for conditions of use and distribution. */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ #include "../exim.h" @@ -305,9 +306,8 @@ redirect_router_options_block *ob = while (generated) { - address_item *parent; - address_item *next = generated; - uschar *errors_address = next->prop.errors_address; + address_item * next = generated, * parent; + const uschar * errors_address = next->prop.errors_address; generated = next->next; next->parent = addr; @@ -370,12 +370,11 @@ while (generated) in \N...\N to avoid expansion later. In Cygwin, home directories can contain $ characters. */ - if (rblock->home_directory != NULL) + if (rblock->home_directory) next->home_dir = rblock->home_directory; else if (rblock->check_local_user) next->home_dir = string_sprintf("\\N%s\\N", pw->pw_dir); - else if (rblock->router_home_directory != NULL && - testflag(addr, af_home_expanded)) + else if (rblock->router_home_directory && testflag(addr, af_home_expanded)) { next->home_dir = deliver_home; setflag(next, af_home_expanded); @@ -395,6 +394,7 @@ while (generated) if (next->address[0] == '|') { address_pipe = next->address; + GET_OPTION("pipe_transport"); if (rf_get_transport(ob->pipe_transport_name, &ob->pipe_transport, next, rblock->name, US"pipe_transport")) next->transport = ob->pipe_transport; @@ -402,6 +402,7 @@ while (generated) } else if (next->address[0] == '>') { + GET_OPTION("reply_transport"); if (rf_get_transport(ob->reply_transport_name, &ob->reply_transport, next, rblock->name, US"reply_transport")) next->transport = ob->reply_transport; @@ -412,15 +413,19 @@ while (generated) address_file = next->address; if (next->address[len-1] == '/') { + GET_OPTION("directory_transport"); if (rf_get_transport(ob->directory_transport_name, &(ob->directory_transport), next, rblock->name, US"directory_transport")) next->transport = ob->directory_transport; } else + { + GET_OPTION("file_transport"); if (rf_get_transport(ob->file_transport_name, &ob->file_transport, next, rblock->name, US"file_transport")) next->transport = ob->file_transport; + } address_file = NULL; } @@ -566,11 +571,15 @@ address. Otherwise, if a local qualify_domain is provided, set that up. */ if (ob->qualify_preserve_domain) qualify_domain_recipient = addr->domain; -else if (ob->qualify_domain) +else { - uschar *new_qdr = rf_expand_data(addr, ob->qualify_domain, &xrc); - if (!new_qdr) return xrc; - qualify_domain_recipient = new_qdr; + GET_OPTION("qualify_domain"); + if (ob->qualify_domain) + { + uschar *new_qdr = rf_expand_data(addr, ob->qualify_domain, &xrc); + if (!new_qdr) return xrc; + qualify_domain_recipient = new_qdr; + } } redirect.owners = ob->owners;