  The CCmbbsCA program is a fully functional BBS system; the only thing missing is
  a multi-user talker (choose one and run it separately).

  In general, if you are a user of this BBS rather than someone who is running
  it, you should look at the MVIEW section for commands, terminology and so
  on. See section 4. MVIEW.

Message:

Subject: 5.1 MBBS Invocation

  To run the CCmbbsCA BBS client, simply do:

   mbbs [OPTIONS...]

  This will read the global configuration file and enter the main menu.

  The following options can be used:

  CC-eCA
  CC--externalCA      Log in as an external user. See section 5.7 External Users.
                  Useful in the login script for the CCbbsCA external account; for
                  instance the shell for a CCbbsCA Unix account could be set to
                  CC/bbs/login.shCA which could contain something like this:

                   #!/bin/sh

PATH=/bin:/usr/bin:/usr/local/bin
export PATH

cat /bbs/issue.txt

bbs --external

                  Internal users may also use this to log in as a different,
                  external, account.

  CC-xCA
  CC--xterm-titleCA   Use the xterm title to display the current action. This is
                  the default if the terminal type in CC$TERMCA is "xterm".

  CC--no-xterm-titleCA      Do not use the xterm title to display the current
                        action.

  CC-cCA
  CC--no-coloursCA
  CC--monochromeCA    Do not output any colour attributes - view everything in
                  black and white.

  CC-sCA
  CC--scanCA    Perform a scan (like pressing [BSPACEb] in the main menu), but don't
            actually log in or view any files, just list what the scan would
            have hit. Outputs nothing if there would be nothing to look at.

  CC--helpCA    Print a usage message on standard output and exit successfully.

  CC-VCA
  CC--versionCA       Print version information on standard output and exit
                  successfully.

  The following environment variables will be read:

  CCTERMCA      Used to determine the current terminal type. If it starts with
            "xterm", then xterm titling is turned on by default.

  CCACTION_FILECA     If the file referred to by CC$ACTION_FILECA exists and is
                  writable when CCmbbsCA starts up, the current action will be
                  stored here every time it changes. This was useful for a
                  script the author wrote once, and has been retained in case
                  anyone else finds it handy.

  CCMANIM_PROGCA      Program to use instead of CCqmanimCA to run Anim programs. Note
                  that whatever program you specify must accept the CC-nCA and CC-eCA
                  options (account name and nameline).

  CCREMOTE_HOSTCA     What to put in the "Location" field on the Users On screen
                  if the relevant information cannot be obtained from the CCutmpCA
                  file. Useful if you are running your BBS on a machine to
                  which you do not have root access, since you can hang
                  CCtelnetdCA off a port and tell it to use a script instead of
                  CCloginCA - you can then write this script such that it sets
                  CCREMOTE_HOSTCA accordingly.

Message:

Subject: 5.2 MBBS Administration

  To begin with, it is probably best to copy the example configuration and
  system files which came with the package in the CCextra/bbsCA directory. These
  can then be modified to suit your setup.

  It is recommended that before you try to set up a BBS with CCmbbsCA, you get to
  grips with menu coding and the ins and outs of the menu/file viewer, CCmviewCA.

  When CCmbbsCA is run, it reads the global configuration file (which should only
  be writable by the BBS administrator).

  The location of the main menu, the location of the [BESCAPEb] menu, the system
  logging directories, the location of the options ([BESCAPEb][BOb]) menu, and so
  on - all are controlled by the configuration file, the format of which is
  explained in the next section.

  It is worth noting that the [BESCAPEb] menu and the options menu are read from
  files which you, as BBS admin, can edit; it is therefore important that they
  are set up correctly. They both use some "nonstandard" extensions to menu
  coding - the "?" action type - and the keypresses inside them should not be
  altered.

  The BBS client, CCmbbsCA, and the GID setting utility, CCmgidCA, should both be
  installed setgid to some group which nobody is a member of. The installation
  scripts will use the group "bbs" by default, creating it if it does not
  exist.

  This means that the menu code absolutely controls who has access to what,
  because access to all files has to be through the BBS client. It is
  important, when running the BBS, to make sure that the Unix file permissions
  and ownership are always set properly to ensure that nobody can get access
  to anything they shouldn't.

  A good idea is to set up a crontab for yourself as BBS admin and make
  yourself a member of the "bbs" group, then schedule jobs to regularly do
  useful things such as purge users' LDB files of old entries. Whether you do
  this, and how you actually do it, are of course entirely dependent on your
  setup.

