X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fserver%2Fmodules%2Flistdeliver%2Fserv_listdeliver.c;h=fd1356079f104eaa907075af27275336949b8442;hb=refs%2Fheads%2Fmaster;hp=aff0453bb63b8f8392d0697f5e00a626ce1bc4e7;hpb=ea488d0875ba18ad5a86e95c9a46be9024fadb02;p=citadel.git diff --git a/citadel/server/modules/listdeliver/serv_listdeliver.c b/citadel/server/modules/listdeliver/serv_listdeliver.c index aff0453bb..a6cb74ad4 100644 --- a/citadel/server/modules/listdeliver/serv_listdeliver.c +++ b/citadel/server/modules/listdeliver/serv_listdeliver.c @@ -1,14 +1,6 @@ // This module delivers messages to mailing lists. -// -// Copyright (c) 2002-2023 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 @@ -40,7 +32,6 @@ 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 @@ -48,7 +39,6 @@ struct lddata { }; - void listdeliver_do_msg(long msgnum, void *userdata) { struct lddata *ld = (struct lddata *) userdata; if (!ld) return; @@ -63,6 +53,8 @@ void listdeliver_do_msg(long msgnum, void *userdata) { 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]); @@ -78,6 +70,13 @@ void listdeliver_do_msg(long msgnum, void *userdata) { 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) { @@ -104,7 +103,7 @@ void listdeliver_do_msg(long msgnum, void *userdata) { snprintf(bounce_to, sizeof bounce_to, "room_aide@%s", CtdlGetConfigStr("c_fqdn")); // Now submit the message - struct recptypes *valid = validate_recipients(recipients, NULL, 0); + struct recptypes *valid = validate_recipients(recipients, 0); if (valid) { valid->bounce_to = strdup(bounce_to); valid->envelope_from = strdup(bounce_to); @@ -245,5 +244,5 @@ char *ctdl_module_init_listdeliver(void) { } // return our module name for the log - return "listsub"; + return "listdeliver"; }