Mail Order Service 1.1.4, Scott Kurowski, 08/08/94

Basic documentation discussing installation, configuration and its use.
Additional design details are described in the operation section below.

	Version Date     History
	_______ ________ ______________________________________________________
	
	1.1.4   94/08/08 Fix to for Center not registered deinstall of service.

	1.1.3   94/07/22 Fix to allow deinstall of service while in the poll/
			 wait cycle for trying to resign onto the Mail Service
			 after the Mail Service goes down.  Changed error
			 message when MailOrderMsg.bin file cannot be opened
			 to simply report the file name and let CheckErc()
			 show the error code.

	1.1.2   94/06/01 Rewrote internal message building to resolve stack
			 overwriting errors.  Admin is now notified of bogus
			 orders received when no catalog prefixes are used.
	
	1.1.1   94/04/15 Fixed erc 10173 deinstall condition (no such Center)
			 if user is from a remote center not registered
			 locally and they did not order a valid item.
			 Fixed dropped orders when mail service has not yet
			 sent an attachment and a subsequent order overruns it.

	1.1.0   94/03/30 Reformatted order reporting to output a single message
			 for a single order message received.	
	
	1.0.10  94/03/11 Restored Plog logging of mail signon failure errors.

	1.0.9   94/02/04 Fixed resignon failure (Erc 10111) if server dies
			 during processing of order.

	1.0.8   94/01/28 Fixed incomplete null catalog # prefix code.  Symptom
			 is MOS attempting to send part of the catalog # of the
			 second item in a multiple-order list.
	
	1.0.7   94/01/24 Fixed CatalogNum length problem for long catalog #'s.
			 Added capability to use a null catalog # prefix.

	1.0.6   93/12/09 Fixed resignon failure (Erc 10111) if server dies.

	1.0.5   93/08/10 Fixed Mailbox buffer file receive problem (Erc 203 if
			 receiving a message larger than about 100 bytes).
			 Enhanced Mailbox buffer file problem reporting.
			 Changed SendAdminMessage() to accept message priority
			 parameter vs. sending all messages as Low priority.
			 Changed Admin notification default to No.
			 
	1.0.4   93/08/04 Fixed message subject line parsing problem resulting
			 in double orders of every 5th or so item.
	               
	1.0.3   93/05/24 Fixed deinstall problem on ErcServerNotResponding
			 (erc 11802) for XE530 servers.
	               
	1.0.2   92/09/21 Fixed deinstall problem when signing on and the mail
			 user is already signed on after server communications
			 were restored after an interruption.  It will now try
			 to use it's original Mail Handle (mh).
	               
	1.0.1   92/09/?? Fixed deinstall problem when server disconnects with
			 ercClusterDown (erc 6) and ercMailServiceSuspended
			 (erc 10156). It will now stay online and try to
			 reconnect its mail session.
	
	1.0.0   92/09/04 Original write.
	
	REQUIRES:
	 OS >= BTOS II 3.0x or OS >= CTOS II 3.3, Mail 1.2.3 or later,
	 OFIS Mail 8.0 or later, Make Request Set 12.0 or later.


Installation:

Use the Software Install command.  The [f0]Install.sub file expects
parameters for the command file name (%0) and the path for the system file
area (%1).

Three files are copied to [Sys], the MailOrderService.run file,
MailOrderMsg.bin message file and the example configuration file.

Disk space required for the run and message files is 163 sectors.

Two commands are added to the specified (or default current) command set.
The commands are Install Mail Order Service and Deinstall Mail Order Service.

A single request code from Request.1.sys (tentatively and unofficially
assigned 0EF00h) is merged into [Sys]Request.sys.  The text form of
loadable request file is provided as Request.1.txt.  This request code is used
by the Mail Order Service for unloading (deinstalling).

*** WARNING ***  THIS REQUEST CODE REQUIRES Make Request Set 12.0 OR LATER.
Make Request Set II 3.0.1 WILL CORRUPT YOUR Request.sys FILE.



Configuring the Mail Order Service:

The MailOrder.config file configures the Mail Order Service when it is
installed.  It contains parameters that define several operational aspects.