Message:

Subject: 5.3 MBBS Configuration

  The global configuration file for CCmbbsCA should be placed in CC/usr/local/etcCA,
  CC/etcCA, or whichever CCetc/CA directory is appropriate to the configuration you
  chose with the CC./configureCA script when compiling. Its filename should be
  CCbbsrcCA or CCbbs.cfCA.

  Each line should contain a key and a value. Blank lines, and anything
  following a hash (#), are ignored. Unknown keys will cause an error, and
  defining the value of a key more than once will result in the key having the
  value that is nearest the end of the file.

  The following keys can be defined:

  CCrootCA      This is the top-level directory for the BBS system. Any subsequent
            filenames with CC$CA in them will have the CC$CA expanded to the value of
            this key. For example:

             root /bbs
main $/main.mn

            This will set the key "CCmainCA" to CC/bbs/main.mnCA.

  CCmainCA      This is the location of the main menu, which is the first thing
            that a user will see on running CCmbbsCA.

  CCspecialCA   This is the location of the menu that is to appear when the user
            presses [BESCAPEb] in a file or a menu. In this menu, certain
            keypresses have special meanings when combined with the "?" action
            type. Look at the example menu supplied with this package for more
            information.

  CCoptionsCA   This is the location of the menu that is to appear when the user
            presses [BESCAPEb] then [BOb]. This menu should be kept pretty much
            the same as the example supplied for it to work properly.

  CCxwarnCA     Before entering an X-rated menu item, users will be shown this
            file. If they press [BQb] while reading it, they will not be allowed
            to continue on to the menu entry itself.

  CCudbCA       This is the filename template for users' UDB (User DataBase)
            files. In it, the character CC%CA will be replaced with the user's
            account name. It should refer to a file in a group-writable (but
            not world-writable) directory.

  CCldbCA       This is the filename template for users' LDB (Last-access
            DataBase) files. As with the UDB template, the character CC%CA will be
            replaced with the user's account name, and again it should refer
            to a file in a group-writable directory. It should Bnotb refer to a
            file in a user-owned directory, because then clever use of
            symbolic links could compromise BBS security.

  CCeditCA      This is the filename template for a user's temporary edit file,
            used when adding to a file with the [BAb] key. The character CC~CA will
            be expanded to the current user's home directory.

  CCfriendsCA   This is the file in which to store a user's "friends list" (users
            listed in this file will be highlighted on the Users On screen).

  CCu2uCA       This is the directory in which to store files relating to
            user-to-user messaging.

  CCu2uomaxCA   This is the maximum size, in kilobytes, that a user's messages
            file can be when they log out. If it is larger than this when they
            log out, it will be truncated. Default value: 100.

  CCu2uimaxCA   This is the maximum size, in kilobytes, that a user's messages
            file can be while they are logged in. If it grows above this size,
            it will be truncated. Default value: 1000.

  CCu2uominCA   This is the size, in kilobytes, to which a user's messages file
            will be truncated when they log out if its size exceeds CCu2uomaxCA.
            Default value: 50.

  CCu2uiminCA   This is the size, in kilobytes, to which a user's messages file
            will be truncated if its size exceeds CCu2uimaxCA while the user is
            logged in. Default value: 600.

  CCu2ulogCA    This is the file in which to store a copy of all messages sent by
            users. Only the sysop should be allowed access to this file;
            allowing access is up to you.

  CCu2ulgszCA   The size, in kilobytes, that the above log will be allowed to grow
            to. If it gets any larger it will be truncated to 10% of this
            size.

  CCsysopCA     A list of users to treat as "sysop" of the BBS, separated by
            spaces. Any user whose name is in this list will be able to write
            menus containing execution entries (type X or S) that anyone will
            be able to execute even if those entries' commands are not listed
            in "paths" (see below). Since this is a lot of power to give
            someone on a multi-user system, only the BBS administrator(s)
            should be in this list.

  CClogdirCA    The directory in which the system logs (below) will be stored. It
            should be writable to group if you haven't already created all of
            the files below inside it.

  CCaddlogCA
  CCdellogCA
  CCeditlogCA
  CCrunlogCA
  CCmaillogCA
  CCbbslogCA    The filenames, inside the "logdir" directory, of the log files for
            addition of entries to files, deletion of entries from files,
            direct editing of files, execution of X or S type menu entries,
            the emailing of files with [BMb], or the exiting of an CCmbbsCA client.

            These files should be created with permissions 660 and should be
            owned by the BBS group.

  CClogsizeCA   The maximum size of any one of the log files above, in kilobytes.
            If a log file becomes larger than this, it will be truncated to
            10% of this size.

  CCusrlistCA   Inside this directory should be either a set of user-owned
            directories or a set of symbolic links. Each of these will be that
            user's group list directory, as referred to by the CC.IFCA CCUSERCA
            CCuser/group/CA construct in menu code.

  CClistdirCA   The system group directory; this directory should contain all
            system-wide groupings, for instance "admin". Remember that group
            files should be group-readable to be of any use.

  CCextlimCA    The maximum number of users allowed on the BBS before external
            access is denied. See section 5.7 External Users.

  CCidleextCA   The maximum allowed idle time for an external user. Defaults to
            1800 seconds, or 30 minutes.

  CCidleintCA   The maximum allowed idle time for an internal user. Defaults to
            10800 seconds, or 3 hours.

  CCpathsCA     The name of a file which lists, one per line, the commands that a
            non-admin member's menu code can get another user to run via the X
            or S menu types.

            A whole line must match the first part of a command line for the
            command to be allowed. For instance the line CC/bin/falseCA would
            allow the command lines CC/bin/falseCA, CC/bin/falsefooCA, and so on.

  CCnologCA     This is a kludge to allow the author to keep files from different
            BBSes inside an CCmbbsCA BBS. Any log file whose path matches all of
            "nolog" will be ignored - logs will not be written to that file.

            Leave this blank unless you know what you are doing.

  CCstatusCA    The name of a directory, which must be group-readable,
            group-writable and group-executable, in which each client will
            store details of their current action. This is used to generate
            the Users On listing.

