* misc bugfixes and cleanups
authorArt Cancro <ajc@citadel.org>
Thu, 9 Mar 2000 04:35:52 +0000 (04:35 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 9 Mar 2000 04:35:52 +0000 (04:35 +0000)
citadel/citadel.c
citadel/clientsocket.c
citadel/network/mail.sysinfo
citadel/room_ops.c
citadel/serv_smtp.c
citadel/sysconfig.h

index e35044fa57dc28d56b008bdd57bd891b913cc0f6..01bcb05c74a21821cee64fcf17db5494248cc521 100644 (file)
@@ -752,6 +752,7 @@ void who_is_online(int longlist)
        time_t timenow = 0;
        time_t idletime, idlehours, idlemins, idlesecs;
        int last_session = (-1);
+       int linecount = 2;
 
        if (longlist) {
                serv_puts("TIME");
@@ -788,6 +789,7 @@ void who_is_online(int longlist)
                                       fromhost, clientsoft,
                                       (long) idlehours, (long) idlemins, (long) idlesecs);
 
+                               linecount += 3;
                        } else {
                                if (extract_int(buf, 0) == last_session) {
                                        printf("        ");
@@ -806,7 +808,11 @@ void who_is_online(int longlist)
                                color(BRIGHT_CYAN);
                                printf("%-24s\n", fromhost);
                                color(DIM_WHITE);
+                               ++linecount;
                        }
+                       linecount = checkpagin(linecount,
+                                   ((userflags & US_PAGINATOR) ? 1 : 0),
+                                              screenheight);
                }
        }
 }
index c9d40c517aaf56afee3c27b0580a1482c231764c..ba423c4353ad01d91ef9c0bc789d96f42bd3e8c5 100644 (file)
@@ -76,21 +76,11 @@ int sock_connect(char *host, char *service, char *protocol)
                return(-1);
        }
 
-/* FIXME ... the alarm clock is a problem for multithreaded programs because
- * all threads receive the signal.
-       signal(SIGALRM, timeout);
-       alarm(30);
- */
-
        if (connect(s, (struct sockaddr *) &sin, sizeof(sin)) < 0) {
                lprintf(3, "can't connect to %s.%s: %s\n",
                        host, service, strerror(errno));
                return(-1);
        }
-/*
-       alarm(0);
-       signal(SIGALRM, SIG_IGN);
- */
 
        return (s);
 }
index 6f937b7ef6f94991da3026329e9842c80f28ff5a..2e0172179d20376dc17a3c67f43bfb79e42d2751 100644 (file)
@@ -1,84 +1,58 @@
-ctestsys
+future
 use uncnsrd
-phonenum US 612 470 9635
-gdom MN
-humannode C-86 Test System
-lastcontact 952375033 Mon Mar  6 15:37:13 2000
+phonenum netproc[4026]: Adding non-neighbor system <catchat> to map
+gdom or system <catchat> to map
+humannode The Future BBS
+lastcontact 952138911 Fri Mar  3 22:01:51 2000
 
-bccs
+catchat
 use uncnsrd
-phonenum netproc[7145]: Adding non-neighbor system <internet> to map
-gdom or system <internet> to map
-humannode BCCS
-lastcontact 952418225 Tue Mar  7 03:37:05 2000
-
-internet
-uum %s
-humannode Internet Gateway
-lastcontact 952485943 Tue Mar  7 22:25:43 2000
-
-uncnsrd
-bin Mail
-phonenum US 914 244 3252
-humannode Uncensored
-lastcontact 952485944 Tue Mar  7 22:25:44 2000
-
-test
-bin Mail
-
-tux
-bin Mail
-phonenum US 800 555 1212
-humannode My System
-lastcontact 951540103 Fri Feb 25 23:41:43 2000
-
-tesseract
-bin Mail
-phonenum US 800 555 1212
-humannode Tesseract Project
-lastcontact 952468624 Tue Mar  7 17:37:04 2000
+phonenum netproc[4026]: Adding non-neighbor system <rundale> to map
+gdom or system <rundale> to map
+humannode 'Cat Chat
+lastcontact 952138915 Fri Mar  3 22:01:55 2000
 
-pixel
+rundale
 use uncnsrd
-phonenum netproc[4026]: Adding non-neighbor system <tesseract> to map
-gdom or system <tesseract> to map
-humannode PixelBBS
-lastcontact 952454224 Tue Mar  7 13:37:04 2000
+phonenum US 609 854 9135
+gdom NJ
+humannode Rundale
+lastcontact 952138909 Fri Mar  3 22:01:49 2000
 
-barbaria
+jacs
 use uncnsrd
-phonenum netproc[4026]: Adding non-neighbor system <pixel> to map
-gdom or system <pixel> to map
-humannode Barbaria
-lastcontact 952138915 Fri Mar  3 22:01:55 2000
+phonenum US6093461224
+gdom NJ
+humannode JACS
+lastcontact 952138912 Fri Mar  3 22:01:52 2000
 
