From ff2776640a4e85e1ffac9270800a11409c721d5d Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Thu, 5 Jan 2006 21:09:12 +0000 Subject: [PATCH] Implemented configuration settings for journaling. --- citadel/ChangeLog | 3 ++ citadel/config.h | 3 ++ citadel/control.c | 12 +++++ citadel/journaling.c | 2 +- citadel/msgbase.c | 10 +++- citadel/routines2.c | 15 +++++- citadel/techdoc/protocol.txt | 97 +++++++++++++++++++----------------- 7 files changed, 91 insertions(+), 51 deletions(-) diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 3c8e8c884..52da802a2 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -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. diff --git a/citadel/config.h b/citadel/config.h index 7c7cb254f..d6268366c 100644 --- a/citadel/config.h +++ b/citadel/config.h @@ -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 */ }; diff --git a/citadel/control.c b/citadel/control.c index cb3b3f190..6704c3edc 100644 --- a/citadel/control.c +++ b/citadel/control.c @@ -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; } diff --git a/citadel/journaling.c b/citadel/journaling.c index de685b87b..b1af2b9c6 100644 --- a/citadel/journaling.c +++ b/citadel/journaling.c @@ -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) diff --git a/citadel/msgbase.c b/citadel/msgbase.c index 5c832a28d..69d7d2621 100644 --- a/citadel/msgbase.c +++ b/citadel/msgbase.c @@ -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; + } } /* diff --git a/citadel/routines2.c b/citadel/routines2.c index e2d9ee2b5..f20add33f 100644 --- a/citadel/routines2.c +++ b/citadel/routines2.c @@ -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()) { diff --git a/citadel/techdoc/protocol.txt b/citadel/techdoc/protocol.txt index fdc1882e2..516a6158e 100644 --- a/citadel/techdoc/protocol.txt +++ b/citadel/techdoc/protocol.txt @@ -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 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 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 -- 2.30.2