Use the Editor to customize the MailOrder.config file parameters.

The mail order service name can be up to 12 characters long and must be unique
from all other Mail Order Services running on that workstation (identical
names on different workstations are okay).  This will also be the partition
name when its loaded into memory and is the name you would specify in the
Deinstall Mail Order Service command form.  Later when someone (an E-Mail
user) requests an item from the Mail Order Service, it responds with a message
subject line that begins with this parameter, the name of the Mail Order Service sending the message.

Example	-	:Mail Order Service Name:Mail_Order


The mail order service directory path spec can be up to 42 characters long.
This is the location for all of the files the Mail Order Service will be
mailing out plus the Catalog file.  You MUST supply a volume and directory
name.  The password for this directory can be up to 12 characters long.

Examples -	:Service directory:[!Sys]
		:Service password:
		

The mail order service mail user name MUST be registered with the Mail Service
(40 characters max).  This is the E-Mail userid assigned by you for this
particular Mail Order Service.  You can run multiple Mail Order Services on
the same mail center (or same workstation - any combination), but each must
have a unique E-Mail user name and mailbox directory.  After you add the Mail
Order Service's mail user to the mail center registry, it is NOT necessary to
create the In Tray mail folder using the Interactive Mail Manager (it doesn't
use folders).  The mailbox directory password can be up to 12 characters
long.  The mail center name can be up to 39 characters long, but MUST be the
local mail center name.

Examples -	:Service mail user:MailOrder
		:Service mail password:
		:Service mail center:MLCPtis


The Administrator is the person who is notified of ordering activity or
problems.  You can specify a user at another mail center as the Admin or
someone other than the Mail Center Admin user, but do NOT specify the user
name of this or another Mail Order Service as the Admin user.  You should also
include the mail center name in the parameter for the Admin user.

Example -	:Administrator mail user:Hotline/MLCPtis


The catalog number prefix is used when searching the subject line of mail
messages sent to the Mail Order Service for catalog item numbers, and must be
no longer that 12 characters long, however the CATALOG numbers themselves can
be up to 42 characters long.  You may leave this parameter blank to disable
the catalog number prefixing, allowing catalog numbers to consist of any
string without blanks or commas embedded within them.

Prefixing Enabled
Example -	:Catalog number Prefix:tis-
Prefixing Disabled
Example -	:Catalog number Prefix:


The Catalog file name specifies the file that contains the list of all available items from which a mail user may order.

Example -	:Catalog file name:MailOrder.Catalog



Configuring your Mail Order Catalog:

All files in the catalog must be located in the configured service directory.
If you have configured the ":Catalog number Prefix:" field with anything other
than a blank field, each file must also begin with the Catalog Number prefix.

For example, if "tis-" is the Catalog number prefix and "[Sys]" is
the service directory, then "[Sys]tis-137>CatalogItemFilename"
means that this file is catalog number tis-137.  Only the part of the file name
following the ">" character is sent as the actual file name to the remote mail
user, however - in this case being "CatalogFileName".

If you are not using Catalog number prefixing, then the file name for catalog
number "137" would be "[Sys]137>CatalogItemFilename".

What scheme you use for your catalog numbering is unimportant.  As long as
each file in the catalog begins with the Catalog number prefix and has at
least one other character before the ">", the catalog will be served correctly.

Some possible schemes include:

tis-001>AnyFile1, tis-002>AnyFile2, tis-003>AnyFile3, etc. ( prefix is "tis-" )
	for catalog item numbers 001 002 and 003 or,

Xyz/ABC>AnyFile1, Xyz/DEF>AnyFile2, Xyz/QED>AnyFile3, etc. ( prefix is "Xyz/" )
	for catalog item numbers ABC DEF and QED or,

B25-GP2>AnyFile1, B25/111>AnyFile2, 123/QED>AnyFile3, etc. ( no prefix )
	for catalog item numbers B25-GP2 B25/111 and 123/QED.

Note that the ">" character separates the catalog item number and the rest of
the file name and is required.  The catalog numbers you include to identify
each item file name can be up to 42 characters long.

Once you've compiled and prefixed the contents of your Mail Order Catalog,
create your Catalog file using the file name specified in the configuration
file.

