summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPhilip Hazel <ph10@hermes.cam.ac.uk>2004-10-19 13:40:39 +0000
committerPhilip Hazel <ph10@hermes.cam.ac.uk>2004-10-19 13:40:39 +0000
commit2a3eea108d202b0fc2d1ad17b3069ab78e811b7b (patch)
tree5f90e77fa52f454594d20e01fc95e84986f53502 /src
parenteb2c02484772e04f92ec95769011ce2e6ad55bc2 (diff)
(1) $address_data in an ACL was clobbered by a sender verify that
followed a recipient verify. (2) Added $sender_address_data to hold the address_data value from a sender verification.
Diffstat (limited to 'src')
-rw-r--r--src/src/acl.c15
-rw-r--r--src/src/expand.c3
-rw-r--r--src/src/globals.c3
-rw-r--r--src/src/globals.h3
4 files changed, 19 insertions, 5 deletions
diff --git a/src/src/acl.c b/src/src/acl.c
index 31087809b..1812e0be2 100644
--- a/src/src/acl.c
+++ b/src/src/acl.c
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/acl.c,v 1.3 2004/10/19 11:04:26 ph10 Exp $ */
+/* $Cambridge: exim/src/src/acl.c,v 1.4 2004/10/19 13:40:39 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -1012,6 +1012,8 @@ else if (verify_sender_address != NULL)
else
{
BOOL routed = TRUE;
+ uschar *save_address_data = deliver_address_data;
+
sender_vaddr = deliver_make_addr(verify_sender_address, TRUE);
if (no_details) setflag(sender_vaddr, af_sverify_told);
if (verify_sender_address[0] != 0)
@@ -1057,7 +1059,16 @@ else if (verify_sender_address != NULL)
sender_vaddr->special_action = rc;
sender_vaddr->next = sender_verified_list;
sender_verified_list = sender_vaddr;
+
+ /* Restore the recipient address data, which might have been clobbered by
+ the sender verification. */
+
+ deliver_address_data = save_address_data;
}
+
+ /* Put the sender address_data value into $sender_address_data */
+
+ sender_address_data = sender_vaddr->p.address_data;
}
/* A recipient address just gets a straightforward verify; again we must handle
@@ -2109,7 +2120,7 @@ else
rc = acl_check_internal(where, addr, s, 0, user_msgptr, log_msgptr);
smtp_command_argument = deliver_domain =
- deliver_localpart = deliver_address_data = NULL;
+ deliver_localpart = deliver_address_data = sender_address_data = NULL;
/* A DISCARD response is permitted only for message ACLs, excluding the PREDATA
ACL, which is really in the middle of an SMTP command. */
diff --git a/src/src/expand.c b/src/src/expand.c
index 16bdfea68..afe57f9b0 100644
--- a/src/src/expand.c
+++ b/src/src/expand.c
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/expand.c,v 1.1 2004/10/07 10:39:01 ph10 Exp $ */
+/* $Cambridge: exim/src/src/expand.c,v 1.2 2004/10/19 13:40:39 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -395,6 +395,7 @@ static var_entry var_table[] = {
{ "runrc", vtype_int, &runrc },
{ "self_hostname", vtype_stringptr, &self_hostname },
{ "sender_address", vtype_stringptr, &sender_address },
+ { "sender_address_data", vtype_stringptr, &sender_address_data },
{ "sender_address_domain", vtype_domain, &sender_address },
{ "sender_address_local_part", vtype_localpart, &sender_address },
{ "sender_data", vtype_stringptr, &sender_data },
diff --git a/src/src/globals.c b/src/src/globals.c
index 634fd6c23..58ae5171b 100644
--- a/src/src/globals.c
+++ b/src/src/globals.c
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/globals.c,v 1.3 2004/10/19 11:04:26 ph10 Exp $ */
+/* $Cambridge: exim/src/src/globals.c,v 1.4 2004/10/19 13:40:39 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -859,6 +859,7 @@ BOOL search_find_defer = FALSE;
uschar *self_hostname = NULL;
uschar *sender_address = NULL;
unsigned int sender_address_cache[(MAX_NAMED_LIST * 2)/32];
+uschar *sender_address_data = NULL;
BOOL sender_address_forced = FALSE;
uschar *sender_address_unrewritten = NULL;
uschar *sender_data = NULL;
diff --git a/src/src/globals.h b/src/src/globals.h
index 458e6638d..c9106b9ab 100644
--- a/src/src/globals.h
+++ b/src/src/globals.h
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/globals.h,v 1.3 2004/10/19 11:04:26 ph10 Exp $ */
+/* $Cambridge: exim/src/src/globals.h,v 1.4 2004/10/19 13:40:39 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -489,6 +489,7 @@ extern uschar *search_error_message; /* Details of lookup problem */
extern BOOL search_find_defer; /* Set TRUE if lookup deferred */
extern uschar *self_hostname; /* Self host after routing->directors */
extern unsigned int sender_address_cache[(MAX_NAMED_LIST * 2)/32]; /* Cache bits for sender */
+extern uschar *sender_address_data; /* address_data from sender verify */
extern BOOL sender_address_forced; /* Set by -f */
extern uschar *sender_address_unrewritten; /* Set if rewritten by verify */
extern uschar *sender_data; /* lookup result for senders */