{
const uschar *yield = s;
const uschar *subject = s;
-uschar *domain = NULL;
+const uschar *domain = NULL;
BOOL done = FALSE;
int rule_number = 1;
int yield_start = 0, yield_end = 0;
else
{
- if (!domain) domain = Ustrrchr(subject, '@') + 1;
+ if (!domain) domain = CUstrrchr(subject, '@') + 1;
/* Use the general function for matching an address against a list (here
just one item, so use the "impossible value" separator UCHAR_MAX+1). */
save_domain = deliver_domain;
/* We have subject pointing to "localpart@domain" and domain pointing to
- the domain. Temporarily terminate the local part so that it can be
- set up as an expansion variable */
+ the domain. Split into local part and domain so that it can be set up as
+ an expansion variable */
- domain[-1] = 0;
- deliver_localpart = US subject;
+ deliver_localpart = US string_copyn(subject, domain-subject-1);
deliver_domain = domain;
new = expand_string(rule->replacement);
- domain[-1] = '@';
deliver_localpart = save_localpart;
deliver_domain = save_domain;
}
rmark function_reset_point = store_mark();
uschar * s = Ustrchr(h->text, ':') + 1;
-while (isspace(*s)) s++;
+Uskip_whitespace(&s);
DEBUG(D_rewrite) /* The header text includes the trailing newline */
debug_printf_indent("rewrite_one_header: type=%c:\n %s", h->type, h->text);
recipient = parse_extract_address(s, &errmess, &start, &end, &domain, FALSE);
*ss1 = terminator;
s = ss + (*ss ? 1 : 0);
- while (isspace(*s)) s++;
+ Uskip_whitespace(&s);
/* There isn't much we can do for syntactic disasters at this stage.
Pro tem (possibly for ever) ignore them.