Implemented configuration settings for journaling.
authorArt Cancro <ajc@citadel.org>
Thu, 5 Jan 2006 21:09:12 +0000 (21:09 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 5 Jan 2006 21:09:12 +0000 (21:09 +0000)
citadel/ChangeLog
citadel/config.h
citadel/control.c
citadel/journaling.c
citadel/msgbase.c
citadel/routines2.c
citadel/techdoc/protocol.txt

index 3c8e8c8848824977f2f8c3e0647d04a42cfa7097..52da802a29a38507f10f4b34a91021022c76dbd6 100644 (file)
@@ -1,5 +1,8 @@
 $Id$
 
+Thu Jan  5 16:08:47 EST 2006 ajc
+* Implemented configuration settings for journaling.
+
 Wed Jan  4 22:05:49 EST 2006 ajc
 * Journaling code is finished.  Still needs configuration settings.
 
index 7c7cb254f5a10a111bd06cc8077337198f8c16ad..d6268366c14eb59b377254038f66c6c0b2df0871 100644 (file)
@@ -69,6 +69,9 @@ struct config {
        char c_auto_cull;               /* Cull db logs automatically?      */
        char c_instant_expunge;         /* IMAP instant expunge deleted msgs*/
        char c_allow_spoofing;          /* SMTP allow spoofing of my domains*/
+       char c_journal_email;           /* Perform journaling of email      */
+       char c_journal_pubmsgs;         /* Perform journaling of non-email  */
+       char c_journal_dest[128];       /* Where to send journalized msgs   */
 };
 
 
index cb3b3f190471b1b723333bfa01f1d52a4f50fb89..6704c3edcbb91e91e32d9ef1550cac39936cee08 100644 (file)
@@ -229,6 +229,9 @@ void cmd_conf(char *argbuf)
                cprintf("%d\n", config.c_auto_cull);
                cprintf("%d\n", config.c_instant_expunge);
                cprintf("%d\n", config.c_allow_spoofing);
+               cprintf("%d\n", config.c_journal_email);
+               cprintf("%d\n", config.c_journal_pubmsgs);
+               cprintf("%s\n", config.c_journal_dest);
                cprintf("000\n");
        }
 
@@ -415,6 +418,15 @@ void cmd_conf(char *argbuf)
                        case 45:
                                config.c_allow_spoofing = atoi(buf);
                                break;
+                       case 46:
+                               config.c_journal_email = atoi(buf);
+                               break;
+                       case 47:
+                               config.c_journal_pubmsgs = atoi(buf);
+                               break;
+                       case 48:
+                               safestrncpy(config.c_journal_dest, buf,
+                                               sizeof config.c_journal_dest);
                        }
                        ++a;
                }
