Description ||
SREhttp/2 Demos
Leave a message in a message box
This demonstrates how to use SREhttp/2 "message boxes".
After submitting a 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 ...
- Write a message
- View the contetns of a messge box, or select one of several
messages boxes to view
- 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.
- 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.
- 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,
- 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.
- This file will contain From, To, Date, and Subject fields;
followed by an empty line and ending with the (possibly quite lond) contents.
- The MAIL_DIR is set in SRE_UTIL.CFG
- These e-mail like files are designed to be read, and
processed, by e-mail clients & servers.
- 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.
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.
-
/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.
-
/MESSAGE?mode=VIEW&messbox=message_box&format=1
will cause SREhttp/2 to format the contents of the message box (in a table).
-
/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).
-
/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.
You can control access to SREhttp/2's message boxes by using
"message box specific" privileges.
- 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.
- 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
- You can also limit access to message boxes by creating an entry in
(the possibly host-specific) ATTRIBS.CFG with a rule of MESSAGE*