* Began implementing "digest mode" for listserving. (Not complete)
authorArt Cancro <ajc@citadel.org>
Wed, 31 Jul 2002 04:01:57 +0000 (04:01 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 31 Jul 2002 04:01:57 +0000 (04:01 +0000)
citadel/ChangeLog
citadel/serv_network.c
citadel/serv_network.h
citadel/techdoc/netconfigs.txt

index 9b625a96c75b42997ed3e701d559eba62a853b0f..6b2f269f0ad27b760fd6972698cc89faa4191ac6 100644 (file)
@@ -1,4 +1,7 @@
  $Log$
+ Revision 591.75  2002/07/31 04:01:57  ajc
+ * Began implementing "digest mode" for listserving.  (Not complete)
+
  Revision 591.74  2002/07/28 20:33:13  ajc
  * Augmented the "headers only" functionality of the message reading API (as
    well as the options of the server commands which expose it) to allow
@@ -3842,3 +3845,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import
+
index ae15d83246afbd9678e7dc46c08797ecc1ee0b68..47b957f4fd925b32ef5ec1af8c5fde61abddd74a 100644 (file)
@@ -452,6 +452,18 @@ void network_spool_msg(long msgnum, void *userdata) {
                CtdlSubmitMsg(imsg, NULL, SMTP_SPOOLOUT_ROOM);
                CtdlFreeMessage(imsg);
        }
+
+       /*
+        * Process digest recipients
+        */
+       if ((sc->digestrecps != NULL) && (sc->digestfp != NULL)) {
+               fprintf(sc->digestfp,   " -----------------------------------"
+                                       "------------------------------------"
+                                       "-------\r\n");
+               CtdlRedirectOutput(sc->digestfp, -1);
+               CtdlOutputMsg(msgnum, MT_RFC822, HEADERS_ALL, 0, 1);
+               CtdlRedirectOutput(NULL, -1);
+       }
        
        /*
         * Process IGnet push shares
@@ -565,7 +577,6 @@ void network_spoolout_room(char *room_to_spool) {
        char instr[SIZ];
        FILE *fp;
        struct SpoolControl sc;
-       /* struct namelist *digestrecps = NULL; */
        struct namelist *nptr;
 
        lprintf(7, "Spooling <%s>\n", room_to_spool);
@@ -601,6 +612,13 @@ void network_spoolout_room(char *room_to_spool) {
                        extract(nptr->name, buf, 1);
                        sc.listrecps = nptr;
                }
+               else if (!strcasecmp(instr, "digestrecp")) {
+                       nptr = (struct namelist *)
+                               mallok(sizeof(struct namelist));
+                       nptr->next = sc.digestrecps;
+                       extract(nptr->name, buf, 1);
+                       sc.digestrecps = nptr;
+               }
                else if (!strcasecmp(instr, "ignet_push_share")) {
                        nptr = (struct namelist *)
                                mallok(sizeof(struct namelist));
@@ -613,11 +631,23 @@ void network_spoolout_room(char *room_to_spool) {
        }
        fclose(fp);
 
+       /* If there are digest recipients, we have to build a digest */
+       if (sc.digestrecps != NULL) {
+               sc.digestfp = tmpfile();
+       }
 
        /* Do something useful */
        CtdlForEachMessage(MSGS_GT, sc.lastsent, NULL, NULL,
                network_spool_msg, &sc);
 
+       /* If we wrote a digest, deliver it and then close it */
+       if (sc.digestfp != NULL) {
+               fprintf(sc->digestfp,   " -----------------------------------"
+                                       "------------------------------------"
+                                       "-------\r\n");
+               /* FIXME deliver it! */
+               fclose(sc.digestfp);
+       }
 
        /* Now rewrite the config file */
        fp = fopen(filename, "w");
@@ -637,6 +667,13 @@ void network_spoolout_room(char *room_to_spool) {
                        phree(sc.listrecps);
                        sc.listrecps = nptr;
                }
+               /* Do the same for digestrecps */
+               while (sc.digestrecps != NULL) {
+                       fprintf(fp, "digestrecp|%s\n", sc.digestrecps->name);
+                       nptr = sc.digestrecps->next;
+                       phree(sc.digestrecps);
+                       sc.digestrecps = nptr;
+               }
                while (sc.ignet_push_shares != NULL) {
                        fprintf(fp, "ignet_push_share|%s\n",
                                sc.ignet_push_shares->name);
index 9ff68ea97655fb35a86e011b6154b902c127d341..d9e56a0dae074cbdc680c611ee2393aadeb3f313 100644 (file)
@@ -6,7 +6,9 @@ struct namelist {
 struct SpoolControl {
        long lastsent;
        struct namelist *listrecps;
+       struct namelist *digestrecps;
        struct namelist *ignet_push_shares;
+       FILE *digestfp;
 };
 
 struct NetMap {
index e555b6d23d4e4ed4bd75423a56d511e211687f81..08206d4552a2ee0454761bbe8cdf14f2211cfa7b 100644 (file)
@@ -28,6 +28,16 @@ out messages should do stuff.
 is used for "list serve" applications.
  
  
+ INSTRUCTION:  digestrecp
+ SYNTAX:       digestrecp|friko@mumjiboolean.com
+ DESCRIPTION:
+    Defines a recipient to whom all messages in this room should be sent.  This
+is used for "list serve" applications.  The difference between listrecps and
+digestrecps is that the latter will have messages embedded inside a message
+sent by the listserver.  The message will appear to be sent by the room's
+e-mail address instead of the sender's e-mail address.
  INSTRUCTION:  ignet_push_share
  SYNTAX:       ignet_push_share|uncnsrd
  DESCRIPTION: