]> code.citadel.org Git - citadel.git/commitdiff
* Hide the SMTP queue and the sysconfig rooms.
authorArt Cancro <ajc@citadel.org>
Sun, 25 Aug 2002 21:23:49 +0000 (21:23 +0000)
committerArt Cancro <ajc@citadel.org>
Sun, 25 Aug 2002 21:23:49 +0000 (21:23 +0000)
citadel/ChangeLog
citadel/citserver.c
citadel/serv_smtp.c
citadel/user_ops.c

index 1e9ac65e4f929d5349f5b1d0a5ed0148586c65c9..30457874facfc6c6d592638f2c78013b5722f1bf 100644 (file)
@@ -1,4 +1,7 @@
  $Log$
+ Revision 591.101  2002/08/25 21:23:49  ajc
+ * Hide the SMTP queue and the sysconfig rooms.
+
  Revision 591.100  2002/08/24 05:58:53  ajc
  * Bugfixes and cosmetic changes to listsub system
 
@@ -3932,3 +3935,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 2e47ffc8504e64ab0165795feb499442f5fbc6ee..04562d1aac24f30ef13c6203ce1b7691c1b85a5a 100644 (file)
@@ -72,10 +72,11 @@ time_t server_startup_time;
  */
 void master_startup(void) {
        struct timeval tv;
-       
-       time(&server_startup_time);
+       struct quickroom qrbuf;
        
        lprintf(9, "master_startup() started\n");
+       time(&server_startup_time);
+
        lprintf(7, "Opening databases\n");
        open_databases();
 
@@ -91,6 +92,13 @@ void master_startup(void) {
        create_room(SYSCONFIGROOM,      3, "", 0, 1, 0);
        create_room(config.c_twitroom,  0, "", 0, 1, 0);
 
+       /* The "Local System Configuration" room doesn't need to be visible */
+        if (lgetroom(&qrbuf, SYSCONFIGROOM) == 0) {
+                qrbuf.QRflags2 |= QR2_SYSTEM;
+                lputroom(&qrbuf);
+        }
+
+
        lprintf(7, "Seeding the pseudo-random number generator...\n");
        gettimeofday(&tv, NULL);
        srand(tv.tv_usec);
index 953f0b0de71f8212b50eed075bcc7879278ae057..8588d59ce256da363edeafa60ad4265113fa8cbe 100644 (file)
@@ -1363,6 +1363,29 @@ void cmd_smtp(char *argbuf) {
 }
 
 
+/*
+ * Initialize the SMTP outbound queue
+ */
+void smtp_init_spoolout(void) {
+       struct quickroom qrbuf;
+
+       /*
+        * Create the room.  This will silently fail if the room already
+        * exists, and that's perfectly ok, because we want it to exist.
+        */
+       create_room(SMTP_SPOOLOUT_ROOM, 3, "", 0, 1, 0);
+
+       /*
+        * Make sure it's set to be a "system room" so it doesn't show up
+        * in the <K>nown rooms list for Aides.
+        */
+       if (lgetroom(&qrbuf, SMTP_SPOOLOUT_ROOM) == 0) {
+               qrbuf.QRflags2 |= QR2_SYSTEM;
+               lputroom(&qrbuf);
+       }
+}
+
+
 
 
 /*****************************************************************************/
@@ -1384,7 +1407,7 @@ char *Dynamic_Module_Init(void)
                                smtp_greeting,
                                smtp_command_loop);
 
-       create_room(SMTP_SPOOLOUT_ROOM, 3, "", 0, 1, 0);
+       smtp_init_spoolout();
        CtdlRegisterSessionHook(smtp_do_queue, EVT_TIMER);
        CtdlRegisterProtoHook(cmd_smtp, "SMTP", "SMTP utility commands");
        return "$Id$";
index 7b16a062b9e66518801f3f1a209f85c6abeb9d26..5654987d9d756cb37fc03e9af6acfcaf34a0a3e5 100644 (file)
@@ -682,6 +682,7 @@ int purge_user(char pname[])
 int create_user(char *newusername, int become_user)
 {
        struct usersupp usbuf;
+       struct quickroom qrbuf;
        struct passwd *p = NULL;
        char username[SIZ];
        char mailboxname[ROOMNAMELEN];
@@ -731,11 +732,19 @@ int create_user(char *newusername, int become_user)
        /* add user to userlog */
        putuser(&usbuf);
 
-       /* give the user a private mailbox and a configuration room */
+       /*
+        * Give the user a private mailbox and a configuration room.
+        * Make the latter an invisible system room.
+        */
        MailboxName(mailboxname, sizeof mailboxname, &usbuf, MAILROOM);
        create_room(mailboxname, 5, "", 0, 1, 1);
+
        MailboxName(mailboxname, sizeof mailboxname, &usbuf, USERCONFIGROOM);
        create_room(mailboxname, 5, "", 0, 1, 1);
+        if (lgetroom(&qrbuf, USERCONFIGROOM) == 0) {
+                qrbuf.QRflags2 |= QR2_SYSTEM;
+                lputroom(&qrbuf);
+        }
 
        /* Everything below this line can be bypassed if administratively
           creating a user, instead of doing self-service account creation