// This module delivers messages to mailing lists.
//
-// Copyright (c) 2002-2022 by the citadel.org team
+// 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.
#include <string.h>
#include <limits.h>
#include <libcitadel.h>
-#include "../../citadel.h"
+#include "../../citadel_defs.h"
#include "../../server.h"
#include "../../citserver.h"
#include "../../support.h"
// 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, eMsgSubject, buf, strlen(buf));
+ CM_SetField(TheMessage, eMsgSubject, buf);
}
// From: should be set to the list address because doing otherwise makes DKIM parsers angry.
for (ch=buf; *ch; ++ch) {
if (isspace(*ch)) *ch = '_';
}
- CM_SetField(TheMessage, erFc822Addr, buf, strlen(buf));
- CM_SetField(TheMessage, eReplyTo, buf, strlen(buf));
+ CM_SetField(TheMessage, erFc822Addr, buf);
+ CM_SetField(TheMessage, eReplyTo, 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));
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);
}
-// Module entry point
+// Initialization function, called from modules_init.c
char *ctdl_module_init_listdeliver(void) {
if (!threading) {
CtdlRegisterSessionHook(listdeliver_sweep, EVT_TIMER, PRIO_AGGR + 50);
}
// return our module name for the log
- return "listsub";
+ return "listdeliver";
}