]> code.citadel.org Git - citadel.git/blobdiff - citadel/techdoc/session.txt
* Various changes to begin work on support for MIME messages
[citadel.git] / citadel / techdoc / session.txt
index 284e38ea0c5696d37f1494674239d545d457561e..1994dd8a59e9dc248c787b26a6fb87e824885a85 100644 (file)
@@ -1,5 +1,5 @@
                   SESSION LAYER PROTOCOL FOR CITADEL/UX
-            (c) 1995-1998 by Art Cancro   All Rights Reserved
+         (c) 1995-1999 by Art Cancro et. al.    All Rights Reserved
    
   
  INTRODUCTION
@@ -30,30 +30,15 @@ what you did, so that your new commands can be added to this document.
  ----------------------
   
  The protocols used below the session layer are beyond the scope of this
-document, but we will briefly cover a few of the currently used methods. 
-Keep in mind that the server program itself does not speak any protocols
-lower than the session layer.  Instead, it reads all input from stdin, and
-writes all output to stdout.  This implies that it is the responsibility of
-other programs to provide a usable transport to the client programs.
- One way to connect to a server is to use a set of pipes.  This does of
-course assume that the client and server are running on the same computer. 
-When the client starts up, the first thing that it does is create two pipes,
-which it temporarily dup()'s to stdin and stdout.  Then it proceeds to
-fork() and exec() to a copy of the server program, which inherits the
-pipes as its standard input and output - exactly the desired effect.  The
-client program can then re-connect its own stdin and stdout to where they're
-supposed to be, and use the pipes to send and receive server messages.
- Another way is to use TCP/IP.  Under Unix-like systems this is easily
-accomplished using the "inetd" superserver program, which can take programs
-like the Citadel/UX server and offer connections to clients over a TCP or
-UDP port.  See the install documentation (or the inetd documentation from
-your OS) for information on how to do this.  Always use TCP ports for
-Citadel/UX sessions.  Since our session layer assumes a clean, reliable,
-sequenced connection, the use of UDP would render the server unstable and
-unusable.  When operating in a TCP/IP environment, the port number officially
-assigned to Citadel is 504.
+document, but we will briefly cover the methodology employed by Citadel/UX.
+ Citadel/UX offers Citadel BBS service using TCP/IP.  It does so via a
+multithreaded server listening on a TCP port.  Older (4.xx) versions employed
+an inetd-based server.
+ The port number officially assigned to Citadel by the IANA is TCP/504.  Since
+our session layer assumes a clean, reliable, sequenced connection, the use
+of UDP would render the server unstable and unusable, so we stick with TCP.
    
    
  GENERAL INFORMATION ABOUT THE SERVER
@@ -197,14 +182,6 @@ logged in, or ERROR if another user already exists with this name.  If OK,
 it will also return the same parameters that PASS returns.
  
   
- AUTO   (AUTOmatic login   **OBSLETE** )
-   
- Citadel/UX no longer supports this type of authentication.  It was formerly
-used to automatically authenticate a user based on the user ID under which
-the server was running.  Due to the new multithreaded architecture of the
-server, this is no longer possible.
-  
-   
  SETP   (SET new Password)
  
  This command sets a new password for the currently logged in user.  The
@@ -336,11 +313,11 @@ GOTO command to _BASEROOM_ is guaranteed to succeed.  This is useful to
 allow client software to return to the base room when it doesn't know
 where else to go.
  
- Citadel/UX server v4.01 and above, also has two additional reserved room
-names.  "_MAIL_" translates to the system's designated room for e-mail
-messages, and "_BITBUCKET_" goes to whatever room has been chosen for messages
+ There are also two additional reserved room names:
+ "_MAIL_" translates to the system's designated room for e-mail messages.
+ "_BITBUCKET_" goes to whatever room has been chosen for messages
 without a home.
+
  The second (and optional) parameter is a password, if one is required for
 access to the room.  This allows for all types of rooms to be accessed via
 this command: for public rooms, invitation-only rooms to which the user
@@ -387,12 +364,8 @@ in.
    7. Boolean flag: 1 if this is a Mail> room, 0 otherwise.
    8. Aide flag: 1 if the user is either the Room Aide for this room, *or* is
 a regular Aide (this makes access checks easy).
