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
constification
[exim.git]
/
src
/
src
/
rewrite.c
diff --git
a/src/src/rewrite.c
b/src/src/rewrite.c
index 9420e79b98dd8f5b391fb0f7a3008d18123a3eab..c0d173abf52b51828f5c42d09bc4aa80b81ad935 100644
(file)
--- a/
src/src/rewrite.c
+++ b/
src/src/rewrite.c
@@
-2,9
+2,10
@@
* Exim - an Internet mail transport agent *
*************************************************/
* Exim - an Internet mail transport agent *
*************************************************/
+/* Copyright (c) The Exim Maintainers 2021 - 2023 */
/* Copyright (c) University of Cambridge 1995 - 2018 */
/* Copyright (c) University of Cambridge 1995 - 2018 */
-/* Copyright (c) The Exim Maintainers 2021 */
/* See the file NOTICE for conditions of use and distribution. */
/* See the file NOTICE for conditions of use and distribution. */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
/* Functions concerned with rewriting headers */
/* Functions concerned with rewriting headers */
@@
-118,9
+119,9
@@
for (rewrite_rule * rule = rewrite_rules;
{
int start, end, pdomain;
int count = 0;
{
int start, end, pdomain;
int count = 0;
-
uschar *
save_localpart;
- const uschar *save_domain;
- uschar *
error, *
new;
+
const uschar *
save_localpart;
+ const uschar *
save_domain;
+ uschar *
error, *
new;
const uschar * newparsed;
/* Come back here for a repeat after a successful rewrite. We do this
const uschar * newparsed;
/* Come back here for a repeat after a successful rewrite. We do this
@@
-136,7
+137,8
@@
for (rewrite_rule * rule = rewrite_rules;
if (flag & rewrite_smtp)
{
if (flag & rewrite_smtp)
{
- uschar *key = expand_string(rule->key);
+ BOOL textonly_re;
+ const uschar * key = expand_string_2(rule->key, &textonly_re);
if (!key)
{
if (!f.expand_string_forcedfail)
if (!key)
{
if (!f.expand_string_forcedfail)
@@
-144,7
+146,8
@@
for (rewrite_rule * rule = rewrite_rules;
"checking for SMTP rewriting: %s", rule->key, expand_string_message);
continue;
}
"checking for SMTP rewriting: %s", rule->key, expand_string_message);
continue;
}
- if (match_check_string(subject, key, 0, TRUE, FALSE, FALSE, NULL) != OK)
+ if (match_check_string(subject, key, 0,
+ textonly_re ? MCS_CACHEABLE | MCS_PARTIAL : MCS_PARTIAL, NULL) != OK)
continue;
new = expand_string(rule->replacement);
}
continue;
new = expand_string(rule->replacement);
}
@@
-495,15
+498,14
@@
while (*s)
if (!recipient)
{
if (!recipient)
{
- /*
Handle
unparesable addresses in the header. Slightly ugly because a
+ /*
Log
unparesable addresses in the header. Slightly ugly because a
null output from the extract can also result from a header without an
null output from the extract can also result from a header without an
- address, "To: undisclosed recpients:;" being the classic case. */
+ address, "To: undisclosed recpients:;" being the classic case. Ignore
+ this one and carry on. */
if ((rewrite_rules || routed_old) && Ustrcmp(errmess, "empty address") != 0)
if ((rewrite_rules || routed_old) && Ustrcmp(errmess, "empty address") != 0)
- {
log_write(0, LOG_MAIN, "rewrite: %s", errmess);
log_write(0, LOG_MAIN, "rewrite: %s", errmess);
- exim_exit(EXIT_FAILURE);
- }
+
loop_reset_point = store_reset(loop_reset_point);
continue;
}
loop_reset_point = store_reset(loop_reset_point);
continue;
}