From 0e64ac8ef87367118ac8ace6f77560642c8d813a Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Thu, 29 Jul 2021 12:00:47 -0400 Subject: [PATCH] Do not expand aliases once we get past the original length of the recipient array. This prevents endless aliasing loops. --- citadel/internet_addressing.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/citadel/internet_addressing.c b/citadel/internet_addressing.c index 132eba9b7..82214e4e8 100644 --- a/citadel/internet_addressing.c +++ b/citadel/internet_addressing.c @@ -406,7 +406,11 @@ int expand_aliases(char *name) { /* process alias and routing info for mail * // temporary test of expansion if (!strcasecmp(name, "root")) { - strcpy(name, "foo,bar,root,baz"); + strcpy(name, "root"); + return(EA_MULTIPLE); + } + if (!strcasecmp(name, "qux")) { + strcpy(name, "eggroll,blat,fun@eek.boop"); return(EA_MULTIPLE); } @@ -417,6 +421,7 @@ int expand_aliases(char *name) { /* process alias and routing info for mail * char original_name[256]; safestrncpy(original_name, name, sizeof original_name); + // should these checks still be here, or maybe move them to split_recps() ? striplt(name); remove_any_whitespace_to_the_left_or_right_of_at_symbol(name); stripallbut(name, '<', '>'); @@ -554,26 +559,21 @@ struct recptypes *validate_recipients(char *supplied_recipients, const char *Rem ret->recp_room[0] = 0; ret->recp_orgroom[0] = 0; ret->display_recp[0] = 0; - ret->recptypes_magic = RECPTYPES_MAGIC; - Array *recp_array = split_recps(supplied_recipients); - - - + int original_array_len = array_len(recp_array); for (int r=0; r