From: Art Cancro Date: Thu, 9 Sep 2021 02:47:12 +0000 (+0000) Subject: Now it also works when receiving messages over SMTP. Still need to eliminate dupes. X-Git-Tag: v939~10 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=0f6f679972be3ad0f71f4d0f2d9439a670fb2c72 Now it also works when receiving messages over SMTP. Still need to eliminate dupes. --- diff --git a/citadel/internet_addressing.c b/citadel/internet_addressing.c index 72b52b680..9f5ae2c2f 100644 --- a/citadel/internet_addressing.c +++ b/citadel/internet_addressing.c @@ -575,13 +575,16 @@ struct recptypes *validate_recipients(char *supplied_recipients, const char *Rem for (int r=0; (recp_array && r", r, mailtype, this_recp); - // If an alias expanded to multiple recipients, strip off those recipients and append them - // to the end of the array. This loop will hit those again when it gets there. - if (mailtype == EA_MULTIPLE) { - recp_array = split_recps(this_recp, recp_array); + for (int i=0; i<3; ++i) { // pass three times through the aliaser + mailtype = expand_aliases(this_recp, aliases); + syslog(LOG_DEBUG, "Recipient #%d of type %d is <%s>", r, mailtype, this_recp); + + // If an alias expanded to multiple recipients, strip off those recipients and append them + // to the end of the array. This loop will hit those again when it gets there. + if (mailtype == EA_MULTIPLE) { + recp_array = split_recps(this_recp, recp_array); + } } invalid = 0;