From ca95cb7de323c6a736297535284d2435e5649ca0 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Tue, 14 Apr 2009 14:25:59 +0000 Subject: [PATCH] * When delivering mailing list messages, submit with bounce_to and envelope_from set to room_aide@xxx.xxx.xxx --- citadel/modules/network/serv_network.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/citadel/modules/network/serv_network.c b/citadel/modules/network/serv_network.c index b71d95a5f..922452cdf 100644 --- a/citadel/modules/network/serv_network.c +++ b/citadel/modules/network/serv_network.c @@ -452,6 +452,7 @@ void network_deliver_digest(SpoolControl *sc) { size_t recps_len = SIZ; struct recptypes *valid; namelist *nptr; + char bounce_to[256]; if (sc->num_msgs_spooled < 1) { fclose(sc->digestfp); @@ -527,10 +528,17 @@ void network_deliver_digest(SpoolControl *sc) { strcat(recps, nptr->name); } + /* Where do we want bounces and other noise to be heard? Surely not the list members! */ + snprintf(bounce_to, sizeof bounce_to, "room_aide@%s", config.c_fqdn); + /* Now submit the message */ valid = validate_recipients(recps, NULL, 0); free(recps); - CtdlSubmitMsg(msg, valid, NULL, 0); + if (valid != NULL) { + valid->bounce_to = strdup(bounce_to); + valid->envelope_from = strdup(bounce_to); + CtdlSubmitMsg(msg, valid, NULL, 0); + } CtdlFreeMessage(msg); free_recipients(valid); } @@ -544,6 +552,7 @@ void network_deliver_list(struct CtdlMessage *msg, SpoolControl *sc) { size_t recps_len = SIZ; struct recptypes *valid; namelist *nptr; + char bounce_to[256]; /* Don't do this if there were no recipients! */ if (sc->listrecps == NULL) return; @@ -574,11 +583,18 @@ void network_deliver_list(struct CtdlMessage *msg, SpoolControl *sc) { strcat(recps, nptr->name); } + /* Where do we want bounces and other noise to be heard? Surely not the list members! */ + snprintf(bounce_to, sizeof bounce_to, "room_aide@%s", config.c_fqdn); + /* Now submit the message */ valid = validate_recipients(recps, NULL, 0); free(recps); - CtdlSubmitMsg(msg, valid, NULL, 0); - free_recipients(valid); + if (valid != NULL) { + valid->bounce_to = strdup(bounce_to); + valid->envelope_from = strdup(bounce_to); + CtdlSubmitMsg(msg, valid, NULL, 0); + free_recipients(valid); + } /* Do not call CtdlFreeMessage(msg) here; the caller will free it. */ } -- 2.39.2