From ed49e08b4184495f51ed74013bfff126d4cbec1a Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Thu, 9 Mar 2000 04:35:52 +0000 Subject: [PATCH] * misc bugfixes and cleanups --- citadel/citadel.c | 6 + citadel/clientsocket.c | 10 -- citadel/network/mail.sysinfo | 212 +++++++++++++++++------------------ citadel/room_ops.c | 16 ++- citadel/serv_smtp.c | 13 ++- citadel/sysconfig.h | 3 +- 6 files changed, 132 insertions(+), 128 deletions(-) diff --git a/citadel/citadel.c b/citadel/citadel.c index e35044fa5..01bcb05c7 100644 --- a/citadel/citadel.c +++ b/citadel/citadel.c @@ -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); } } } diff --git a/citadel/clientsocket.c b/citadel/clientsocket.c index c9d40c517..ba423c435 100644 --- a/citadel/clientsocket.c +++ b/citadel/clientsocket.c @@ -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); } diff --git a/citadel/network/mail.sysinfo b/citadel/network/mail.sysinfo index 6f937b7ef..2e0172179 100644 --- a/citadel/network/mail.sysinfo +++ b/citadel/network/mail.sysinfo @@ -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 to map +gdom or system 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 to map -gdom or system 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 to map +gdom or system 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 to map -gdom or system 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 to map -gdom or system 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 to map -gdom or system to map -humannode Haven BBS -lastcontact 952138910 Fri Mar 3 22:01:50 2000 +phonenum netproc[4026]: Adding non-neighbor system to map +gdom or system 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 to map +gdom or system 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 to map +gdom or system 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 to map -gdom or system 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 to map -gdom or system 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 to map -gdom or system to map -humannode Dog Pound BBS II -lastcontact 952349824 Mon Mar 6 08:37:04 2000 +phonenum netproc[4026]: Adding non-neighbor system to map +gdom or system 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 to map +gdom or system 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 to map +gdom or system 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 to map -gdom or system to map -humannode 'Cat Chat -lastcontact 952138915 Fri Mar 3 22:01:55 2000 +phonenum netproc[7145]: Adding non-neighbor system to map +gdom or system to map +humannode BCCS +lastcontact 952569423 Wed Mar 8 21:37:03 2000 -future +ctestsys use uncnsrd -phonenum netproc[4026]: Adding non-neighbor system to map -gdom or system 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 diff --git a/citadel/room_ops.c b/citadel/room_ops.c index d512f539a..12c74727f 100644 --- a/citadel/room_ops.c +++ b/citadel/room_ops.c @@ -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)); + } } diff --git a/citadel/serv_smtp.c b/citadel/serv_smtp.c index b9457afe1..99504c584 100644 --- a/citadel/serv_smtp.c +++ b/citadel/serv_smtp.c @@ -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); diff --git a/citadel/sysconfig.h b/citadel/sysconfig.h index 98095fa70..6a772177a 100644 --- a/citadel/sysconfig.h +++ b/citadel/sysconfig.h @@ -84,10 +84,9 @@ /* * 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 */ /* -- 2.30.2