// This module delivers messages to mailing lists.
-//
-// Copyright (c) 2002-2024 by the citadel.org team
-//
-// This program is open source software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 3.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
+// Copyright (c) 2002-2024 by the citadel.org team (Art Cancro et al.)
+// This program is open source software. Use, duplication, or disclosure are subject to the GNU General Public License v3.
#include "../../sysdep.h"
#include <stdlib.h>
int doing_listdeliver = 0;
-
// data passed back and forth between listdeliver_do_msg() and listdeliver_sweep_room()
struct lddata {
long msgnum; // number of most recent message processed
};
-
void listdeliver_do_msg(long msgnum, void *userdata) {
struct lddata *ld = (struct lddata *) userdata;
if (!ld) return;
struct CtdlMessage *TheMessage = CtdlFetchMessage(msgnum, 1);
if (!TheMessage) return;
+ // FIXME add the list unsubscribe instructions directly to the message text. Do it right here.
+
// If the subject line does not contain the name of the room, add it now.
if (!bmstrcasestr(TheMessage->cm_fields[eMsgSubject], CC->room.QRname)) {
snprintf(buf, sizeof buf, "[%s] %s", CC->room.QRname, TheMessage->cm_fields[eMsgSubject]);
CM_SetField(TheMessage, erFc822Addr, buf);
CM_SetField(TheMessage, eReplyTo, buf);
+ // To: likewise needs to have something in it, definitely not the name of an actual mailing list member.
+ // Let's use the address and name of the room.
+ strcat(buf, " (");
+ strcat(buf, CC->room.QRname);
+ strcat(buf, " )");
+ CM_SetField(TheMessage, eRecipient, buf);
+
// 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) {