-  ...and in server 4.01 and above:
    9. The number of new Mail messages the user has (useful for alerting the
 user to the arrival of new mail during a session)
-  
-  ...and in server 4.03 and above:
   10. The floor number this room resides on
   
   
@@ -435,15 +408,17 @@ it's not there, the request is denied.
 LISTING_FOLLOWS code will be returned, followed by the contents of the message.
 The following fields may be sent:
   
- type=   Formatting type.  Currently, there are two defined types.  Type 0 is
-"traditional" Citadel formatting.  This means that newlines should be treated
-as spaces UNLESS the first character on the next line is a space.  In other
-words, only indented lines should generate a newline on the user's screen when
-the message is being displayed.  This allows a message to be formatted to the
-reader's screen width.  It also allows the use of proportional fonts.
-Type 1 is a simple fixed-format message.  The message should be displayed to
+ type=   Formatting type.  The currently defined types are:
+  0 = "traditional" Citadel formatting.  This means that newlines should be
+treated as spaces UNLESS the first character on the next line is a space.  In
+other words, only indented lines should generate a newline on the user's screen 
+when the message is being displayed.  This allows a message to be formatted to
+the reader's screen width.  It also allows the use of proportional fonts.
+  1 = a simple fixed-format message.  The message should be displayed to
 the user's screen as is, preferably in a fixed-width font that will fit 80
 columns on a screen.
+  4 = MIME format message.  The message text is expected to contain a header
+with the "Content-type:" directive (and possibly others).
   
  msgn=   The message ID of this message on the system it originated on.
  path=   An e-mailable path back to the user who wrote the message.
@@ -483,13 +458,14 @@ parts of the listing:
  Line 4  - The fully-qualified domain name (FQDN) of the server
  Line 5  - The name of the server software, i.e. "Citadel/UX 4.00"
  Line 6  - (The revision level of the server code) * 100
- Line 7  - The geographical location of the BBS (for USA: city and state)
+ Line 7  - The geographical location of the BBS (city and state if in the US)
  Line 8  - The name of the system administrator
  Line 9  - A number identifying the server type (see below)
  Line 10 - The text of the system's paginator prompt
- (version 4.01 and above only)
  Line 11 - Floor Flag.  1 if the system supports floors, 0 otherwise.
+ Line 12 - Paging level.  0 if the system only supports inline paging,
+           1 if the system supports "extended" paging (check-only and
+           multiline modes).  See the SEXP command for further information.
  
  *** NOTE! ***   The "server type" code is intended to promote global
 compatibility in a scenario in which developers have added proprietary
@@ -511,18 +487,10 @@ yet, just work with the Citadel development team on the main source tree.
  If everyone follows this scheme, we can avoid a chaotic situation with lots
 of confusion about which client program works with which server, etc.  Client
 software can simply check the server type (and perhaps the revision level)
-to determine ahead of time what commands may be utilized.  The server type
-codes currently defined are:
- Type             Developer
- ---- ---------------------------------------
- 0    Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
- 1    Brian Ledbetter <brian@amaranth.com>
- 2    Matthew Scott <gldnspud@telcomplus.com>
- 3    Jesse Vincent <jrvincent@wesleyan.edu>
- 4    Brian Costello <btx@calyx.net>
- 5    Robert Abatecola <robert@tsgus.com>
-    
+to determine ahead of time what commands may be utilized. 
+ Please refer to "developers.txt" for information on what codes belong to whom.
+
   
    
  RDIR   (Read room DIRectory)
@@ -601,8 +569,6 @@ and the room aide associated with the current room, can access this command.
  1. The room's password (if it's a passworded room)
  2. The name of the room's directory (if it's a directory room)
  3. Various flags (bits) associated with the room (see LKRN cmd above)
-
- (And on server version 4.01 and above ... )
  4. The floor number on which the room resides
   
   
@@ -616,8 +582,6 @@ should be passed the following arguments:
  2. The name of the room's directory (if it's a directory room)
  3. Various flags (bits) associated with the room (see LKRN cmd above)
  4. "Bump" flag (see below)
- (And on server version 4.01 and above, the client may also send ... )
  5. The floor number on which the room should reside
  
  *Important: You should always use GETR to retrieve the current attributes of
