}
recipients_list_max = recipients_list_max ? 2*recipients_list_max : 50;
- recipients_list = store_get(recipients_list_max * sizeof(recipient_item), FALSE);
+ recipients_list = store_get(recipients_list_max * sizeof(recipient_item), GET_UNTAINTED);
if (oldlist)
memcpy(recipients_list, oldlist, oldmax * sizeof(recipient_item));
}
header. Temporarily mark it as "old", i.e. not to be used. We keep header_last
pointing to the end of the chain to make adding headers simple. */
-received_header = header_list = header_last = store_get(sizeof(header_line), FALSE);
+received_header = header_list = header_last = store_get(sizeof(header_line), GET_UNTAINTED);
header_list->next = NULL;
header_list->type = htype_old;
header_list->text = NULL;
header_list->slen = 0;
-/* Control block for the next header to be read. */
+/* Control block for the next header to be read.
+The data comes from the message, so is tainted. */
reset_point = store_mark();
-next = store_get(sizeof(header_line), FALSE); /* not tainted */
-next->text = store_get(header_size, TRUE); /* tainted */
+next = store_get(sizeof(header_line), GET_UNTAINTED);
+next->text = store_get(header_size, GET_TAINTED);
/* Initialize message id to be null (indicating no message read), and the
header names list to be the normal list. Indicate there is no data file open
goto OVERSIZE;
header_size *= 2;
- /* The data came from the message, so is tainted. */
-
- if (!store_extend(next->text, TRUE, oldsize, header_size))
- next->text = store_newblock(next->text, TRUE, header_size, ptr);
+ if (!store_extend(next->text, oldsize, header_size))
+ next->text = store_newblock(next->text, header_size, ptr);
}
/* Cope with receiving a binary zero. There is dispute about whether
reset_point = store_mark();
header_size = 256;
- next = store_get(sizeof(header_line), FALSE);
- next->text = store_get(header_size, TRUE);
+ next = store_get(sizeof(header_line), GET_UNTAINTED);
+ next->text = store_get(header_size, GET_TAINTED);
ptr = 0;
had_zero = 0;
prevlines_length = 0;
white space that follows the newline must not be removed - it is part
of the header. */
- pp = recipient = store_get(ss - s + 1, is_tainted(s));
+ pp = recipient = store_get(ss - s + 1, s);
for (uschar * p = s; p < ss; p++) if (*p != '\n') *pp++ = *p;
*pp = 0;
if (!recipient && Ustrcmp(errmess, "empty address") != 0)
{
int len = Ustrlen(s);
- error_block *b = store_get(sizeof(error_block), FALSE);
+ error_block * b = store_get(sizeof(error_block), GET_UNTAINTED);
while (len > 0 && isspace(s[len-1])) len--;
b->next = NULL;
b->text1 = string_printing(string_copyn(s, len));
if (LOGGING(received_recipients))
{
- raw_recipients = store_get(recipients_count * sizeof(uschar *), FALSE);
+ raw_recipients = store_get(recipients_count * sizeof(uschar *), GET_UNTAINTED);
for (int i = 0; i < recipients_count; i++)
raw_recipients[i] = string_copy(recipients_list[i].address);
raw_recipients_count = recipients_count;
recipients will get here only if the conditions were right (allow_unqualified_
recipient is TRUE). */
+DEBUG(D_rewrite)
+ { debug_printf_indent("qualify & rewrite recipients list\n"); acl_level++; }
for (int i = 0; i < recipients_count; i++)
recipients_list[i].address = /* deconst ok as src was not cont */
US rewrite_address(recipients_list[i].address, TRUE, TRUE,
global_rewrite_rules, rewrite_existflags);
+DEBUG(D_rewrite) acl_level--;
/* If there is no From: header, generate one for local (without
suppress_local_fixups) or submission_mode messages. If there is no sender
/* If there are any rewriting rules, apply them to the sender address, unless
it has already been rewritten as part of verification for SMTP input. */
+DEBUG(D_rewrite)
+ { debug_printf("global rewrite rules\n"); acl_level++; }
if (global_rewrite_rules && !sender_address_unrewritten && *sender_address)
{
/* deconst ok as src was not const */
DEBUG(D_receive|D_rewrite)
debug_printf("rewritten sender = %s\n", sender_address);
}
+DEBUG(D_rewrite) acl_level--;
/* The headers must be run through rewrite_header(), because it ensures that
documented as happening *after* recipient addresses are taken from the headers
by the -t command line option. An added Sender: gets rewritten here. */
-for (header_line * h = header_list->next; h; h = h->next)
- {
- header_line *newh = rewrite_header(h, NULL, NULL, global_rewrite_rules,
- rewrite_existflags, TRUE);
- if (newh) h = newh;
- }
+DEBUG(D_rewrite)
+ { debug_printf("rewrite headers\n"); acl_level++; }
+for (header_line * h = header_list->next, * newh; h; h = h->next)
+ if ((newh = rewrite_header(h, NULL, NULL, global_rewrite_rules,
+ rewrite_existflags, TRUE)))
+ h = newh;
+DEBUG(D_rewrite) acl_level--;
/* An RFC 822 (sic) message is not legal unless it has at least one of "to",