- 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)) || (!strncasecmp(buf, "digestrecp|", 11)) ) {
- syslog(LOG_DEBUG, "\033[32mDeliver %ld to %s\033[0m", msgnum, buf);
- // FIXME
+
+
+
+
+ // With that out of the way, let's figure out who this message needs to be sent to.
+ 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]);
+ }
+ }
+ struct recptypes *valid = validate_recipients(recipients, NULL, 0);
+ if (valid) {
+ long new_msgnum = CtdlSubmitMsg(TheMessage, valid, "");
+ syslog(LOG_DEBUG, "listdeliver: original message <%ld> is now <%ld> outgoing to the list", msgnum, new_msgnum);
+ free_recipients(valid);