Message:

Subject: 5.4 ACLs

  Users writing menu code for use in CCmbbsCA may only link to files that they
  own, unless the user who owns the file they are linking to expressly gives
  them permission.

  This is so that, for instance, if user "b" owns a file "CCx.cmCA" which is
  supposed to be marked CC.STATUSCA CCANONYMOUSCA, a malicious user "a" cannot write
  menu code which links to "CCx.cmCA" without "b"'s permission.

  In this case, user "b" would have to create an Access Control List, or ACL,
  which is a file containing the names of users allowed to link to a file.
  Creating the file "CCx.cm.aclCA", group readable but not writable, containing
  just "a" on a line, would give user "a" permission to link to the file.

  Thus you can allow only "trusted" users to link to your files if they are
  sensitive.

  An ACL file is simply a text file containing the names of all users who you
  want to permit to link to your file. Blank lines, and text after a #, are
  ignored. More than one name may be given per line, and only usernames (not
  group names) are valid.

  Alternatively, making your file world-readable gives everyone permission to
  link to it. This is of course not recommended for sensitive or anonymous
  files.

  Note that listed directories (see section 10.4 Listed Directories) cannot
  have associated ACL files; if you want other users to be able to link to
  them in their menu code, you will have to make them world-readable.

Message:

Subject: 5.5 User Messaging

  Users may send each other messages in CCmbbsCA. Each message a user receives is
  stored in their private messages file, which they alone can read. Although
  each user cannot directly edit their own messages file, they may delete
  individual messages from it if they wish.

  Messages are sent by pressing [BSb] in a file and selecting the edit you wish
  to reply directly to, or by pressing [BESCb][BSb] and specifying the user or
  users to send to.

  Once the message has been written and the editor has been exited, a menu of
  options is presented. Any users who are ignoring messages, logged out, or
  whose message file does not yet exist are listed at the top of this menu.

  Any given message may be postponed instead of being sent. If you wish to
  resume a postponed message, simply begin sending to exactly the same users
  as the original message (which implies that if you postpone two messages to
  the same recipients, things might well get confused).

  Note that all postponed messages are erased when you exit the BBS - they are
  not retained between sessions.

  Users' messages files are automatically truncated when that users logs out,
  if they are 100K or larger. It is thus advisable to mail your messages to
  yourself (do [BESCb][BRb] then [BMb]) before logging out if you want to keep a
  copy.

Message:

