git://git.exim.org
/
exim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use single TCP segment for SMTP, TLS and TCP closes.
[exim.git]
/
src
/
src
/
rewrite.c
diff --git
a/src/src/rewrite.c
b/src/src/rewrite.c
index 172f868374ef834390755b3b8e6a48bff17ccff7..74342e1d089c4472ec9ca99d6d582f782b5ef049 100644
(file)
--- a/
src/src/rewrite.c
+++ b/
src/src/rewrite.c
@@
-100,7
+100,6
@@
uschar *
rewrite_one(uschar *s, int flag, BOOL *whole, BOOL add_header, uschar *name,
rewrite_rule *rewrite_rules)
{
rewrite_one(uschar *s, int flag, BOOL *whole, BOOL add_header, uschar *name,
rewrite_rule *rewrite_rules)
{
-rewrite_rule *rule;
uschar *yield = s;
uschar *subject = s;
uschar *domain = NULL;
uschar *yield = s;
uschar *subject = s;
uschar *domain = NULL;
@@
-112,9
+111,7
@@
if (whole != NULL) *whole = FALSE;
/* Scan the rewriting rules */
/* Scan the rewriting rules */
-for (rule = rewrite_rules;
- rule != NULL && !done;
- rule_number++, rule = rule->next)
+for (rewrite_rule * rule = rewrite_rules; rule; rule_number++, rule = rule->next)
{
int start, end, pdomain;
int count = 0;
{
int start, end, pdomain;
int count = 0;
@@
-142,7
+139,7
@@
for (rule = rewrite_rules;
uschar *key = expand_string(rule->key);
if (key == NULL)
{
uschar *key = expand_string(rule->key);
if (key == NULL)
{
- if (!expand_string_forcedfail)
+ if (!
f.
expand_string_forcedfail)
log_write(0, LOG_MAIN|LOG_PANIC, "failed to expand \"%s\" while "
"checking for SMTP rewriting: %s", rule->key, expand_string_message);
continue;
log_write(0, LOG_MAIN|LOG_PANIC, "failed to expand \"%s\" while "
"checking for SMTP rewriting: %s", rule->key, expand_string_message);
continue;
@@
-203,7
+200,7
@@
for (rule = rewrite_rules;
if (new == NULL)
{
if (new == NULL)
{
- if (expand_string_forcedfail)
+ if (
f.
expand_string_forcedfail)
{ if ((rule->flags & rewrite_quit) != 0) break; else continue; }
expand_string_message = expand_hide_passwords(expand_string_message);
{ if ((rule->flags & rewrite_quit) != 0) break; else continue; }
expand_string_message = expand_hide_passwords(expand_string_message);
@@
-252,17
+249,14
@@
for (rule = rewrite_rules;
if (LOGGING(address_rewrite) || (debug_selector & D_rewrite) != 0)
{
if (LOGGING(address_rewrite) || (debug_selector & D_rewrite) != 0)
{
- int i;
const uschar *where = CUS"?";
const uschar *where = CUS"?";
- for (i = 0; i < where_list_size; i++)
- {
+ for (int i = 0; i < where_list_size; i++)
if (flag == where_list[i].bit)
{
where = where_list[i].string;
break;
}
if (flag == where_list[i].bit)
{
where = where_list[i].string;
break;
}
- }
log_write(L_address_rewrite,
LOG_MAIN, "\"%s\" from %s rewritten as \"%s\" by rule %d",
yield, where, new, rule_number);
log_write(L_address_rewrite,
LOG_MAIN, "\"%s\" from %s rewritten as \"%s\" by rule %d",
yield, where, new, rule_number);
@@
-465,7
+459,7
@@
while (isspace(*s)) s++;
DEBUG(D_rewrite)
debug_printf("rewrite_one_header: type=%c:\n %s", h->type, h->text);
DEBUG(D_rewrite)
debug_printf("rewrite_one_header: type=%c:\n %s", h->type, h->text);
-parse_allow_group = TRUE; /* Allow group syntax */
+
f.
parse_allow_group = TRUE; /* Allow group syntax */
/* Loop for multiple addresses in the header. We have to go through them all
in case any need qualifying, even if there's no rewriting. Pathological headers
/* Loop for multiple addresses in the header. We have to go through them all
in case any need qualifying, even if there's no rewriting. Pathological headers
@@
-474,7
+468,7
@@
any that don't actually get rewritten. We also play silly games for those that
_are_ rewritten so as to avoid runaway store usage for these kinds of header.
We want to avoid keeping store for any intermediate versions. */
_are_ rewritten so as to avoid runaway store usage for these kinds of header.
We want to avoid keeping store for any intermediate versions. */
-while (*s
!= 0
)
+while (*s)
{
uschar *sprev;
uschar *ss = parse_find_address_end(s, FALSE);
{
uschar *sprev;
uschar *ss = parse_find_address_end(s, FALSE);
@@
-498,7
+492,7
@@
while (*s != 0)
/* There isn't much we can do for syntactic disasters at this stage.
Pro tem (possibly for ever) ignore them. */
/* There isn't much we can do for syntactic disasters at this stage.
Pro tem (possibly for ever) ignore them. */
- if (
recipient == NULL
)
+ if (
!recipient
)
{
store_reset(loop_reset_point);
continue;
{
store_reset(loop_reset_point);
continue;
@@
-544,8
+538,8
@@
while (*s != 0)
/* Can only qualify if permitted; if not, no rewrite. */
/* Can only qualify if permitted; if not, no rewrite. */
- if (changed && ((is_recipient && !allow_unqualified_recipient) ||
- (!is_recipient && !allow_unqualified_sender)))
+ if (changed && ((is_recipient && !
f.
allow_unqualified_recipient) ||
+ (!is_recipient && !
f.
allow_unqualified_sender)))
{
store_reset(loop_reset_point);
continue;
{
store_reset(loop_reset_point);
continue;
@@
-673,8
+667,8
@@
while (*s != 0)
}
}
}
}
-parse_allow_group = FALSE; /* Reset group flags */
-parse_found_group = FALSE;
+
f.
parse_allow_group = FALSE; /* Reset group flags */
+
f.
parse_found_group = FALSE;
/* If a rewrite happened and "replace" is true, put the new header into the
chain following the old one, and mark the old one as replaced. */
/* If a rewrite happened and "replace" is true, put the new header into the
chain following the old one, and mark the old one as replaced. */
@@
-771,7
+765,7
@@
Returns: nothing
void rewrite_test(uschar *s)
{
uschar *recipient, *error;
void rewrite_test(uschar *s)
{
uschar *recipient, *error;
-int
i,
start, end, domain;
+int start, end, domain;
BOOL done_smtp = FALSE;
if (rewrite_existflags == 0)
BOOL done_smtp = FALSE;
if (rewrite_existflags == 0)
@@
-808,14
+802,14
@@
if (parse_find_at(s) == NULL)
recipient = parse_extract_address(s, &error, &start, &end, &domain, FALSE);
recipient = parse_extract_address(s, &error, &start, &end, &domain, FALSE);
-if (
recipient == NULL
)
+if (
!recipient
)
{
if (!done_smtp)
printf("Syntax error in %s\n%c%s\n", s, toupper(error[0]), error+1);
return;
}
{
if (!done_smtp)
printf("Syntax error in %s\n%c%s\n", s, toupper(error[0]), error+1);
return;
}
-for (i = 0; i < 8; i++)
+for (i
nt i
= 0; i < 8; i++)
{
BOOL whole = FALSE;
int flag = 1 << i;
{
BOOL whole = FALSE;
int flag = 1 << i;