@@ -664,7 +628,7 @@ the error) without reading in a message.  Client software should, in fact,
 perform this operation at the beginning of an "enter message" command
 *before* starting up its editor, so the user does not end up typing a message
 in vain that will not be permitted to be saved.  If it is set to 2, the
-server will accept an "apparant" post name if the user is privileged enough. 
+server will accept an "apparent" post name if the user is privileged enough. 
 This post name is arg 4.
   1  -  Recipient.  This argument is utilized only for private mail messages.
 It is ignored for public messages.  It contains, of course, the name of the
@@ -768,8 +732,7 @@ or ERROR or ERROR+HIGHER_ACCESS_REQUIRED if the command will not succeed.
        2  -  Private; can be entered by knowing the name *and* password
        3  -  Private; invitation only (sometimes called "exclusive")
  3  -  Password for new room (if it is a type 2 room)
- 4  -  Floor number on which the room should reside (optional, and in server
-       version 4.01 and above only)
+ 4  -  Floor number on which the room should reside (optional)
  
  If the create flag is set to 1, the room is created (unless something
 went wrong and an ERROR return is sent), and the server returns OK, but
@@ -1014,7 +977,7 @@ from, or "localhost" if the client is local.
      this client (Note: NOOP's don't count)
  6 - The last command received from a client. (NOOP's don't count)
  7 - Session flags.  These are: + (spoofed address), - (STEALTH mode), *
-     (posting) and . (idle).
+     (posting) and . (idle).  (Citserver 5.02 and above)
  
  The listing is terminated, as always, with the string "000" on a line by
 itself.
@@ -1139,12 +1102,6 @@ images which are likely to exist on most servers:
                 opposed to the floor picture's use in a floor listing).
  
    
-  
- ---------------------------------------------------------------------------
- The following commands are available only in Citadel/UX server version 4.01
- and above.
- ---------------------------------------------------------------------------
  NETP   (authenticate as network session with system NET Password) 
  
  This command is used by client software to identify itself as a transport
@@ -1236,10 +1193,6 @@ floor name would change the floor's name.
  If the command succeeds, it will return OK.  Otherwise it will return
 ERROR (plus perhaps HIGHER_ACCESS_REQUIRED or INVALID_FLOOR_OPERATION)
   
- ---------------------------------------------------------------------------
- The following commands are available only in Citadel/UX server version 4.02
- and above.
- ---------------------------------------------------------------------------
 
 IDEN (IDENtify the client software)
 
@@ -1264,10 +1217,6 @@ otherwise it should use the host name it has detected itself.
  IDEN always returns OK, but since that's the only way it ever returns
 there's no point in checking the result code.
   
- ---------------------------------------------------------------------------
- The following commands are available only in Citadel/UX server version 4.03
- and above.
- ---------------------------------------------------------------------------
 
 IPGM (identify as an Internal ProGraM)
  
@@ -1331,10 +1280,15 @@ displayed the next time the target user executes a PEXP command.
 message to, and the text of the message.  If the message is successfully
 transmitted, OK is returned.  If the target user is not logged in or if
 anything else goes wrong, ERROR is returned.
+  
+ If the server supports extended paging, sending a zero-length message
+merely checks for the presence of the requested user without actually sending
+a message.  Sending a message consisting solely of a "-" (hyphen) will cause
+the server to return SEND_LISTING if the requested user is logged in, and the
+client can then transmit a multi-line page.
  
- In Citadel/UX 5.00 and above, the reserved name "broadcast" may be used
-instead of a user name, to broadcast an express message to all users
-currently connected to the server.
+ The reserved name "broadcast" may be used instead of a user name, to
+broadcast an express message to all users currently connected to the server.
  
  Do be aware that if an express message is transmitted to a user who is logged
 in using a client that does not check for express messages, the message will
@@ -1353,10 +1307,6 @@ server return code messages, between the return code and the parameters.  In
 much the same way as FTP uses "-" to signify a continuation, Citadel uses
 an "*" in this position to signify the presence of waiting express messages.
   
- ---------------------------------------------------------------------------
- The following commands are available only in Citadel/UX server version 4.10
- and above.
- ---------------------------------------------------------------------------
  
  EBIO   (Enter BIOgraphy)
  
