#!/bin/bash
-
# This script dumps the database, deletes the database, loads the database, dumps it again...
# ...and then compares the two dumps to see if we have full fidelity between them.
#
exit 1
}
+echo
+echo
+
./ctdldump -y >dump.dat
first=$(md5sum dump.dat | awk ' { print $1 } ' )
+echo MD5 of initial dump: ${first}
+
rm -fv data/*
./ctdlload -y <dump.dat
./ctdldump -y >dump.dat
second=$(md5sum dump.dat | awk ' { print $1 } ' )
-echo
-echo
-echo MD5 of initial dump: ${first}
echo MD5 of sequent dump: ${second}
echo
if [ ${first} == ${second} ] ; then
// Autocompletion of email recipients, etc.
-//
// Copyright (c) 1987-2023 by the citadel.org team
-//
-// This program is open source software. Use, duplication, or disclosure
-// is subject to the terms of the GNU General Public License version 3.
+// This program is open source software. Use, duplication, or disclosure is subject to the GNU General Public License version 3.
#include "../../ctdl_module.h"
#include "serv_autocompletion.h"
//
// Copyright (c) 1987-2022 by the citadel.org team
//
-// This program is open source software. Use, duplication, or disclosure
-// is subject to the terms of the GNU General Public License, version 3.
-// The program is distributed without any warranty, expressed or implied.
+// This program is open source software. Use, duplication, or disclosure is subject to the GNU General Public License, version 3.
#include <sys/types.h>
#include <sys/stat.h>
// 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) {
char unsubscribe_url[SIZ];
snprintf(base_url, sizeof base_url, "https://%s/listsub", CtdlGetConfigStr("c_fqdn"));
generate_one_click_url(unsubscribe_url, base_url, "unsubscribe", source_room, recp);
- cprintf("List-Unsubscribe: %s\r\n", unsubscribe_url);
+ cprintf("List-Unsubscribe: <%s>\r\n", unsubscribe_url); // RFC 2369
cprintf("List-Unsubscribe-Post: List-Unsubscribe=One-Click\r\n"); // RFC 8058
-
}
CtdlOutputMsg(msgid, MT_RFC822, HEADERS_ALL, 0, 1, NULL, 0, NULL, &fromaddr, NULL);
s.TheMessage = CC->redirect_buffer;
CC->redirect_buffer = NULL;
- syslog(LOG_DEBUG, "fromaddr=<%s>",fromaddr);
// If we have a DKIM key, try to sign the message.
char *dkim_private_key = CtdlGetConfigStr("dkim_private_key");