+void network_process_digest(SpoolControl *sc, struct CtdlMessage *omsg, long *delete_after_send)
+{
+
+ struct CtdlMessage *msg = NULL;
+
+ /*
+ * Process digest recipients
+ */
+ if ((sc->Users[digestrecp] == NULL)||
+ (sc->digestfp == NULL))
+ return;
+
+ msg = CtdlDuplicateMessage(omsg);
+ if (msg != NULL) {
+ fprintf(sc->digestfp,
+ " -----------------------------------"
+ "------------------------------------"
+ "-------\n");
+ fprintf(sc->digestfp, "From: ");
+ if (msg->cm_fields['A'] != NULL) {
+ fprintf(sc->digestfp,
+ "%s ",
+ msg->cm_fields['A']);
+ }
+ if (msg->cm_fields['F'] != NULL) {
+ fprintf(sc->digestfp,
+ "<%s> ",
+ msg->cm_fields['F']);
+ }
+ else if (msg->cm_fields['N'] != NULL) {
+ fprintf(sc->digestfp,
+ "@%s ",
+ msg->cm_fields['N']);
+ }
+ fprintf(sc->digestfp, "\n");
+ if (msg->cm_fields['U'] != NULL) {
+ fprintf(sc->digestfp,
+ "Subject: %s\n",
+ msg->cm_fields['U']);
+ }
+
+ CC->redirect_buffer = NewStrBufPlain(NULL, SIZ);
+
+ safestrncpy(CC->preferred_formats,
+ "text/plain",
+ sizeof CC->preferred_formats);
+
+ CtdlOutputPreLoadedMsg(msg,
+ MT_CITADEL,
+ HEADERS_NONE,
+ 0, 0, 0);
+
+ StrBufTrim(CC->redirect_buffer);
+ fwrite(HKEY("\n"), 1, sc->digestfp);
+ fwrite(SKEY(CC->redirect_buffer), 1, sc->digestfp);
+ fwrite(HKEY("\n"), 1, sc->digestfp);
+
+ FreeStrBuf(&CC->redirect_buffer);
+
+ sc->num_msgs_spooled += 1;
+ CtdlFreeMessage(msg);
+ }
+}
+
+
+void network_process_list(SpoolControl *sc, struct CtdlMessage *omsg, long *delete_after_send)
+{
+ struct CtdlMessage *msg = NULL;
+
+ /*
+ * Process mailing list recipients
+ */
+ if (sc->Users[listrecp] == NULL)
+ return;
+
+ /* create our own copy of the message.
+ * We're going to need to modify it
+ * in order to insert the [list name] in it, etc.
+ */
+
+ msg = CtdlDuplicateMessage(omsg);
+
+
+ CtdlMsgSetCM_Fields(msg, 'K', SKEY(sc->Users[roommailalias]));
+
+ /* if there is no other recipient, Set the recipient
+ * of the list message to the email address of the
+ * room itself.
+ */
+ if ((msg->cm_fields['R'] == NULL) ||
+ IsEmptyStr(msg->cm_fields['R']))
+ {
+ CtdlMsgSetCM_Fields(msg, 'R', SKEY(sc->Users[roommailalias]));
+ }
+
+ /* Set the 'List-ID' header */
+ CtdlMsgSetCM_Fields(msg, 'L', SKEY(sc->ListID));
+
+
+ /* Prepend "[List name]" to the subject */
+ ListCalculateSubject(msg);
+
+ /* Handle delivery */
+ network_deliver_list(msg, sc, CC->room.QRname);
+ CtdlFreeMessage(msg);
+}
+