@@ -1375,10 +1325,6 @@ LISTING_FOLLOWS plus the bio file if the user exists and has a bio on file,
 ERROR+NO_SUCH_USER if the named user does not exist, or ERROR+FILE_NOT_FOUND
 if the user exists but has no bio on file.
   
- ---------------------------------------------------------------------------
- The following commands are available only in Citadel/UX server version 4.11
- and above.
- ---------------------------------------------------------------------------
   
  STEL   (enter STEaLth mode)
  
@@ -1412,10 +1358,6 @@ easier to implement, and to provide some sort of multimedia support in the
 future.  Keep in mind that when this command is used, all messages will be
 output in fixed 80-column format.
   
- ---------------------------------------------------------------------------
- The following commands are available only in Citadel/UX server version 5.00
- and above.
- ---------------------------------------------------------------------------
    
  MSG3   (read MeSsaGe, mode 3 -- internal command)
  
@@ -1576,7 +1518,7 @@ addition, the RWHO listing will include both the spoofed and real usernames.
  TIME  (get server local TIME)
 
  TIME returns OK followed by the current time measured in seconds since
-00:00:00 GMT, Jan 1, 1970.
+00:00:00 GMT, Jan 1, 1970 (standard Unix format).
 
  This is used in allowing a client to calculate idle times.
 
@@ -1598,10 +1540,92 @@ as follows, and are common to both commands:
  5 - Access level
  6 - User number
  7 - Timestamp of last call
+ 8 - Purge time (in days) for this user (or 0 to use system default)
 
  Upon success, AGUP returns OK followed by all these parameters, and ASUP
 simply returns OK.  If the client has insufficient access to perform the
 requested operation, ERROR+HIGHER_ACCESS_REQUIRED is returned.  If the
 requested user does not exist, ERROR+NO_SUCH_USER is returned.
+ GPEX   (Get Policy for message EXpiration)
+ Returns the policy of the current room, floor, or site regarding the automatic
+purging (expiration) of messages.  The following policies are available:
+   0  -  Fall back to the policy of the next higher level.  If this is a room,
+         use the floor's default policy.  If this is a floor, use the system
+         default policy.  This is an invalid value for the system policy.
+   1  -  Do not purge messages automatically.
+   2  -  Purge by message count.  (Requires a value: number of messages)
+   3  -  Purge by message age.  (Requires a value: number of days)
+ The format of this command is:  GPEX <which>
+ The value of <which> must be one of: "room" "floor" "site"
+ If successful, GPEX returns OK followed by <policy>|<value>.
 
\ No newline at end of file
+
+
+ SPEX   (Set Polict for message EXpiration)
+ Sets the policy of the current room, floor, or site regarding the automatic
+purging (expiration) of messages.  See the writeup for the GPEX command for
+the list of available policies.
+ The format of this command is:  SPEX <which>|<policy>|<value>
+ The value of <which> must be one of: "room" "floor" "site"
+ If successful, GPEX returns OK; otherwise, an ERROR code is returned.
+ CONF   (get or set global CONFiguration options)
+ Retrieves or sets various system-wide configuration and policy options.  This
+command is only available to Aides.  The sole parameter accepted is a command,
+which should be either GET or SET.  If the GET command succeeds, CONF will
+return LISTING_FOLLOWS followed by the fields described below, one line at a
+time.  If the SET command succeeds, CONF will return SEND_LISTING and expect
+the fields described below, one line at a time (don't worry about other fields
+being added in the future; if a 'short' configuration list is sent, the missing
+values at the end will be left unchanged on the system).  If either command
+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 <more> 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. Password for server-to-server networking
+ 17. Default purge time (in days) for users
+ 18. Default purge time (in days) for rooms
+ 19. Name of room to log express messages to (or a zero-length name for none)
+  
+ EXPI   (EXPIre system objects)
+ Begins purge operations for objects which, according to site policy, are
+"old" and should be removed.  EXPI should be called with one argument, one of:
+    "messages"     (purge old messages out of each room)
+    "users"        (purge old users from the userlog)
+  
+ EXPI returns OK (probably after a long delay while it does its work) if it
+succeeds; otherwise it returns an ERROR code.
+ This command is probably temporary, until we can work some sort of scheduler
+into the system.  It is implemented in the serv_expire module.