Subject: 5.6 Privileges and Bans

  Since any communications system is open to abuse, CCmbbsCA has a system of
  privileges and bans.

  Any user may have one or more of the following privilege flags:

  CCDCA CC-CA CCDisconnectCA CCUsersCA        Allow the user to disconnect any other user by
                              pressing [BDb] while examining them.

  CCACA CC-CA CCAlterCA CCAccountCA CCDetailsCA   Allow the user to alter another user's account
                              details by pressing [BEb] while examining them,
                              change their password with [BPb], remove the
                              account with [BRb], and create a new account with
                              [BCb].

  Any user may also have any of the following ban flags set:

  CCNCA CC-CA CCAlterCA CCNamelineCA    The user is not allowed to change their nameline with
                        [BESCb][BOb][BNb].

  CCMCA CC-CA CCMailCA CCFilesCA        The user is not allowed to mail any files to
                        themselves.

  CC2CA CC-CA CCMessagesCA    The user cannot send messages.

  CCECA CC-CA CCAlterCA CCFilesCA       The user is not allowed to alter files in any way - no
                        editing, adding, or deleting.

  CCBCA CC-CA CCFullCA CCBanCA    The user cannot log into the BBS at all.

  Any of these flags can be set by someone with an Alter Account privilege.
  Privileges are conferred by adding the relevant letter to CCBBS_PRIVSCA, and
  bans are applied by adding the relevant character to CCBBS_BANSCA.

  However, a user's level - CCBBS_LEVELCA - determines who they can apply their
  privilege to. A higher level user cannot alter the details of a user with a
  lower or equal level.

  The sysop always has all privileges and no bans, and has a level of 0. The
  default user level of other users is 10. The user "guest" always has no
  privileges, all bans except total ban, and a level of 99.

Message:

Subject: 5.7 External Users

  Several times in this manual, there have been mention of "external" and
  "internal" users or accounts.

  An "internal" account is simply one which exists in Unix as a shell account
  - CCrootCA, for example. Users of internal accounts cannot log into the BBS as
  "external" users, and cannot change their password via the BBS - they must
  continue to do it via CCpasswdCA as usual.

  Internal accounts can never be fully removed from the BBS; using the Remove
  Account privilege on them will only erase their BBS data to default values.
  To prevent an internal account from logging on, either erase the Unix
  account or set their "ban from BBS" flag by putting a CCBCA in their CCBBS_BANSCA
  UDB field (see section 5.6 Privileges and Bans).

  External accounts, on the other hand, exist entirely on the BBS. External
  users, such as CCguestCA, do not have a shell account in Unix and all external
  users have the same effective UID. They can set their password from within
  the BBS, as it is controlled by the BBS and not by the Unix password system.

  Also, external users can be prevented from logging in if the BBS is "full" -
  if there are CCextlimCA or more users on the BBS, no more external logins are
  allowed. See section 5.3 MBBS Configuration.

  An example way of allowing external access is to create a Unix account
  called CCbbsCA on the server, with no password, and set its login shell to
  something like CC/bbs/login.shCA. The contents of CC/bbs/login.shCA, which should be
  owned by CCrootCA and CCchmodCA CC755CA, would be something like the following:

   #!/bin/sh

PATH=/bin:/usr/bin:/usr/local/bin
export PATH

cat << EOF

Welcome to XXX BBS.  If you do not have an account, log in as "guest" for
limited access; you can apply for an account by emailing XXX@XXX.
EOF

mbbs --external

  Obviously this requires root access to the server, so you could try hanging
  it off a port or something. For instance, as a non-root user on a Red Hat
  6.x system, you could make a file CC/home/me/inetd.confCA containing this:

   9999 stream tcp nowait me /usr/sbin/in.telnetd in.telnetd -L /home/me/bbs/login.sh

  Then, run the command CC/usr/sbin/inetdCA CC/home/me/inetd.confCA to start CCinetdCA,
  and create the file CC/home/me/bbs/login.shCA (make sure it is CCchmodCA CC700CA to be
  executable) containing the following:

   #!/bin/sh
export REMOTE_HOST=$2
export PATH=/bin:/usr/bin:/usr/local/bin
cat << EOF
Some welcome message or other
EOF
/home/me/mbbs --external

  Change the paths as necessary - basically this just sets the CCREMOTE_HOSTCA
  environment variable (see section 5.1 MBBS Invocation), displays a welcome
  message, and runs the BBS in external mode.

