// Message journaling functions.
//
-// Copyright (c) 1987-2023 by the citadel.org team
+// Copyright (c) 1987-2024 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.
struct jnlq *jnlq = NULL; // journal queue
-/*
- * Hand off a copy of a message to be journalized.
- */
-void JournalBackgroundSubmit(struct CtdlMessage *msg,
- StrBuf *saved_rfc822_version,
- struct recptypes *recps) {
-
+// Hand off a copy of a message to be journalized.
+void JournalBackgroundSubmit(struct CtdlMessage *msg, StrBuf *saved_rfc822_version, struct recptypes *recps) {
struct jnlq *jptr = NULL;
- /* Avoid double journaling! */
+ // Avoid double journaling!
if (!CM_IsEmpty(msg, eJournal)) {
FreeStrBuf(&saved_rfc822_version);
return;
if (!CM_IsEmpty(msg, emessageId)) jptr->msgn = strdup(msg->cm_fields[emessageId]);
jptr->rfc822 = SmashStrBuf(&saved_rfc822_version);
- /* Add to the queue */
+ // Add to the queue
begin_critical_section(S_JOURNAL_QUEUE);
jptr->next = jnlq;
jnlq = jptr;
}
-/*
- * Convert a local user name to an internet email address for the journal
- * FIXME - grab the user's Internet email address from the user record, not from vCard !!!!
- */
+// Convert a local user name to an internet email address for the journal
+// FIXME - grab the user's Internet email address from the user record, not from vCard !!!!
void local_to_inetemail(char *inetemail, char *localuser, size_t inetemail_len) {
struct ctdluser us;
struct vCard *v;
}
-/*
- * Called by JournalRunQueue() to send an individual message.
- */
+// Called by JournalRunQueue() to send an individual message.
void JournalRunQueueMsg(struct jnlq *jmsg) {
struct CtdlMessage *journal_msg = NULL;
|| (journal_recps->num_internet > 0)
|| (journal_recps->num_room > 0)
) {
-
- /*
- * Construct journal message.
- * Note that we are transferring ownership of some of the memory here.
- */
+ // Construct journal message.
+ // Note that we are transferring ownership of some of the memory here.
journal_msg = malloc(sizeof(struct CtdlMessage));
memset(journal_msg, 0, sizeof(struct CtdlMessage));
journal_msg->cm_magic = CTDLMESSAGE_MAGIC;
message_text = NewStrBufPlain(NULL, rfc822len + sizeof(struct recptypes) + 1024);
- /*
- * Here is where we begin to compose the journalized message.
- * (The "ExJournalReport" header is consumed by some email retention services which assume the journaling agent is Exchange.)
- */
+ // Here is where we begin to compose the journalized message.
+ // (The "ExJournalReport" header is consumed by some email retention services which assume the journaling agent is Exchange.)
StrBufAppendBufPlain(
message_text,
HKEY("Content-type: multipart/mixed; boundary=\""),
StrBufAppendBufPlain(message_text, mime_boundary, mblen, 0);
StrBufAppendBufPlain(message_text, HKEY("--\r\n"), 0);
- CM_SetAsFieldSB(journal_msg, eMesageText, &message_text);
+ CM_SetAsFieldSB(journal_msg, eMessageText, &message_text);
free(jmsg->rfc822);
free(jmsg->msgn);
jmsg->rfc822 = NULL;
jmsg->msgn = NULL;
- /* Submit journal message */
+ // Submit journal message
CtdlSubmitMsg(journal_msg, journal_recps, "");
CM_Free(journal_msg);
}
free_recipients(journal_recps);
}
- /* We are responsible for freeing this memory. */
+ // We are responsible for freeing this memory.
free(jmsg);
}
-/*
- * Run the queue.
- */
+// Run the queue.
void JournalRunQueue(void) {
struct jnlq *jptr = NULL;