X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/fd6de02e0406522ba0cfff43d6be5b0201200b95..3386088d5af4d4c61faa12ae29560e2c5bd43304:/src/src/routers/rf_get_errors_address.c diff --git a/src/src/routers/rf_get_errors_address.c b/src/src/routers/rf_get_errors_address.c index e0eb0f026..d7172d7ac 100644 --- a/src/src/routers/rf_get_errors_address.c +++ b/src/src/routers/rf_get_errors_address.c @@ -1,10 +1,8 @@ -/* $Cambridge: exim/src/src/routers/rf_get_errors_address.c,v 1.4 2005/09/12 15:09:55 ph10 Exp $ */ - /************************************************* * Exim - an Internet mail transport agent * *************************************************/ -/* Copyright (c) University of Cambridge 1995 - 2005 */ +/* Copyright (c) University of Cambridge 1995 - 2015 */ /* See the file NOTICE for conditions of use and distribution. */ #include "../exim.h" @@ -40,7 +38,7 @@ rf_get_errors_address(address_item *addr, router_instance *rblock, { uschar *s; -*errors_to = addr->p.errors_address; +*errors_to = addr->prop.errors_address; if (rblock->errors_to == NULL) return OK; s = expand_string(rblock->errors_to); @@ -86,8 +84,8 @@ else BOOL save_address_test_mode = address_test_mode; int save1 = 0; int i; - uschar ***p; - uschar *address_expansions_save[ADDRESS_EXPANSIONS_COUNT]; + const uschar ***p; + const uschar *address_expansions_save[ADDRESS_EXPANSIONS_COUNT]; address_item *snew = deliver_make_addr(s, FALSE); if (sender_address != NULL) @@ -100,10 +98,23 @@ else address_expansions_save[i++] = **p++; address_test_mode = FALSE; + /* NOTE: the address is verified as a recipient, not a sender. This is + perhaps confusing. It isn't immediately obvious what to do: we want to have + some confidence that we can deliver to the address, in which case it will be + a recipient, but on the other hand, it will be passed on in SMTP deliveries + as a sender. However, I think on balance recipient is right because sender + verification is really about the *incoming* sender of the message. + + If this code is changed, note that you must set vopt_fake_sender instead of + vopt_is_recipient, as otherwise sender_address may be altered because + verify_address() thinks it is dealing with *the* sender of the message. */ + DEBUG(D_route|D_verify) debug_printf("------ Verifying errors address %s ------\n", s); - if (verify_address(snew, NULL, vopt_is_recipient | vopt_qualify, -1, -1, -1, - NULL, NULL, NULL) == OK) *errors_to = snew->address; + if (verify_address(snew, NULL, + vopt_is_recipient /* vopt_fake_sender is the alternative */ + | vopt_qualify, -1, -1, -1, NULL, NULL, NULL) == OK) + *errors_to = snew->address; DEBUG(D_route|D_verify) debug_printf("------ End verifying errors address %s ------\n", s);