-haven
+dogpound2
 use uncnsrd
-phonenum netproc[4026]: Adding non-neighbor system <barbaria> to map
-gdom or system <barbaria> to map
-humannode Haven BBS
-lastcontact 952138910 Fri Mar  3 22:01:50 2000
+phonenum netproc[4026]: Adding non-neighbor system <sbn> to map
+gdom or system <sbn> to map
+humannode Dog Pound BBS II
+lastcontact 952349824 Mon Mar  6 08:37:04 2000
 
-mnmensa
+sbn
 use uncnsrd
-phonenum US (612) 757-7307
-gdom MN
-humannode MN-Mensa
-lastcontact 952138905 Fri Mar  3 22:01:45 2000
+phonenum netproc[4026]: Adding non-neighbor system <feathers> to map
+gdom or system <feathers> to map
+humannode Super BBS Network
+lastcontact 952138908 Fri Mar  3 22:01:48 2000
 
-cbbs
+feathers
 use uncnsrd
-phonenum US (513) 939 1645
-gdom Cinci
-humannode The CBBS
-lastcontact 952138903 Fri Mar  3 22:01:43 2000
+phonenum CA (604) 589-8539
+gdom BC
+humannode Feathers & Furballs
+lastcontact 952138915 Fri Mar  3 22:01:55 2000
 
-amigazon
+charis
 use uncnsrd
-phonenum US (609) 953 8159
-gdom NJ
-humannode The Amiga Zone
-lastcontact 952138913 Fri Mar  3 22:01:53 2000
+phonenum netproc[4026]: Adding non-neighbor system <gateway> to map
+gdom or system <gateway> to map
+humannode MascotSpeak
+lastcontact 952138904 Fri Mar  3 22:01:44 2000
 
 gateway
 use uncnsrd
@@ -87,59 +61,85 @@ gdom NJ
 humannode Gateway
 lastcontact 952138913 Fri Mar  3 22:01:53 2000
 
-charis
+amigazon
 use uncnsrd
-phonenum netproc[4026]: Adding non-neighbor system <gateway> to map
-gdom or system <gateway> to map
-humannode MascotSpeak
-lastcontact 952138904 Fri Mar  3 22:01:44 2000
+phonenum US (609) 953 8159
+gdom NJ
+humannode The Amiga Zone
+lastcontact 952138913 Fri Mar  3 22:01:53 2000
 
-feathers
+cbbs
 use uncnsrd
-phonenum CA (604) 589-8539
-gdom BC
-humannode Feathers & Furballs
-lastcontact 952138915 Fri Mar  3 22:01:55 2000
+phonenum US (513) 939 1645
+gdom Cinci
+humannode The CBBS
+lastcontact 952138903 Fri Mar  3 22:01:43 2000
 
-sbn
+mnmensa
 use uncnsrd
-phonenum netproc[4026]: Adding non-neighbor system <feathers> to map
-gdom or system <feathers> to map
-humannode Super BBS Network
-lastcontact 952138908 Fri Mar  3 22:01:48 2000
+phonenum US (612) 757-7307
+gdom MN
+humannode MN-Mensa
+lastcontact 952138905 Fri Mar  3 22:01:45 2000
 
-dogpound2
+haven
 use uncnsrd
-phonenum netproc[4026]: Adding non-neighbor system <sbn> to map
-gdom or system <sbn> to map
-humannode Dog Pound BBS II
-lastcontact 952349824 Mon Mar  6 08:37:04 2000
+phonenum netproc[4026]: Adding non-neighbor system <barbaria> to map
+gdom or system <barbaria> to map
+humannode Haven BBS
+lastcontact 952138910 Fri Mar  3 22:01:50 2000
 
-jacs
+barbaria
 use uncnsrd
-phonenum US6093461224
-gdom NJ
-humannode JACS
-lastcontact 952138912 Fri Mar  3 22:01:52 2000
+phonenum netproc[4026]: Adding non-neighbor system <pixel> to map
+gdom or system <pixel> to map
+humannode Barbaria
+lastcontact 952138915 Fri Mar  3 22:01:55 2000
 
-rundale
+pixel
 use uncnsrd
-phonenum US 609 854 9135
-gdom NJ
-humannode Rundale
-lastcontact 952138909 Fri Mar  3 22:01:49 2000
+phonenum netproc[4026]: Adding non-neighbor system <tesseract> to map
+gdom or system <tesseract> to map
+humannode PixelBBS
+lastcontact 952573025 Wed Mar  8 22:37:05 2000
 