index de685b87b3f33139d9432b8b519a4bb7cf9e4f5f..b1af2b9c6d63101052c03d3f95170e4395726c26 100644 (file)
@@ -101,7 +101,7 @@ void JournalRunQueueMsg(struct jnlq *jmsg) {
        static int seq = 0;
        int i;
 
-       journal_recps = validate_recipients("FIXME@example.com");       /* FIXME */
+       journal_recps = validate_recipients(config.c_journal_dest);
        if (journal_recps != NULL) {
 
                if (  (journal_recps->num_local > 0)
index 5c832a28d0d6c15859b272f77bbbd4129e9bea02..69d7d2621049ac1d42deb37f782636e9902d4a0a 100644 (file)
@@ -2472,7 +2472,15 @@ long CtdlSubmitMsg(struct CtdlMessage *msg,      /* message to save */
                qualified_for_journaling = 0;
        }
        else {
-               qualified_for_journaling = 1;   /* FIXME */
+               if (recps == NULL) {
+                       qualified_for_journaling = config.c_journal_pubmsgs;
+               }
+               else if (recps->num_local + recps->num_ignet + recps->num_internet > 0) {
+                       qualified_for_journaling = config.c_journal_email;
+               }
+               else {
+                       qualified_for_journaling = config.c_journal_pubmsgs;
+               }
        }
 
        /*
index e2d9ee2b5bebd3a13ceffd53b467662b704a7839..f20add33f8a18c3f2e24fa83974345c216879f65 100644 (file)
@@ -644,7 +644,7 @@ void read_bio(CtdlIPC *ipc)
 void do_system_configuration(CtdlIPC *ipc)
 {
 
-#define NUM_CONFIGS 46
+#define NUM_CONFIGS 49
 
        char buf[SIZ];
        char sc[NUM_CONFIGS][256];
@@ -682,7 +682,7 @@ void do_system_configuration(CtdlIPC *ipc)
        strprompt("Node name", &sc[0][0], 15);
        strprompt("Fully qualified domain name", &sc[1][0], 63);
        strprompt("Human readable node name", &sc[2][0], 20);
-       strprompt("Modem dialup number", &sc[3][0], 15);
+       strprompt("Telephone number", &sc[3][0], 15);
        strprompt("Geographic location of this system", &sc[12][0], 31);
        strprompt("Name of system administrator", &sc[13][0], 25);
        strprompt("Paginator prompt", &sc[10][0], 79);
@@ -842,6 +842,17 @@ void do_system_configuration(CtdlIPC *ipc)
                "Enable full text search index (warning: resource intensive)",
                atoi(&sc[42][0]))));
 
+       snprintf(sc[46], sizeof sc[46], "%d", (boolprompt(
+               "Perform journaling of email messages",
+               atoi(&sc[46][0]))));
+       snprintf(sc[47], sizeof sc[47], "%d", (boolprompt(
+               "Perform journaling of non-email messages",
+               atoi(&sc[47][0]))));
+       if ( (atoi(&sc[46][0])) || (atoi(&sc[47][0])) ) {
+               strprompt("Email destination of journalized messages",
+                       &sc[48][0], 127);
+       }
+
        /* Save it */
        scr_printf("Save this configuration? ");
        if (yesno()) {
index fdc1882e2959365f40d6f8717984f48c66c989a1..516a6158e80879746965cfd99313360111038608 100644 (file)
@@ -1,5 +1,5 @@
               APPLICATION LAYER PROTOCOL FOR THE CITADEL SYSTEM
-         (c) 1995-2005 by Art Cancro et. al.    All Rights Reserved
+         (c) 1995-2006 by Art Cancro et. al.    All Rights Reserved
 
 
  INTRODUCTION
@@ -1813,52 +1813,55 @@ fails for any reason, ERROR is returned.
 
  The configuration lines are as follows:
 
- 1. Node name
- 2. Fully qualified domain name
- 3. Human-readable node name
- 4. Landline telephone number of this system
- 5. Flag (0 or 1) - creator of private room automatically becomes room aide
- 6. Server connection idle timeout (in seconds)
- 7. Initial access level for new users
- 8. Flag (0 or 1) - require registration for new users
- 9. Flag (0 or 1) - automatically move Problem User messages to twit room
- 10. Name of twit room
- 11. Text of <more> prompt
- 12. Flag (0 or 1) - restrict access to Internet mail
- 13. Geographic location of this system
- 14. Name of the system administrator
- 15. Number of maximum concurrent sessions allowed on the server
- 16. (placeholder -- this field is no longer in use)
- 17. Default purge time (in days) for users
- 18. Default purge time (in days) for rooms
- 19. Name of room to log instant messages to (or a zero-length name for none)
- 20. Access level required to create rooms
- 21. Maximum message length which may be entered into the system
- 22. Minimum number of worker threads
- 23. Maximum number of worker threads
- 24. Port number for POP3 service
- 25. Port number for SMTP service
- 26. Flag (0 or 1) - strict RFC822 adherence - don't correct From: forgeries
- 27. Flag (0 or 1) - allow Aides to zap (forget) rooms
- 28. Port number for IMAP service
- 29. How often (in seconds) to run the networker
- 30. Flag (0 or 1) - disable self-service new user registration
- 31. (placeholder -- this field is no longer in use)
- 32. Hour (0 through 23) during which database auto-purge jobs are run
- 33. Name of host where an LDAP service may be found
- 34. Port number of LDAP service on above host
- 35. LDAP Base DN
- 36. LDAP Bind DN
- 37. Password for LDAP Bind DN
- 38. Server IP address to listen on (or "0.0.0.0" for all addresses)
- 39. Port number for SMTP MSA service
- 40. Port number for IMAPS (SSL-encrypted IMAP)
- 41. Port number for POP3S (SSL-encrypted POP3)
- 42. Port number for SMTPS (SSL-encrypted SMTP)
- 43. Flag (0 or 1) - enable full text search index
- 44. Flag (0 or 1) - automatically cull database log files
- 45. Flag (0 or 1) - enable IMAP "instant expunge" of deleted messages
- 46. Flag (0 or 1) - allow unauthenticated SMTP clients to spoof my domains
+ 0. Node name
+ 1. Fully qualified domain name
+ 2. Human-readable node name
+ 3. Landline telephone number of this system
+ 4. Flag (0 or 1) - creator of private room automatically becomes room aide
+ 5. Server connection idle timeout (in seconds)
+ 6. Initial access level for new users
+ 7. Flag (0 or 1) - require registration for new users
+ 8. Flag (0 or 1) - automatically move Problem User messages to twit room
+ 9. Name of twit room
+ 10. Text of <more> prompt
+ 11. Flag (0 or 1) - restrict access to Internet mail
+ 12. Geographic location of this system
+ 13. Name of the system administrator
+ 14. Number of maximum concurrent sessions allowed on the server
+ 15. (placeholder -- this field is no longer in use)
+ 16. Default purge time (in days) for users
+ 17. Default purge time (in days) for rooms
+ 18. Name of room to log instant messages to (or a zero-length name for none)
+ 19. Access level required to create rooms
+ 20. Maximum message length which may be entered into the system
+ 21. Minimum number of worker threads
+ 22. Maximum number of worker threads
+ 23. Port number for POP3 service
+ 24. Port number for SMTP service
+ 25. Flag (0 or 1) - strict RFC822 adherence - don't correct From: forgeries
+ 26. Flag (0 or 1) - allow Aides to zap (forget) rooms
+ 27. Port number for IMAP service
+ 28. How often (in seconds) to run the networker
+ 29. Flag (0 or 1) - disable self-service new user registration
+ 30. (placeholder -- this field is no longer in use)
+ 31. Hour (0 through 23) during which database auto-purge jobs are run
+ 32. Name of host where an LDAP service may be found
+ 33. Port number of LDAP service on above host
+ 34. LDAP Base DN
+ 35. LDAP Bind DN
+ 36. Password for LDAP Bind DN
+ 37. Server IP address to listen on (or "0.0.0.0" for all addresses)
+ 38. Port number for SMTP MSA service
+ 39. Port number for IMAPS (SSL-encrypted IMAP)
+ 40. Port number for POP3S (SSL-encrypted POP3)
+ 41. Port number for SMTPS (SSL-encrypted SMTP)
+ 42. Flag (0 or 1) - enable full text search index
+ 43. Flag (0 or 1) - automatically cull database log files
+ 44. Flag (0 or 1) - enable IMAP "instant expunge" of deleted messages
+ 45. Flag (0 or 1) - allow unauthenticated SMTP clients to spoof my domains
+ 46. Flag (0 or 1) - perform journaling of email messages
+ 47. Flag (0 or 1) - perform journaling of non-email messages
+ 48. Address to which journalized messages are to be sent
 
  CONF also accepts two additional commands: GETSYS and PUTSYS followed by an
 arbitrary MIME type (such as application/x-citadel-internet-config) which