You may put anything at all in this file; there's no specific format.  You
should include the names of the files you are offering in the catalog (listed
WITHOUT their prefixes and catalog #'s) and perhaps the size of each file in
sectors and a brief description of the catalog item file.


Operation - Loading (installing):

Once the Mail Order Service has been configured, the catalog of available
items and the actual files that are the items in the catalog have all been
prepared in the Mail Order Service directory, it's ready to load (install).

Type the Install Mail Order Service command and press RETURN.  Enter the name
of the configuration file you've edited for this Mail Order Service, or leave
this field blank to accept the default MailOrder.config file in the current
Path.  If you want the configured Admin mail user to be notified of ordering
activity (who is ordering what items from the catalog), enter "y" in the
[Notify Admin of ordering activity] field (the default is No).  Press GO.

The Mail Order Service will load into the workstation's memory as a system
service using about 176kb RAM, and go into operation.


Operation - Unloading (deinstalling):

Type the Deinstall Mail Order Service command and press RETURN.  Type the name
of the Mail Order Service you want to unload (deinstall) and press GO.  The
specified Mail Order Service will unload from memory.  Any order messages
received for the Mail Order Service will queue up in its Mailbox until the
next time the Mail Order Service is loaded and resumes serving the catalog.

You can use the Partition Status command to show the names of any running Mail
Order Services at a workstation if you space remembering its name.


Operation - Ordering Items from the Catalog:

Start the Interactive Mail Manager (the Mail command) and sign onto the Mail
Service if necessary.

To request the catalog of available items, create an OFIS Mail message and
address the mail user name of the Mail Order Service in the To: field.  Type
the keywork "Catalog" in the Subject: field.  Send the message and wait for
the Mail Order Service to send back the catalog file as an attachment.

At this point you can Mark and Open the attached catalog file and decide upon
one or more items to order, noting the catalog item number(s).

To order one or more items, create an OFIS Mail message and address the mail
user name of the Mail Order Service in the To: field.  Type the catalog number
of the item you want in the Subject: field.  If you want more than one item,
type a space or comma character between each catalog number in the Subject:
field.  Send the message and wait for your order to be sent back to you.  Each
item you order will arrive as a separate mail message with one attachment per
message.

If you request an item from the catalog that can't be sent for any reason, an
error message is sent back stating that item is unavailable and provides the
E-Mail address of the Mail Order Catalog Admin user.  An error message is also
sent to the Admin user giving the specific error code associated with the
failed order request, what item was ordered and who ordered it.

When catalog number prefixes are enabled, if a message is sent to the Mail
Order Service with neither the "Catalog" keyword nor a valid catalog number,
an error message is returned to the originator of the message stating an
invalid order request was received, and instructs the user how to request the
Catalog file.  No message is sent to the Admin.  In contrast to this, when
catalog number prefixes are disabled (no prefix is configured) there is no
way for the Mail Order Service to determine if an order request is valid until
it has tried to look for the item first and was unsuccessful.  In this case,
it is possible the order request was valid but the item was in fact missing,
so a message to the originator is sent indicating the item was unavailable.
A message is also sent to the Admin describing what was ordered by whom, and
that the item was unavailable.

In cases where the Mail Order Service encounters an error condition it cannot
cope with it logs an error message in [Sys]Log.sys and unloads itself
with a beep.

It is designed to remain active if the Mail Service is suspended or unloaded,
and will reestablish its connection to the Mail Service when it's reloaded.

E-mail gateway considerations: PC-mail for Windows can receive attachments
sent from the Mail Order Service through the LANce gateway.  Unix systems can
also receive the files using FTP as normally used for the SMTP gateway.
Other gateways may or may not support attachments, or certain kinds of files,
or multiple or large attachments.


	Scott Kurowski (SJCSJK)
	DSD San Jose Engineering
	SJK1/TS2
	408/434-4587
	
	06/02/94

    Source: geocities.com/SiliconValley/Pines/4011/unisysfreeware

               ( geocities.com/SiliconValley/Pines/4011)                   ( geocities.com/SiliconValley/Pines)                   ( geocities.com/SiliconValley)