-catchat
+tesseract
+bin Mail
+phonenum US 800 555 1212
+humannode Tesseract Project
+lastcontact 952573026 Wed Mar  8 22:37:06 2000
+
+tux
+bin Mail
+phonenum US 800 555 1212
+humannode My System
+lastcontact 951540103 Fri Feb 25 23:41:43 2000
+
+test
+bin Mail
+
+uncnsrd
+bin Mail
+phonenum US 914 244 3252
+humannode Uncensored
+lastcontact 952565824 Wed Mar  8 20:37:04 2000
+
+internet
+uum %s
+humannode Internet Gateway
+lastcontact 952573026 Wed Mar  8 22:37:06 2000
+
+bccs
 use uncnsrd
-phonenum netproc[4026]: Adding non-neighbor system <rundale> to map
-gdom or system <rundale> to map
-humannode 'Cat Chat
-lastcontact 952138915 Fri Mar  3 22:01:55 2000
+phonenum netproc[7145]: Adding non-neighbor system <internet> to map
+gdom or system <internet> to map
+humannode BCCS
+lastcontact 952569423 Wed Mar  8 21:37:03 2000
 
-future
+ctestsys
 use uncnsrd
-phonenum netproc[4026]: Adding non-neighbor system <catchat> to map
-gdom or system <catchat> to map
-humannode The Future BBS
-lastcontact 952138911 Fri Mar  3 22:01:51 2000
+phonenum US 612 470 9635
+gdom MN
+humannode C-86 Test System
+lastcontact 952375033 Mon Mar  6 15:37:13 2000
 
index d512f539aa0eea626e73f8e55e614fc954c4631f..12c74727f1a984562c3d539a80723441c3de5552 100644 (file)
@@ -316,15 +316,21 @@ void ForEachRoom(void (*CallBack) (struct quickroom *EachRoom, void *out_data),
 
 /*
  * delete_msglist()  -  delete room message pointers
- * FIXME - this really should check first to make sure there's actually a
- *       msglist to delete.  As things stand now, calling this function on
- *       a room which has never been posted in will result in a message
- *       like "gdbm: illegal data" (no big deal, but could use fixing).
  */
 void delete_msglist(struct quickroom *whichroom)
 {
+        struct cdbdata *cdbml;
 
-       cdb_delete(CDB_MSGLISTS, &whichroom->QRnumber, sizeof(long));
+       /* Make sure the msglist we're deleting actually exists, otherwise
+        * gdbm will complain when we try to delete an invalid record
+        */
+        cdbml = cdb_fetch(CDB_MSGLISTS, &whichroom->QRnumber, sizeof(long));
+        if (cdbml != NULL) {
+               cdb_free(cdbml);
+
+               /* Go ahead and delete it */
+               cdb_delete(CDB_MSGLISTS, &whichroom->QRnumber, sizeof(long));
+       }
 }
 
 
index b9457afe171e61c83f769afd60186c4f0b996e85..99504c5842276e3a5866bad4ad115bf4b0d33627 100644 (file)
@@ -44,6 +44,7 @@ struct citsmtp {              /* Information about the current session */
        char from[256];
        int number_of_recipients;
        int delivery_mode;
+       int message_originated_locally;
 };
 
 enum {                         /* Command states for login authentication */
@@ -325,6 +326,9 @@ void smtp_mail(char *argbuf) {
                        strcpy(SMTP->from, "");
                        return;
                }
+               else {
+                       SMTP->message_originated_locally = 1;
+               }
        }
 
        /* Otherwise, make sure outsiders aren't trying to forge mail from
@@ -341,7 +345,7 @@ void smtp_mail(char *argbuf) {
                }
        }
 
-       cprintf("250 Sender ok.  Groovy.\r\n");
+       cprintf("250 Sender ok\r\n");
 }
 
 
@@ -354,10 +358,9 @@ void smtp_rcpt(char *argbuf) {
        char user[256];
        char node[256];
        char recp[256];
-       int is_spam = 0;        /* FIXME implement anti-spamming */
 
        if (strlen(SMTP->from) == 0) {
-               cprintf("503 MAIL first, then RCPT.  Duh.\r\n");
+               cprintf("503 Need MAIL before RCPT\r\n");
                return;
        }
 
@@ -412,8 +415,8 @@ void smtp_rcpt(char *argbuf) {
                        return;
 
                case rfc822_address_nonlocal:
-                       if (is_spam) {
-                               cprintf("551 Away with thee, spammer!\r\n");
+                       if (SMTP->message_originated_locally == 0) {
+                               cprintf("551 Relaying denied\r\n");
                        }
                        else {
                                cprintf("250 Remote recipient %s ok\r\n", recp);
index 98095fa70ca4bee5819af0da813a26f79c35b9a0..6a772177aaf03c4f6b8ba9ea32e0a110b97bb006 100644 (file)
 
 /*
  * SMTP delivery retry and give-up times
- * FIXME ... put this in a programmable config somewhere
  */
 #define        SMTP_RETRY_INTERVAL     900     /* retry sends every 15 minutes */
-#define SMTP_GIVE_UP           259200  /* give up after 3 days */
+#define SMTP_GIVE_UP           432000  /* give up after 5 days */
 
 
 /*