* Changed the comments at the beginning of each file to a consistent format
authorArt Cancro <ajc@citadel.org>
Wed, 28 Jun 2000 03:42:58 +0000 (03:42 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 28 Jun 2000 03:42:58 +0000 (03:42 +0000)
* Improved the parameterization of commands in the IMAP module

79 files changed:
citadel/ChangeLog
citadel/Makefile.in
citadel/aidepost.c
citadel/auth.c
citadel/base64.c
citadel/chkpwd.c
citadel/citadel.c
citadel/citadel.h
citadel/citmail.c
citadel/citserver.c
citadel/client_chat.c
citadel/client_passwords.c
citadel/client_passwords.h
citadel/commands.h
citadel/config.c
citadel/config.h
citadel/control.c
citadel/database.c
citadel/domain.c
citadel/domain.h
citadel/dynloader.c
citadel/dynloader.h
citadel/file_ops.c
citadel/genstamp.c
citadel/genstamp.h
citadel/getutline.c
citadel/housekeeping.c
citadel/html.c
citadel/html.h
citadel/imap_tools.c [new file with mode: 0644]
citadel/imap_tools.h [new file with mode: 0644]
citadel/internet_addressing.h
citadel/internetmail.c
citadel/ipc_c_tcp.c
citadel/locate_host.c
citadel/logging.c
citadel/messages.c
citadel/mime_parser.c
citadel/mime_parser.h
citadel/msgbase.c
citadel/msgform.c
citadel/netmailer.c
citadel/netpoll.c
citadel/netproc.c
citadel/netsetup.c
citadel/parsedate.h
citadel/policy.c
citadel/proxy.c
citadel/qpdecode.c
citadel/rcit.c
citadel/readlog.c
citadel/room_ops.c
citadel/rooms.c
citadel/routines.c
citadel/routines2.c
citadel/sendcommand.c
citadel/serv_chat.c
citadel/serv_expire.c
citadel/serv_imap.c
citadel/serv_inetcfg.c
citadel/serv_info.c
citadel/serv_moderate.c
citadel/serv_pop3.c
citadel/serv_pop3.h
citadel/serv_smtp.c
citadel/serv_test.c
citadel/serv_upgrade.c
citadel/serv_upgrade.h
citadel/serv_vcard.c
citadel/setup.c
citadel/snprintf.c
citadel/stats.c
citadel/support.c
citadel/sysconfig.h
citadel/sysdep.c
citadel/tools.c
citadel/user_ops.c
citadel/userlist.c
citadel/whobbs.c

index 565a19052f96bf580d213b48848f10e54c3c2257..fe87be2be93e2737a424b7e458df80bf6506e0cf 100644 (file)
@@ -1,4 +1,8 @@
  $Log$
+ Revision 572.9  2000/06/28 03:42:56  ajc
+ * Changed the comments at the beginning of each file to a consistent format
+ * Improved the parameterization of commands in the IMAP module
+
  Revision 572.8  2000/06/27 01:27:13  ajc
  * Coupla very small changes to get on the road to IMAP support
 
@@ -1918,4 +1922,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
        * Initial CVS import 
-
index 194637c4326bdc87b42a4fcdf5018065234dcff1..e5aba8228a837f231a2c53bd6bc2ca78cd4622d1 100644 (file)
@@ -85,7 +85,7 @@ SOURCES=aidepost.c citadel.c citmail.c citserver.c client_chat.c commands.c \
        auth.c chkpwd.c html.c vcard.c serv_upgrade.c \
        serv_smtp.c serv_pop3.c internet_addressing.c parsedate.c genstamp.c \
        domain.c clientsocket.c serv_inetcfg.c serv_rwho.c serv_bio.c \
-       serv_moderate.c client_passwords.c serv_imap.c
+       serv_moderate.c client_passwords.c serv_imap.c imap_tools.c
 
 DEP_FILES=$(SOURCES:.c=.d)
 
@@ -161,12 +161,6 @@ modules/serv_pop3.so: serv_pop3.mo
 modules/serv_pop3.mo: serv_pop3.mo
        ln -f serv_pop3.mo modules
 
-modules/serv_imap.so: serv_imap.mo
-       $(LINK_SHARED) -o modules/serv_imap.so serv_imap.mo
-
-modules/serv_imap.mo: serv_imap.mo
-       ln -f serv_imap.mo modules
-
 modules/serv_inetcfg.so: serv_inetcfg.mo
        $(LINK_SHARED) -o modules/serv_inetcfg.so serv_inetcfg.mo
 
@@ -221,6 +215,15 @@ modules/serv_smtp.mo: serv_smtp.mo
 modules/domain.mo: domain.mo
        ln -f domain.mo modules
 
+modules/serv_imap.so: serv_imap.mo imap_tools.mo
+       $(LINK_SHARED) -o modules/serv_imap.so imap_tools.mo serv_imap.mo
+
+modules/serv_imap.mo: serv_imap.mo
+       ln -f serv_imap.mo modules
+
+modules/imap_tools.mo: imap_tools.mo
+       ln -f imap_tools.mo modules
+
 aidepost: aidepost.o config.o $(LIBOBJS)
        $(CC) aidepost.o config.o $(LIBOBJS) $(LDFLAGS) -o aidepost
 
index 1e25cd3a37c8cdfbc46eb53cd9fd506c92b67fc2..935df22b7af9491ddfecb18c3837aed1149cfa9e 100644 (file)
@@ -1,7 +1,7 @@
-/* aidepost.c
- * This is just a little hack to copy standard input to a message in Aide>
- * v2.0
+/*
  * $Id$
+ *
+ * This is just a little hack to copy standard input to a message in Aide>
  */
 
 #include <stdlib.h>
index 37b989aff496f6833e4f27cbaeb33b4929aafc1f..66dc67c7a90468b8722cd3f8fd5f3be7696636cf 100644 (file)
@@ -1,8 +1,9 @@
 /*
- * auth.c -- system-level password checking for autologin
+ * $Id$
+ *
+ * system-level password checking for autologin
  * by Nathan Bryant, March 1999
  *
- * $Id$
  */
 
 #if defined(__linux) || defined(__sun) /* needed for crypt(): */
index ff69e32188619c4fda76f31ab98a0e8a8de4d298..53965bd438e7af08af81deda8624c50e9a7c98ba 100644 (file)
@@ -1,18 +1,11 @@
 /*
-
-          Encode or decode file as MIME base64 (RFC 1341)
-
-                           by John Walker
-                      http://www.fourmilab.ch/
-
-               This program is in the public domain.
-
-Revision date: 11th August 1997
-
-Modified slightly for the Citadel/UX system, June 1999
-http://uncnsrd.mt-kisco.ny.us/citadel
-
-*/
+ * $Id$
+ *
+ * Encode or decode file as MIME base64 (RFC 1341)
+ * Public domain by John Walker, August 11 1997
+ * Modified slightly for the Citadel/UX system, June 1999
+ *
+ */
 
 
 #include <stdio.h>
index 76f6c9bb1e5426315417c467bda1e1574eed14a4..b96ac7392a54845d964fbd9572ffdde486864d24 100644 (file)
@@ -1,8 +1,9 @@
 /*
- * chkpwd.c: a setuid helper program for machines which use shadow passwords
+ * $Id$
+ *
+ * a setuid helper program for machines which use shadow passwords
  * by Nathan Bryant, March 1999
  *
- * $Id$
  */
 
 #include <pwd.h>
index ba5ebb0bddfa4966a240c2e889a05ed64f2df2ae..706558fee6b30f907a795e8a4938f76254315e1f 100644 (file)
@@ -1,8 +1,7 @@
 /*
- * Citadel/UX  
- *
- * citadel.c - Main source file.
  * $Id$
+ *
+ * Main source module for the client program.
  */
 
 #include "sysdep.h"
index d31dc797596cbd6226fefc9bfa537bf19bb61ea7..048bfcafefb154b5c073a7cef72c1760ca951e42 100644 (file)
@@ -1,7 +1,8 @@
-/* citadel.h
+/*
+ * $Id$
+ *
  * main Citadel/UX header file
  * see copyright.txt for copyright information
- * $Id$
  */
 
 /* system customizations are in sysconfig.h */
index a484e6bd2c17467a58b1d9bf5aeb15aa2771ab1b..4842532cfa503a1b82d28c20e704536b236204ad 100644 (file)
@@ -1,12 +1,10 @@
 /*
- * 
- * Completely reworked version of "citmail"
- * This program attempts to act like a local MDA if you're using sendmail or
- * some other non-Citadel MTA.  It basically just forwards the message to
- * the Citadel SMTP listener on some non-standard port.
- *
  * $Id$
  *
+ * This program attempts to act like a local MDA if you're using sendmail or
+ * some other non-Citadel MTA.  It basically just contacts the Citadel SMTP
+ * listener on a unix domain socket and transmits the message.
+ *
  */
 
 #include "sysdep.h"
index c5417bedecb85dc29517358b776deec5860f2a36..89f65d295c86c3f3a2f7d1adcd4c07438cdd792a 100644 (file)
@@ -1,4 +1,10 @@
-/* $Id$ */
+/* 
+ * $Id$
+ *
+ * Main source module for the Citadel server
+ *
+ */
+
 #include "sysdep.h"
 #include <stdlib.h>
 #include <unistd.h>
index 3aad45f43a42a2fd0c632ef52a70c7e1a05cd661..658e9c13b0b6a365b4ad5925364dc4f0f4f8a072 100644 (file)
@@ -1,11 +1,9 @@
 /*
- * Citadel/UX
- *
- * client_chat.c  --  front end for chat mode
- *                    (the "single process" version - no more fork() anymore)
- *
  * $Id$
  *
+ * front end for chat mode
+ * (the "single process" version - no more fork() anymore)
+ *
  */
 
 #include "sysdep.h"
index 3d78f9b3a439d9cefcd682bf91f91ff865b5033d..0f13555d58a2ae923d4fecf18c302ddc269f489a 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * $Id$
+ *
+ * Functions which allow the client to remember usernames and passwords for
+ * various sites.
+ *
+ */
+
 #include "sysdep.h"
 #include <stdlib.h>
 #include <unistd.h>
index 1945ff07c7999b0531308f62bbdcef96b12b1b4d..96a5fb4f865b055419230242faf7997cfee4c64c 100644 (file)
@@ -1,3 +1,8 @@
+/* 
+ * $Id$
+ *
+ */
+
 void determine_pwfilename(char *);
 void get_stored_password(
                char *host,
index b6464bc96b22e51bf0815373d7b15a8ee599b83c..1d47e0d5103e27477449afca8b63d11cbbf558db 100644 (file)
@@ -1,4 +1,7 @@
-/* $Id$ */
+/*
+ * $Id$
+ *
+ */
 
 /*
  * Colors for color() command
index 0bc223a3580b308b9c17ae098393db416ebadeab..4f7de769e193ba192a663a85b49e396a23d5a556 100644 (file)
@@ -1,8 +1,9 @@
 /*
+ * $Id$
+ *
  * This function reads the citadel.config file.  It should be called at
  * the beginning of EVERY Citadel program.
  *
- * $Id$
  */
 
 #include "sysdep.h"
index ce092c28bcd1a327bbf9f5aba6cca40b829ca9f5..5804b9ae9b3791eee9b5fcb317214999d73d17aa 100644 (file)
@@ -1,4 +1,8 @@
-/* $Id$ */
+/*
+ * $Id$
+ *
+ */
+
 void get_config(void);
 void put_config(void);
 extern struct config config;
index 3616a15c641df566f4fd269172daab6195a22c21..e9452d4e498c9df8825e9f8aac59b37bc842cc95 100644 (file)
@@ -1,10 +1,8 @@
 /*
- * control.c
+ * $Id$
  *
  * This module handles states which are global to the entire server.
  *
- * $Id$
- *
  */
 
 #include "sysdep.h"
index 061647395b64f09b508c95f4d1c592abec1eeee4..77360c6e0cf4703d6e8c8bb838d6e41d7b1c450b 100644 (file)
@@ -1,8 +1,9 @@
 /*
+ * $Id$
+ *
  * This file contains a set of abstractions that allow Citadel to plug into any
  * record manager or database system for its data store.
  *
- * $Id$
  */
 
 /*
index 129b2efa34aef5ce64d85a5fd6eeaca7ae915b47..265fce1dffab3ec7f4f9a2a8d52c5ba78e41b47f 100644 (file)
@@ -1,3 +1,10 @@
+/*
+ * $Id$
+ *
+ * DNS lookup for SMTP sender
+ *
+ */
+
 #include <stdlib.h>
 #include <unistd.h>
 #include <string.h>
index d81060421aa583724e021bd04011642315e3b939..0d9ac9f66074cbe8593708421795eb0057881390 100644 (file)
@@ -1,3 +1,7 @@
+/*
+ * $Id$
+ *
+ */
 
 struct mx {
        int pref;
index 657bc76f9c2ec121b1645781db3b613480856182..b8be4eb34cbef73f39bd634908fe949fb986b83a 100644 (file)
@@ -1,13 +1,10 @@
-/*******************************************************
+/*
+ * $Id$
  *
  * Citadel Dynamic Loading Module
- * Written by Brian Costello
- * btx@calyx.net
- *
- * $Id$
+ * Written by Brian Costello <btx@calyx.net>
  *
- ******************************************************/
-
+ */
 
 #include "sysdep.h"
 #include <stdio.h>
index 1a43066be1a3575186dcd5b2fe792c4d0880d497..4fec72fe489042cd71604b376fe89fedccd4b5df 100644 (file)
@@ -1,4 +1,5 @@
 /* $Id$ */
+
 void DLoader_Init(char *pathname);
 int DLoader_Exec_Cmd(char *cmdbuf);
 char *Dynamic_Module_Init(void);
index 5bbe1a77a5dc122de4001fa5288aeec432c7bdbb..e2db9eb56396bf8e9bcf393f0f39bba79f3c8dfc 100644 (file)
@@ -1,4 +1,10 @@
-/* $Id$ */
+/* 
+ * $Id$
+ *
+ * Server functions which handle file transfers and room directories.
+ *
+ */
+
 #include "sysdep.h"
 #include <stdlib.h>
 #include <unistd.h>
index b3e910baeed71cef8582e07518684c21f344d8e6..4c7cf0d005aa51e00483e4c0a160bfbd4e83e917 100644 (file)
@@ -1,8 +1,8 @@
 /*
- * Function to generate RFC822-compliant textual time/date stamp
- *
  * $Id$
  *
+ * Function to generate RFC822-compliant textual time/date stamp
+ *
  */
 
 #include <stdio.h>
index 747fb355cabfc96b70729d212c46ebe6aef4c4f9..8a654b2efb2639308b5a771d212b4cf50750986b 100644 (file)
@@ -1 +1,6 @@
+/*
+ * $Id$
+ *
+ */
+
 void generate_rfc822_datestamp(char *buf, time_t xtime);
index c6bc289e0c146244bf992ab6a5f4d99cb399b191..5eae2a76003cbd5e01a890ad319dbd88a0e0d72a 100644 (file)
@@ -1,8 +1,9 @@
 /*
+ * $Id$
+ *
  * getutline.c: not-quite-compatible replacement for getutline(3)
  * by nathan bryant, feb 1999
  *
- * $Id$
  */
 
 #include "sysdep.h"
index fc878b499280850cebfb204abd76c50071de5777..c9ffcfb9ee62d41cd5b25369e5b4dbb57a4204b1 100644 (file)
@@ -1,8 +1,9 @@
 /*
+ * $Id$
+ *
  * This file contains housekeeping tasks which periodically
  * need to be executed.  It keeps a nice little queue...
  *
- * $Id$
  */
 
 #include "sysdep.h"
index f638032f209d3cb98a71eb7a4f65fdf57145dc0d..5c95524e490e645378bf9d41867a5bca02b97c76 100644 (file)
@@ -1,6 +1,7 @@
 /*
- * html.c -- Functions which handle translation between HTML and plain text
  * $Id$
+ *
+ * Functions which handle translation between HTML and plain text
  */
 
 #include "sysdep.h"
index c96bec221e4d025023e61062390b879b120cddec..ac53d1f755f41603fe755f9f3ba9452ea49883a7 100644 (file)
@@ -1 +1,6 @@
+/*
+ * $Id$
+ * 
+ */
+
 char *html_to_ascii(char *inputmsg, int screenwidth, int do_citaformat);
diff --git a/citadel/imap_tools.c b/citadel/imap_tools.c
new file mode 100644 (file)
index 0000000..05bfe32
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * $Id$
+ *
+ * Utility functions for the IMAP module.
+ *
+ */
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <ctype.h>
+#include <string.h>
+#include "imap_tools.h"
+
+/*
+ * Break a command down into tokens, taking into consideration the
+ * possibility of escaping spaces using quoted tokens
+ */
+int imap_parameterize(char **args, char *buf) {
+       int num = 0;
+       int start = 0;
+       int i;
+       int in_quote = 0;
+       int original_len;
+
+       strcat(buf, " ");
+
+       original_len = strlen(buf);
+
+       for (i=0; i<original_len; ++i) {
+
+               if ( (isspace(buf[i])) && (!in_quote) ) {
+                       buf[i] = 0;
+                       args[num] = &buf[start];
+                       start = i+1;
+                       if (args[num][0] == '\"') {
+                               ++args[num];
+                               args[num][strlen(args[num])-1] = 0;
+                       }
+                       ++num;
+               }
+
+               else if ( (buf[i] == '\"') && (!in_quote) ) {
+                       in_quote = 1;
+               }
+
+               else if ( (buf[i] == '\"') && (in_quote) ) {
+                       in_quote = 0;
+               }
+
+       }
+
+       return(num);
+}
+                       
+
+
diff --git a/citadel/imap_tools.h b/citadel/imap_tools.h
new file mode 100644 (file)
index 0000000..0f53a09
--- /dev/null
@@ -0,0 +1,6 @@
+/*
+ * $Id$
+ *
+ */
+
+int imap_parameterize(char **args, char *buf);
index 98e7979b2416f1dc0c5896ad8909291595a39ef8..7c54f70d47fdba63024078ed88a6ecde07bad04e 100644 (file)
@@ -1,3 +1,8 @@
+/* 
+ * $Id$
+ *
+ */
+
 int fuzzy_match(struct usersupp *us, char *matchstring);
 void process_rfc822_addr(char *rfc822, char *user, char *node, char *name);
 
index 40bddf877589fe8c9aefe350f662c7d9a04cdc43..36dbecc7c43488b528a1bb550d6dd0a760caed2f 100644 (file)
@@ -1,8 +1,9 @@
 /*
+ * $Id$
+ *
  * Internet mail configurator for Citadel/UX
  * see copyright.doc for copyright information
  *
- * $Id$
  */
 
 #include <stdlib.h>
index bb4290baa66fe962ccd50d53a7bce900e2f735a3..2151c15900234153471d4c7757e18ec5d40ae321 100644 (file)
@@ -1,9 +1,7 @@
 /*
- * ipc_c_tcp.c
+ * $Id$
  * 
- * Citadel/UX client/server IPC - client module using TCP/IP
- *
- * version 1.3 $Id$
+ * Client-side IPC functions
  *
  */
 
index e2ce8ee6bfe6d8affda24d079cebec478997c66c..5bd0b93a521d80dcaf895d045836d625c068ee9c 100644 (file)
@@ -1,6 +1,8 @@
 /*
- * locate the originating host
  * $Id$
+ *
+ * locate the originating host
+ *
  */
 
 #include "sysdep.h"
index 39a66c147f38ca688b0c83a6a45f6189bc7b5f71..af9b5703124ad9d918e514955b655a9091e3dbba 100644 (file)
@@ -1,6 +1,8 @@
 /*
- * Everything which needs some logging...
  * $Id$
+ *
+ * Everything which needs some logging...
+ *
  */
 
 #include "sysdep.h"
index 611b2b458cf02e80b54e90053e9250db0ee2b246..27ff4968bc01a6c9963f857af969584c2dba8f65 100644 (file)
@@ -1,7 +1,8 @@
 /*
+ * $Id$
+ *
  * Citadel/UX message support routines
  * see copyright.txt for copyright information
- * $Id$
  */
 
 #include "sysdep.h"
index ecd54358ee6528eaab579da0df5f2e503e22e7c1..34decdd0211b798209210f1d6f292fe0e560108a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * mime_parser.c
+ * $Id$
  *
  * This is a really bad attempt at writing a parser to handle MIME-encoded
  * messages.
@@ -7,8 +7,6 @@
  * Copyright (c) 1998-1999 by Art Cancro
  * This code is distributed under the terms of the GNU General Public License.
  *
- * $Id$
- *
  */
 
 #include "sysdep.h"
index b7f1c1b7ebc6fa023c0d9c1bb2741051436bc067..88f8cc7fc22255d59a0827c1a48d268bfe26f679 100644 (file)
@@ -1,3 +1,8 @@
+/*
+ * $Id$
+ *
+ */
+
 void extract_key(char *target, char *source, char *key);
 
 void mime_parser(char *content_start, char *content_end,
index 5be0bcf3bbacc67bd94724f678b00adc1e13e568..086ca77e63b2aeaaf4d4fd49757677e714b630d6 100644 (file)
@@ -1,4 +1,9 @@
-/* $Id$ */
+/* 
+ * $Id$
+ *
+ * Implements the message store.
+ *
+ */
 
 #include "sysdep.h"
 #include <stdlib.h>
index 94ddb0971b5c85032934d09dd94627ea91df1780..e4f80b6665cfdfd7ac61996d4a261be516b7f630 100644 (file)
@@ -1,6 +1,5 @@
 /*
- * msgform.c v2.1 $Id$
- * see copyright.doc for copyright information
+ * $Id$
  * 
  * This is simply a filter that converts Citadel binary message format
  * to readable, formatted output.
@@ -9,6 +8,7 @@
  * then it stops at the end of the first message it prints.
  * This is used by the QWK reader for Citadel/UX during message format
  * translation.
+ *
  */
 
 #include "sysdep.h"
index 7de5c419f68b4bd57fb2d29055b7eca7481c8621..ccb9b020b4c8c88d5a1c5aebf8281a4c1a13f2d3 100644 (file)
@@ -1,9 +1,7 @@
 /*
- * netmailer for Citadel/UX
- * see copyright.doc for copyright information
+ * $Id$
  *
  * netproc calls this to export Citadel mail to RFC822-compliant mailers.
- * $Id$
  */
 
 #include <stdlib.h>
index 4493515ae86ef4a44d04b2f57cdb4d5ea7de7b0d..03d1051917adee9325eafd2d85e39a1a9d8e0518 100644 (file)
@@ -1,4 +1,10 @@
-/* $Id$ */
+/* 
+ * $Id$
+ *
+ * Perform data transfer between our Citadel server and another.
+ *
+ */
+
 #include <stdlib.h>
 #include <unistd.h>
 #include <stdio.h>
index f7a108db75a734cd3c6ba2e7cdae98760b6f33ae..93b20f627e193f62bc9b99e58184c50851abccfb 100644 (file)
@@ -1,7 +1,9 @@
 /*
+ * $Id$
+ *
  * Citadel/UX Intelligent Network Processor for IGnet/Open networks
  * See copyright.txt for copyright information
- * $Id$
+ *
  */
 
 /* How long it takes for an old node to drop off the network map */
index 2542c31347f55612685f60ce1a9ec3d332cb03a6..20785aeccd7b4514f42215779e178947d2f1717e 100644 (file)
@@ -1,6 +1,7 @@
 /*
  * $Id$
  *
+ * Command-line utility to manipulate network configuration files
  * Copyright (c) 1998  Art Cancro
  *
  */
index eb7851d827106907603aededf720e4624da014a9..b28dae0eb16cf5c1d41a7b4ef9984e889991d2a0 100644 (file)
@@ -1 +1,6 @@
+/*
+ * $Id$
+ *
+ */ 
+
 time_t parsedate(char *);
index 3beea2bb289aa3eaecf6ac05d789e2dcbba14d8a..b3223f14390712e9634f82024774ece5cbbcea3b 100644 (file)
@@ -1,4 +1,9 @@
-/* $Id$ */
+/* 
+ * $Id$
+ *
+ * Functions which manage policy for rooms (such as message expiry)
+ */
+
 #include "sysdep.h"
 #include <stdlib.h>
 #include <unistd.h>
index c2782519d3d8073da1ddd2e866eb91b61001e9cb..c501442866885737807e7a9ef9d94121cc0259ab 100644 (file)
@@ -1,10 +1,8 @@
 /*
- * Session layer proxy for Citadel
- * (c) 1998 by Art Cancro, All Rights Reserved, released under GNU GPL v2
  * $Id$
- */
-
-/*
+ *
+ * A partially functional session layer proxy for Citadel
+ * (c) 1998 by Art Cancro, All Rights Reserved, released under GNU GPL v2
  * NOTE: this isn't finished, so don't use it!!
  *
  */
index ba01e1269f4acfefaff02b195a8f58f293e54454..94686532db3a68036a592b732018cbdb62affc8a 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id$ 
+ *
  * Convert "quoted printable" encoding to binary (stdin to stdout)
  * Copyright (C) 1999 by Art Cancro
  * Distributed under the terms of the GNU General Public License.
index a5f6f9acf9232e965f3610dc759861e3214b5554..8cd0e4f887d6f75b3f6955d051fa62532719db64 100644 (file)
@@ -1,6 +1,4 @@
-#define UNCOMPRESS "/usr/bin/gunzip"
-
-/* Citadel/UX rcit $Id$
+/* $Id$
  *
  * This program simply feeds its standard input to the networker.  It is
  * used primarily to hook up to UUCP feeds of Citadel data.
@@ -13,6 +11,7 @@
  *     -s      Don't run netproc now, just accept the input into spoolin
  */
 
+#define UNCOMPRESS "/usr/bin/gunzip"
 #include <stdlib.h>
 #include <unistd.h>
 #include <fcntl.h>
index 6fc67aa3f8fae78a9b905c335b35dddcef575be9..1964f9dc386a404fb46f4f42f020f398035939e4 100644 (file)
@@ -1,6 +1,7 @@
 /* 
- * readlog.c  (a simple program to parse citadel.log)
  * $Id$
+ *
+ * A simple program to parse citadel.log
  */
 
 #include <stdlib.h>
index 25f7fa86171d81de50dbb97181cafbe8a50b2c36..c9c6b513689a4afebdaa584dfa261aba06300ae2 100644 (file)
@@ -1,4 +1,9 @@
-/* $Id$ */
+/* 
+ * $Id$
+ * 
+ * Server functions which perform operations on room objects.
+ *
+ */
 #include "sysdep.h"
 #include <stdlib.h>
 #include <unistd.h>
index 68135fe491a6fab275b92d4bf5fdb407264c8e5f..0cd7a32a8e88dbd93af87863ad352d06b70e3abf 100644 (file)
@@ -1,5 +1,10 @@
-/* Citadel/UX room-oriented routines */
-/* $Id$ */
+/*
+ * $Id$
+ *
+ * 
+ * Client-side functions which perform room operations
+ *
+ */
 
 #include "sysdep.h"
 #include <stdlib.h>
index 1f967e278e5e222344201eee9add81efc9fefa63..0997942175aed98ab87b1ad61e8a01d542a1847a 100644 (file)
@@ -1,5 +1,9 @@
-/* Citadel/UX support routines */
-/* $Id$ */
+/*
+ * $Id$
+ *
+ * Client-side support functions.
+ *
+ */
 
 #include "sysdep.h"
 #include <stdlib.h>
index 87a398aa7eccfdcb2ee6aa82e6abf42a07862995..224a316317f455579fd0d7313d119a657378292e 100644 (file)
@@ -1,6 +1,8 @@
-/* More Citadel/UX routines...
- * unlike routines.c, some of these DO use global variables.
- * $Id$
+/* $Id$
+ *
+ * More client-side support functions.
+ * Unlike routines.c, some of these DO use global variables.
+ *
  */
 
 #include "sysdep.h"
index a5e1fa2e453299b516ce77743d4dfdd3265e3ef9..be69778541eb640f0e0c562e7da799b7bcb8c01e 100644 (file)
@@ -1,5 +1,8 @@
 /*
  * $Id$
+ *
+ * Command-line utility to transmit a server command.
+ *
  */
 
 
index d1b4db02a79545a1881b29ea748c40a4fbff45d7..326d123554d59c07aa8c44e1c3ad77cef42ca09f 100644 (file)
@@ -1,10 +1,9 @@
 /*
- * serv_chat.c
+ * $Id$
  * 
  * This module handles all "real time" communication between users.  The
  * modes of communication currently supported are Chat and Paging.
  *
- * $Id$
  */
 #include "sysdep.h"
 #include <stdlib.h>
index f8f2366e182d96b36a96d42ec14c0159ffc780a6..1918ce958306350ff9cfdc927c508d714c76a550 100644 (file)
@@ -1,9 +1,8 @@
 /*
- * serv_expire.c
+ * $Id$
  *
  * This module handles the expiry of old messages and the purging of old users.
  *
- * $Id$
  */
 
 
index 4c712fa74a20bcdc5854546e9ce048e76c66606f..adb4f623ea5c09e9ba39b5cf1038aee0817aab1d 100644 (file)
@@ -1,4 +1,5 @@
-/* $Id$ 
+/*
+ * $Id$ 
  *
  * IMAP server for the Citadel/UX system
  * Copyright (C) 2000 by Art Cancro and others.
@@ -39,6 +40,7 @@
 #include "tools.h"
 #include "internet_addressing.h"
 #include "serv_imap.h"
+#include "imap_tools.h"
 
 
 long SYM_IMAP;
@@ -78,30 +80,24 @@ void imap_greeting(void) {
 /*
  * implements the LOGIN command (ordinary username/password login)
  */
-void imap_login(char *tag, char *cmd, char *parms) {
-       char username[256];
-       char password[256];
-
-       extract_token(username, parms, 0, ' ');
-       extract_token(password, parms, 1, ' ');
-
-       if (CtdlLoginExistingUser(username) == login_ok) {
-               if (CtdlTryPassword(password) == pass_ok) {
-                       cprintf("%s OK login successful\r\n", tag);
+void imap_login(int num_parms, char *parms[]) {
+       if (CtdlLoginExistingUser(parms[2]) == login_ok) {
+               if (CtdlTryPassword(parms[3]) == pass_ok) {
+                       cprintf("%s OK login successful\r\n", parms[0]);
                        return;
                }
         }
 
-       cprintf("%s BAD Login incorrect\r\n", tag);
+       cprintf("%s BAD Login incorrect\r\n", parms[0]);
 }
 
 
 /*
  * implements the CAPABILITY command
  */
-void imap_capability(char *tag, char *cmd, char *parms) {
+void imap_capability(int num_parms, char *parms[]) {
        cprintf("* CAPABILITY IMAP4 IMAP4REV1 AUTH=LOGIN\r\n");
-       cprintf("%s OK CAPABILITY completed\r\n", tag);
+       cprintf("%s OK CAPABILITY completed\r\n", parms[0]);
 }
 
 
@@ -111,7 +107,7 @@ void imap_capability(char *tag, char *cmd, char *parms) {
 /*
  * implements the SELECT command
  */
-void imap_select(char *tag, char *cmd, char *parms) {
+void imap_select(int num_parms, char *parms[]) {
        char towhere[256];
        char augmented_roomname[256];
        int c = 0;
@@ -120,7 +116,7 @@ void imap_select(char *tag, char *cmd, char *parms) {
        struct quickroom QRscratch;
        int msgs, new;
 
-       extract_token(towhere, parms, 0, ' ');
+       strcpy(towhere, parms[2]);
 
        /* IMAP uses the reserved name "INBOX" for the user's default incoming
         * mail folder.  Convert this to Citadel's reserved name "_MAIL_".
@@ -151,7 +147,8 @@ void imap_select(char *tag, char *cmd, char *parms) {
 
        /* Fail here if no such room */
        if (!ok) {
-               cprintf("%s NO ... no such room, or access denied\r\n", tag);
+               cprintf("%s NO ... no such room, or access denied\r\n",
+                       parms[0]);
                IMAP->selected = 0;
                return;
        }
@@ -165,7 +162,7 @@ void imap_select(char *tag, char *cmd, char *parms) {
        cprintf("* %d EXISTS\r\n", msgs);
        cprintf("* %d RECENT\r\n", new);
        cprintf("* OK [UIDVALIDITY 0] UIDs valid\r\n");
-       cprintf("%s OK [FIXME] SELECT completed\r\n", tag);
+       cprintf("%s OK [FIXME] SELECT completed\r\n", parms[0]);
 }
 
 
@@ -174,8 +171,9 @@ void imap_select(char *tag, char *cmd, char *parms) {
  */
 void imap_command_loop(void) {
        char cmdbuf[256];
-       char tag[256];
-       char cmd[256];
+       char *parms[16];
+       int num_parms;
+       int i;
 
        time(&CC->lastcmd);
        memset(cmdbuf, 0, sizeof cmdbuf); /* Clear it, just in case */
@@ -195,48 +193,47 @@ void imap_command_loop(void) {
        striplt(cmdbuf);
 
        /* grab the tag */
-       extract_token(tag, cmdbuf, 0, ' ');
-       extract_token(cmd, cmdbuf, 1, ' ');
-       remove_token(cmdbuf, 0, ' ');
-       remove_token(cmdbuf, 0, ' ');
-       lprintf(9, "tag=<%s> cmd=<%s> parms=<%s>\n", tag, cmd, cmdbuf);
+       num_parms = imap_parameterize(parms, cmdbuf);
+       for (i=0; i<num_parms; ++i) {
+               lprintf(9, " parms[%d]='%s'\n", i, parms[i]);
+       }
 
        /* commands which may be executed in any state */
 
-       if (!strcasecmp(cmd, "NOOP")) {
+       if (!strcasecmp(parms[1], "NOOP")) {
                cprintf("%s OK This command successfully did nothing.\r\n",
-                       tag);
+                       parms[0]);
        }
 
-       else if (!strcasecmp(cmd, "LOGOUT")) {
+       else if (!strcasecmp(parms[1], "LOGOUT")) {
                cprintf("* BYE %s logging out\r\n", config.c_fqdn);
-               cprintf("%s OK thank you for using Citadel IMAP\r\n", tag);
+               cprintf("%s OK thank you for using Citadel IMAP\r\n", parms[0]);
                CC->kill_me = 1;
                return;
        }
 
-       else if (!strcasecmp(cmd, "LOGIN")) {
-               imap_login(tag, cmd, cmdbuf);
+       else if (!strcasecmp(parms[1], "LOGIN")) {
+               imap_login(num_parms, parms);
        }
 
-       else if (!strcasecmp(cmd, "CAPABILITY")) {
-               imap_capability(tag, cmd, cmdbuf);
+       else if (!strcasecmp(parms[1], "CAPABILITY")) {
+               imap_capability(num_parms, parms);
        }
 
        else if (!CC->logged_in) {
-               cprintf("%s BAD Not logged in.\r\n", tag);
+               cprintf("%s BAD Not logged in.\r\n", parms[0]);
        }
 
        /*  commands requiring the client to be logged in */
 
-       else if (!strcasecmp(cmd, "SELECT")) {
-               imap_select(tag, cmd, cmdbuf);
+       else if (!strcasecmp(parms[1], "SELECT")) {
+               imap_select(num_parms, parms);
        }
 
        /* end of commands */
 
        else {
-               cprintf("%s BAD command unrecognized\r\n", tag);
+               cprintf("%s BAD command unrecognized\r\n", parms[0]);
        }
 
 }
index 0f737910c8cff56d45fc3ceca62f42c83788f5f5..101bad90e9d38fedea154fa0eb3cd282c547edd1 100644 (file)
@@ -1,9 +1,11 @@
-/* $Id$ 
+/*
+ * $Id$ 
  *
  * This module handles the loading/saving and maintenance of the
  * system's Internet configuration.  It's not an optional component; I
  * wrote it as a module merely to keep things as clean and loosely coupled
  * as possible.
+ *
  */
 
 #include "sysdep.h"
index e64f2728282e87f31bcae92e1ed385a94352f5d3..33898552392f97ecb0bb7c969c65491f75490cc0 100644 (file)
@@ -1,7 +1,9 @@
 /*
  * $Id$
  *
- * The CtdlGetServerInfo() function is useful for 
+ * The CtdlGetServerInfo() function is useful for removing unsightly 
+ * uranium deposits from rhinocerous aqueducts.
+ *
  */
 
 #include <stdlib.h>
index efa9b97ac92807c357383ac221229d9b177e0fce..77c210798515592c71d53ea3c267487fd56bb100 100644 (file)
@@ -1,6 +1,7 @@
 /*
  * $Id$
  *
+ * Server-side functions which handle message moderation.
  *
  */
 
index 1544ed48fee3a16b1180cdec59d26429b0e047ab..2d88dbba35c1bafaa714f1d2ef786da709b77cdf 100644 (file)
@@ -1,4 +1,5 @@
-/* $Id$ 
+/*
+ * $Id$ 
  *
  * POP3 server for the Citadel/UX system
  * Copyright (C) 1998-2000 by Art Cancro and others.
index be228e7b09fe84843a66d7f1b35ba047921c79ff..fbb8ef24f77b400305dc627707316f2d83c2c64e 100644 (file)
@@ -1,3 +1,7 @@
+/*
+ * $Id$
+ *
+ */
 
 struct pop3msg {
        long msgnum;
index b7e78ea8cd379b7b077462086a6774917ccf3248..75e9a4ef100e39aa13e8968ef0ace9f8518bcf3b 100644 (file)
@@ -1,4 +1,10 @@
-/* $Id$ */
+/*
+ * $Id$
+ *
+ * An implementation of RFC821 (Simple Mail Transfer Protocol) for the
+ * Citadel system.
+ *
+ */
 
 #include "sysdep.h"
 #include <stdlib.h>
index 0d3ce30bce1604542171850c960a77627e295c66..3ab8af95bc433a0d16353b3edf9cdf9a3ccb5e47 100644 (file)
@@ -1,4 +1,10 @@
-/* $Id$ */
+/*
+ * $Id$
+ *
+ * A skeleton module to test the dynamic loader.
+ *
+ */
+
 #include "sysdep.h"
 #include <stdlib.h>
 #include <unistd.h>
index 942da05518460dd838b3db8fa2c434efb94e399e..176194cd99d99bb4dac89ef587b94f857dccd8de 100644 (file)
@@ -1,4 +1,10 @@
-/* $Id$ */
+/*
+ * $Id$
+ *
+ * Transparently handle the upgrading of server data formats.
+ *
+ */
+
 #include "sysdep.h"
 #include <stdlib.h>
 #include <unistd.h>
index 06eb854ace679e656b6c2e071a0a44caeeb3c47b..2895dbf7390183e54641ab4dfd34050480609d76 100644 (file)
@@ -1,3 +1,8 @@
+/*
+ * $Id$
+ *
+ */
+
 /*
  * Format of a usersupp record prior to version 5.55
  */
index 90966312ebc1984f9ac5b3141ef1a84b92149a3e..b43cbfb300014c784aa9c70590aad2d53be974e3 100644 (file)
@@ -1,11 +1,9 @@
 /*
- * serv_vcard.c
+ * $Id$
  * 
  * A server-side module for Citadel which supports address book information
  * using the standard vCard format.
  *
- * $Id$
- *
  */
 
 #define ADDRESS_BOOK_ROOM      "Global Address Book"
index fe1867e85f50ad107342c7c03552ffb8f1cb58d1..6627048e2c3a3083b8972a599bb328de2c7f9ee4 100644 (file)
@@ -1,8 +1,8 @@
 /*
- * Citadel/UX setup program
  * $Id$
  *
- * *** YOU MUST EDIT sysconfig.h >BEFORE< COMPILING SETUP ***
+ * Citadel/UX setup utility
+ *
  */
 
 #include <stdlib.h>
index 32f8174ec48f0cc6b9def9b1853f282f1e656dd1..dcc9cd81cc8879c94d5d2ca810c993c9c8376cf8 100644 (file)
@@ -1,13 +1,11 @@
 /*
- * modified from Sten Gunterberg's BUGTRAQ post of 22 Jul 1997
- * --nathan bryant <nathan@designtrust.com>
- *
  * $Id$
- */
-
-/*
+ *
  * Replacements for snprintf() and vsnprintf()
  *
+ * modified from Sten Gunterberg's BUGTRAQ post of 22 Jul 1997
+ * --nathan bryant <nathan@designtrust.com>
+ *
  * Use it only if you have the "spare" cycles needed to effectively
  * do every snprintf operation twice! Why is that? Because everything
  * is first vfprintf()'d to /dev/null to determine the number of bytes.
index a5cff63402445552a2f176f51ce0167d3b6dac7a..214ac436b1c20a7f70c071d5c799e59993ae3648 100644 (file)
@@ -1,6 +1,10 @@
-/* Citadel/UX call log stats program
+/*
  * $Id$
+ *
+ * Citadel/UX call log stats program
+ *
  */
+
 #include <stdlib.h>
 #include <unistd.h>
 #include <fcntl.h>
index cc4ac677b38d87577225bc4ce960296dda3b6bae..3c068ceda9e12352651147864412d31684f24116 100644 (file)
@@ -1,4 +1,10 @@
-/* $Id$ */
+/*
+ * $Id$
+ *
+ * Server-side utility functions
+ *
+ */
+
 #include "sysdep.h"
 #include <stdlib.h>
 #include <unistd.h>
index dd445ce9d67b966160b3707e7143d6e26b7d1f4b..d582ed1d5fd51e050c60c4ac0eef88254f4c80a7 100644 (file)
@@ -1,3 +1,8 @@
+/*
+ * $Id$
+ *
+ */
+
 /****************************************************************************/
 /*                  YOUR SYSTEM CONFIGURATION                               */
 /* Set all the values in this file appropriately BEFORE compiling any of the*/
index 00bb311d55a0e90d9bd5eb6bae8c90098d52cbaf..b4d46c2e22fc0a6d207752e9218a8eccc7ac41c4 100644 (file)
@@ -1,14 +1,15 @@
 /*
+ * $Id$
+ *
  * Citadel/UX "system dependent" stuff.
  * See copyright.txt for copyright information.
  *
- * $Id$
- *
- * Here's where we (hopefully) have all the parts of the Citadel server that
+ * Here's where we (hopefully) have most parts of the Citadel server that
  * would need to be altered to run the server in a non-POSIX environment.
  * 
  * Eventually we'll try porting to a different platform and either have
  * multiple variants of this file or simply load it up with #ifdefs.
+ *
  */
 
 
index 5cb896c6f16da59bf3b87904e55f75324a94959b..e868f93afeac1e0e83e633aef7b551d3eb585908 100644 (file)
@@ -1,6 +1,8 @@
 /*
- * tools.c -- Miscellaneous routines used by both the client and server.
  * $Id$
+ *
+ * Utility functions that are used by both the client and server.
+ *
  */
 
 #include "sysdep.h"
index 44e11dbe52ccdc7e322f58f5c9361e4f9524854a..ec57f6becd92ea9f926506d5243c951b506b1b13 100644 (file)
@@ -1,4 +1,9 @@
-/* $Id$ */
+/* 
+ * $Id$
+ *
+ * Server functions which perform operations on user objects.
+ *
+ */
 
 #include "sysdep.h"
 #include <errno.h>
index 91d99f1dcb8ea2c062f0cf8f14e0fc14be441dad..db120a9f16ec1f69a6151955bd192489a8caf448 100644 (file)
@@ -1,4 +1,10 @@
-/* $Id$ */
+/*
+ * $Id$
+ *
+ * Command-line user list utility.
+ *
+ */
+
 #include <stdlib.h>
 #include <unistd.h>
 #include <stdio.h>
index b59543bc26991c22e936af1787d0dad11968da95..95674a71efcbde48ef838cc705bffdfe7024d3d9 100644 (file)
@@ -1,4 +1,10 @@
-/* $Id$ */
+/*
+ * $Id$
+ * 
+ * Command-line "who is online?" utility
+ *
+ */
+
 #include <stdlib.h>
 #include <unistd.h>
 #include <stdio.h>