+
+
+void listdeliver_do_msg(long msgnum, void *userdata) {
+ struct lddata *ld = (struct lddata *) userdata;
+ if (!ld) return;
+ char buf[SIZ];
+
+ ld->msgnum = msgnum;
+ if (msgnum <= 0) return;
+
+ struct CtdlMessage *TheMessage = CtdlFetchMessage(msgnum, 1);
+ if (!TheMessage) return;
+
+
+
+ // FIXME munge the headers so it looks like it came from a mailing list
+
+
+
+ char *recipients = malloc(strlen(ld->netconf));
+ if (recipients) {
+ recipients[0] = 0;
+
+ int config_lines = num_tokens(ld->netconf, '\n');
+ for (int i=0; i<config_lines; ++i) {
+ extract_token(buf, ld->netconf, i, '\n', sizeof buf);
+ if (!strncasecmp(buf, "listrecp|", 9)) {
+ if (recipients[0] != 0) {
+ strcat(recipients, ",");
+ }
+ strcat(recipients, &buf[9]);
+ }
+ if (!strncasecmp(buf, "digestrecp|", 11)) {
+ if (recipients[0] != 0) {
+ strcat(recipients, ",");
+ }
+ strcat(recipients, &buf[11]);
+ }
+ }
+ syslog(LOG_DEBUG, "\033[33m%s\033[0m", recipients);
+ struct recptypes *valid = validate_recipients(recipients, NULL, 0);
+ if (valid) {
+ long new_msgnum = CtdlSubmitMsg(TheMessage, valid, "");
+ free_recipients(valid);
+ }
+ }
+ CM_Free(TheMessage);
+}
+
+
+/*
+ * Sweep through one room looking for mailing list deliveries to do
+ */
+void listdeliver_sweep_room(char *roomname) {
+ char *netconfig = NULL;
+ char *newnetconfig = NULL;