Description || SREhttp/2 Demos

Leave a message in a message box

This demonstrates how to use SREhttp/2 "message boxes".

After submitting a message...
you can:
  • view messages
    view abstracts

:
Please enter your name:
Your e-mail address:
Subject:
Abstract:
Enter your
message:


Using the MESSAGE utility

SREhttp/2 message box utility provides a mechanism for storing messages from clients. SREhttp/2 provides a few simple built-in tools for manipulating these messages boxes. You can ...
  1. Write a message
  2. View the contetns of a messge box, or select one of several messages boxes to view
  3. Control access to message boxes through the use of message box privileges.

The Message Writer

The message writer can be invoked with a request selector of:
/MESSAGE?mode=message&messbox=a_message_box&field1=value&..&fieldn=value
However, in most cases messages are written with an HTML FORM. This FORM should have an ACTION="/MESSAGE", and must contain a mode="MESSAGE" hidden element.

The following describes the various other fields that can be included in the request line, or set using elements in a form.

MESSBOX (recommended)
The particular message-box to put the note into. If a MESSBOX field is not included, the note will be put into the MESSAGES message-box. If MESSBOX names a non-existent message-box, a new message-box will be created.
  • Example: <Input type="hidden" name="zoo_mess">
  • Note:If you installed SREhttp/2 on a FAT hard drive, the message box names must be 8 characters or less.
  • If you set the WRITE_TO_FILE element, a MESSBOX element is ignored.
  • NAME and SUBJECT (recommended)
    These are expected, If not included a generic value will be created. Note that each message is automatically given a TIME and DATE stamp.
    ABSTRACT (recommended).
    A short (150 character) abstract. This is used in the view abstracts version of formatted output.
    AUTO_ABSTRACT
    If ABSTRACT is not filled in, and AUTO_ABSTRACT=1, then a short (150 character or less) abstract will be automatically generated.
    EMAIL (recommended).
    When using formatted mode, the EMAIL address is used to form a mailto: link.
    FAX, ADDRESS, and PHONE (optional).
    The name, and value of these fields are written to the message box as message headers.
    PASSWORD
    The PASSWORD fields is special: it will be encrypted before being written to the message box file. While not used by the MESSAGE utility, other SREhttp/2 addons could use the password to control access to messages.
  • Messages boxes are not designed for security (the encryption is weak), so don't use them when confidentiality and integrity are important.
  • The MESSAGE_SCRAMBLE parameter in SRE_UTIL.CFG is used as an encrytpion key.
  • BROADCAST_LIST
    If included, SREhttp/2 will simultaneously e-mail (through the SMTP gateway you set with the SMTP_GATEWAY SRE_UTIL.CFG variable) copies of your message to a list of e-mail addresses. This list, a file with name given by BROADCAST_LIST, must be in (or under) the MESSBOX_DIR. Furthermore, the client must have SUPERUSER or BROADCAST privileges, or a privilege equal to the value of BROADCAST_LIST. If not, SREhttp/2 will send an authorization request back to the client.

    Example: BROADCAST_LIST=CLASS10.LST,

  • the client must have a CLASS10.LST client privilege.
  • A file with the name CLASS10.LST must exist in your MESSBOX_DIR directory (note that MESSBOX_DIR is set in SRE_UTIL.CFG).
  • The CLASS10.LST file must contain a list of valid e-mail addresses, with each address seperated by a space or CRLF. This file may contain comments, with comments contained within /* and */
  • BROADCAST_ONLY=YES
    Do not write to message box, just BROADCAST
    BROADCAST_NAME=My_name
    Used in the from field of a broadcast message.
    WRITE_TO_FILE=YES
    If included, instead of appending the message to a message box file, SREhttp/2 will write an "E-mail" like file to your MAIL_DIR.
    Other names (optional).
    The name, and value, of these fields will be written to the message box (as headers).
    The difference between "other names" and the EMAIL, PHONE, ADDRESS, and FAX "optional" fields is merely in the order of appearance.
    RESPONSE_FILE
    The RESPONSE_FILE field is used to indicate a file contaning a "response" to a posted message. If no RESPONSE_FILE is included, a very simple generic response will be returned.
    CONTENT (highly recommended)..
    The (multi-line) message. It's written last of all, and is seperated from the message headers by an empty line.

    Viewing Message boxes

    The direct means of reading a message box is to simply view it using the OS/2 TYPE command (message boxes are ASCII files, with a .LOG extension, located in the MESSBOX_DIR directory). SREhttp/2 also provides a few simple mechanisms for remotely viewing these message boxes.
    1.    /MESSAGE?mode=VIEW&messbox=message_box
      will cause SREhttp/2 to send message_box.log message-box-file to the client as is -- with no formatting at all.
    2.    /MESSAGE?mode=VIEW&messbox=message_box&format=1
      will cause SREhttp/2 to format the contents of the message box (in a table).
    3.    /MESSAGE?mode=VIEW&messbox=message_box&messnum=nnn
      will cause SREhttp/2 to send just the nnnth message (in the message_box message-box file).
    4.    /MESSAGE?mode=ASK
      results in an HTML document that displays a list of all available message-boxes. The client can then choose which message-box to view.

    MESSBOX Privileges

    You can control access to SREhttp/2's message boxes by using "message box specific" privileges.
    1. The OPEN_MESSBOX parameter in SRE_UTIL.CFG controls which messages boxes are open to all clients. By default, the SAMPLE_M and MESSAGES message boxes are open to all clients. For other messages boxes, the client will need a message-box specific privilege.
    2. message-box specific privileges are specifed by including (in the client's privilege list), entries of the form:
      MESSBOX=a_message_box.
      For example: MESSBOX=FORUM1 would give (read/write) access to the FORUM1 message box. Note that this is in addition to selector-specific access-controls.

      The a_message_box portion of the privilege can contain the * "wildcard" character. For example, MESSBOX=FORUM* would provide access to FORUM1, FORUM2, etc.

    Note