- // 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);
+ }