
BeyondMail Sample Applications
Table of Contents

       INTRODUCTION
  1.  PHONE MESSAGE RULES
  2.  PHONE MESSAGE RULES FOR AA
  3.  REQUESTS RECEIVED RULES
  4.  TICKLER RULES
  5.  DAILY MANAGEMENT RULES
  6.  CONVERSATION PRUNING RULES
  7.  CONVERSATION TRACKING RULES
  8.  RESPONSE TRACKING RULES
  9.  THE DOCUMENT/FILE COVER SHEET APPLICATION
10.  STATUS REPORT CONSOLIDATION APPLICATION
11.  THE PROXY APPLICATION
12 . PRODUCT LITERATURE REQUEST SERVER
13.  ISSUE TRACKER (PERSONAL)
14.  ISSUE TRACKER (SERVER)
15.  THE RULE SERVER MANAGER
16.  THE "SINGLE ITEM REQUEST" BUDGETING APPLICATION
17.  THE SALES ORDER APPLICATION
18.  MICROSOFT EXCEL MACRO TEMPLATE: DDE MACROS
19.  MICROSOFT WORD FOR WINDOWS DOCUMENT TEMPLATE: DDE MACROS
20.  AMI PRO DDE MACROS
21.  WORD PERFECT FOR WINDOWS DDE MACROS
22.  BEYONDMAIL SUPPORT LOG APPLICATION
23.  SHARED FOLDERS APPLICATION
24.  SAMPLE ADDIN FUNCTIONS


========================================================================

INTRODUCTION

BeyondMail Sample Applications provide ready-made solutions to typical e-mail information 
management problems.  These applications both help you become productive with BeyondMail quickly, 
and help you learn how to use the Rule Language.  Sample Applications are supplied on the Sample 
Applications disk.  You are welcome to modify these applications to suit your needs.

This document explains what each applications does, the requirements for using it, and where to find it 
on the Sample Applications disk.  The applications are arranged, more-or-less, in order of increasing 
complexity.  The first seven applications provide rule sets an individual user can install to manage their 
mail.  Starting with application eight, The Document/File Cover Sheet Application, additional elements, 
such as custom forms or applications which operate in more than one mail account, are introduced.  The 
applications at the end of ths list make use of advanced features such as DDE, SQL database access, and 
addin functions that are only available in the Windows product.

The explanations of each application, assume that you are already familiar with the basics of BeyondMail 
and BeyondRules.  So, rather than provide detailed installation instructions a Requirements section for 
each application lists what you need to do to use the application.  For the most part, you will find that you 
only need to use a few simple BeyondMail utilities:

*  IMPORT.EXE to import the rules provided on the Sample Applications disk into BeyondMail.
    (You can also import rules from within BeyondMail using the Rule Import menu item.)
*  FORMADM.EXE to import custom forms for some applications.
*  NEWUSER.EXE to create new user accounts to act as the server in client/server applications.

For your convenience, typical BeyondMail commands (assuming BeyondMail is on the f: drive and the 
Sample Applications Disk is in drive a:) to accomplish the requirement are shown in parentheses after 
items in the requirements section.  If you need further information on how to use these utilities, see the 
"BeyondMail Rule Book" and the "BeyondMail Administration Guide."


========================================================================
 1.  PHONE MESSAGE RULES

Platform:		DOS and Windows
Directory on Disk:	PHONE
Rule Set File:		PHONE.RUL
Rule Set Name:		Phone Calls

This rule set helps you manage Phone messages.  The rules assume the person taking phone messages is 
notifying you by e-mail, using the BeyondMail standard Phone Message form.  A complementary rule set 
(Sent Phone Messages) to help the person taking messages is explained in the next section.

REQUIREMENTS: 

*  Load the Phone Calls rule set into your private rule database (import -r a:\phone\phone.rul).

RULE:  Phone calls to return
Places Phone Messages with the "Please call" box checked (the caller asked for you to call back) in the 
"Phone Calls" folder.  You can use this folder as a todo list of calls you need to make.

Tip:  Use BeyondMail's AutoTickle[tm] capability to schedule future calls.  For example, if you receive
         a Phone Message that says, "Out of the office until next Tuesday," you can use AutoTickle to hide 
         the message until next Tuesday, then put it in your Phone Calls folder.

RULE:   Will call back
Files Phone Messages with the "Will Call Back" box checked in the "Phone calls: Will Call Back" folder 
so you have a record of the call.  

RULE:   Alert about urgent phone calls to return
Displays an alert box when you receive a Phone Message with both the "Please Call" and "Urgent" boxes 
checked.  The alert displays the caller's name, the date and time of the call, and, if provided, the caller's 
phone number.  The alert box is displayed for five seconds; edit the rule to change the duration.

RULE:   Warn me about phone calls to make
Displays an alert box for five seconds when BeyondMail starts showing the number of calls to be made in 
the "Phone calls" folder.  The rule assumes you remove message from the folder after returning calls.

========================================================================
2.  PHONE MESSAGE RULES FOR AA

Platform:		DOS and Windows
Directory on  Disk	PHONEAA
Rule Set File:		PHONEAA.RUL
Rule Set Name:		Sent Phone Messages

This rule set helps someone who takes large numbers of Phone messages for others manage "kept copies" 
of the e-mail notifications sent out.  The rules assume copies of sent messages are kept in the Sent folder.

REQUIREMENTS: 

*  Load the Sent Phone Calls rule set into the private rule database of the message taker.
    (import -r a:\phoneaa\phoneaa.rul).

RULE:  File phone messages in folder per recipient
Files the "kept copy" of Phone Messages you send in a folder dedicated to the person for whom you've 
taken the message.  For example, whenever you take a phone call for John Jones, the kept copy of the 
Phone message is autofiled in the "John Jones' Messages" folder.  If the folder does not exist, the rule 
creates it.

RULE:  Archive old phone messages weekly
Every Monday at 7:00 PM, this rule searches the folders for Phone messages more than a week old, saves 
them to a text file (c:\phonemsg.txt), and deletes them from the folders.


========================================================================
3.  REQUESTS RECEIVED RULES

Platform:		DOS and Windows
Directory on Disk	REQUESTS
Rule Set File:		REQUESTS.RUL
Rule Set Name:		Requests

This rule set helps you manage requests people send to you using the BeyondMail Request Form by filing 
the requests in the appropriate "Requests" or "ToDo Today" folder.  See the following rule set for rules to 
manage requests you send to other people.

REQUIREMENTS:

*  Load the Requests rule set into your private rule database (import -r a:\requests\requests.rul).

RULE:  Check for ToDo folder existence
Looks for a "ToDo Today" folder when you start BeyondMail.  Creates the folder if it does not exist.

RULE:  New requests of me
Checks messages as they arrive and moves all messages that ask you to do something ([Action requested] 
attribute checked) to the "Requests" folder.

RULE:  New requests for today
Checks new messages as they are filed in the "Requests" folder and moves whose action requested due 
date is today to the "ToDo Today" folder.  You can modify the rule to check for a different set of actions 
requested.

RULE:  Requests I have to handle today
Checks the "Requests" folder every day at 8:30 AM and moves requests whose due today to the "ToDo 
Today" folder.  You can modify the rule to check for a different set of actions requested.

RULE:  Nag about ToDo List
Displays an alert box every hour on the half-hour showing the number of action items currently due 
today.  The alert displays for 10 seconds.  This rule assumes you delete or move messages in the "ToDo 
Today" and "Requests" folders after taking action on the requests.

Note:  This rule uses the char function to return a linefeed character to force a linefeed.


========================================================================
4.  TICKER RULES

Platform:		DOS and Windows
Directory on Disk:	TICKLER
Rule Set File:		TICKLER.RUL
Rule Set Name:		Tickler Rules

This rule set uses the BeyondMail AutoTickle feature to help you track requests you send to other people.  
See the previous rule set for an example of how to manage requests you receive from other people.

REQUIREMENTS:

*  Load the Tickler rule set into your private rule database 
    (import -r a:\tickler\tickler.rul).

RULE:  Tickle Request Messages When Sending
This rule displays an alert box whenever you send a Request form message, asking if you want to tickle 
the message to appear in your Followup folder on the action requested date.  If you answer Yes, a copy of 
the message is filed in the Sent folder which fires the Tickle Request Messages Part II rule.

RULE:  Tickle Request Messages Part II
Tickles Request form messages filed in the sent folder to appear in your Followup folder on the Action 
Requested date.  If there is no date in the Action Requested attribute, the message is tickled to the 
Followup folder for the next day.

RULE:  Tickle Urgent Messages When Sending
This rule displays an alert box whenever you send an "Urgent" priority message asking if you want to 
tickle the message to appear in your Followup folder.  If you answer Yes, a copy of the message is filed 
in the Sent folder which fires the Tickle Urgent Messages Part II rule.

RULE:  Tickle Urgent Messages Part II
Tickles Urgent priority messages filed in the Sent folder.  Alert boxes ask what folder the tickled message 
should appear in and when.  By default, the message is tickled to the Followup folder in 4 days.  You can 
edit this rule to change the defaults.

========================================================================
5.  DAILY MANAGEMENT RULES

Platform:		DOS and Windows
Directory on Disk:	DAILYMAN
Rule Set File:		DAILYMAN.RUL
Rule Set Name:		Daily Management

This rule set provides you with a variety of rules to help you manage daily mail flow.  These rules all 
operate independently.  After you import the rule set, you can move any rules you don't want to use to a 
disabled rule set to prevent it from firing.  For example, you might move the "Alert on incoming mail" 
rule to a disabled set named "Disabled daily rules" if you don't want an alert posted for every new 
message.

REQUIREMENTS:

*  Load the Daily Management rule set into your private rule database 
    (import -r a:\dailyman\dailyman.rul).

RULE:  Alert on incoming mail
Displays the To, From, and Subject fields of each new message as it is received.  This rule uses the "Alert 
for n seconds" action to display the alert for five seconds.  You can edit the rule to change length of the 
display, or delete the "for 5 seconds" clause to leave the message on the screen until you dismiss it.

Note:  This rule uses the char function to return a linefeed character to force a linefeed.

RULE:  Move urgent messages
Alerts you when a message marked urgent arrives and files the message in your "Urgent" folder.  The 
rule disregards phone messages on the assumption that other rules deal with those messages.  The alert is 
displayed for  five seconds.

RULE:  Move news
Looks for any message with the word "news" in the subject (for example, "In the news:" or "News flash") 
and moves it to the "News" folder.  If the folder does not exist, the rule creates it.

Note:  This is a good example of a rule administrators can use as a "House Rule."  If all users have this 
           rule installed and everyone is on a distribution list called "News," messages sent to the News list 
           with the word "news" in the subject will be automatically filed in each user's "News" folder 
           instead of cluttering the Inbox.

RULE:  I was copied: file in CCs folder
Looks for incoming messages with your name in the Cc field but not in the To field (and were not 
originated by you), and files them in the "CCs" folder.  This is useful if you receive a large amount of 
mail and want to defer reading messages on which you  were copied.

RULE:  Move personal messages
Files messages you receive from anyone in your  "Friends" distribution list in your "Personal" folder.  
You must have a "Friends" list in your Private Address Book with the names of people whose messages 
you want to track in your Personal folder.

RULE:  Move personal sent messages
Files kept copies of messages you send to anyone in your "Friends" distribution list in your "Personal" 
folder.  This rule assumes your Keep Copy option is set to the "Sent" folder.  You must have a "Friends" 
list in your Private Address Book with the names of people whose messages you want to track in your 
Personal folder.

RULE:  Delete messages older than 30 days
Checks your "Inbox" folder every Monday at 8:30 AM for messages older than 30 days.  If any are found, 
an alert box tells you how many messages older then 30 days there are and offers you the options of 
deleting them, deleting them and emptying the Trash folder, or not deleting them.  You can tailor this 
rule by changing the date cutoff and prompt options or by adding a message threshold.

RULE:  Check for forgotten attachments
Checks each message you send to see if "attach" is mentioned in the subject line or body of the message.  
If it is, this rule makes sure something is actually attached to the message and reminds you if there is no 
attachment.


========================================================================
6.  CONVERSATION PRUNING RULES

Platform:		DOS and Windows
Directory on Disk:	CONVTRK
Rule Set File:		PRUNECNV.RUL
Rule Set Name:		Prune rules

This rule set manages ongoing e-mail conversations.  In most organizations, people use the "Include 
Original Text" option on replies, so each message contains a complete conversation "thread" (a copy of 
all prior messages relating to the message).  In this situation, you only need the latest message in the 
chain; all prior messages are redundant and can be deleted.  

These rules watch each message filed in a specified folder and search the folder for the message's parent 
in the conversation chain, deleting it if found.  This provides a condensed list of new messages  thus 
reducing the amount of time spent scanning for new mail (especially when using the new mail view.)  
Conversation pruning also keeps the size of the mailbox to a minimum.

REQUIREMENTS:

*  Import the PRUNECNV.RUL rule set into your mailbox (import -r a:\donvtrk\prunecnv.rul)
*  Set the when event in the "Delete Message Parent" rule to a filed event in the folder you
    want to manage.

RULE: Init Conversation Pruning
Sets the 'prune_threshold' variable.  This variable is used to limit the search performed by the "Delete 
Message Parent" rule to keep execution time to a minimum.

RULE: Delete Message Parent
Searches for the current message's parent and deletes it if found.  If the message does not include original 
text (therefore breaking the chain), or if the parent has attachments, no deletion is performed to avoid 
information loss.


========================================================================
7.  CONVERSATION TRACKING RULES

Platform:		DOS and Windows
Directory on Disk: 	CONVTRAK
Rule Set File:		CONVTRAK.RUL
Rule Set Name:		Conversation Tracking Rules

You probably frequently send messages which create a lot of replies or an extended conversation.  For 
example, you might send a proposal via BeyondMail to a group of people from whom you'd like to 
receive feedback or suggestions.  This rule set lets you track such conversations by automatically filing 
the responses for different conversations in different folders.

REQUIREMENTS: 

*  Import the Conversation Tracking Rules rule set into your mailbox
    (import -r a:\convtrak\convtrak.rul)
*  Create a folder called "Sent: Tracking."

RULE: Prompt user for folder in which to track this conversation
Prompts you to specify a tracking folder before you  send a message.  All ensuing messages linked to the 
message are automatically filed in the folder you specify.

Note:  To activate this rule, you must have the "Keep Copy" option on, and the "Keep Copy Folder" set 
            to the "Sent: Track Conversation"  folder.

The default folder name is "Track: " plus the first 20 characters of the message's subject.  You can change 
the name if you like.  If you change your mind and you don't want to track this conversation, press the 
"Don't Track" button.

For tracked messages, the rule adds the tracking folder name to the message's [User String 1] attribute, 
moves the message to the target folder, and copies it to the "System: Conversations" folder.  The rule also 
adds the [Conversation Id] for the message to the list of id's which the rule set is tracking.

RULE:  File message in conversation thread in specified folder
Checks new messages as they arrive in your inbox to see if their [Conversation Id] attribute is included in 
the cached list of id's being tracked.  If the message is part of a conversation being tracked, the rule 
searches the "System: Conversations" folder for the original message in the conversation to find the name 
of the tracking folder, and moves the message to that folder.

Note:  Caching the tracking list dramatically improves performance and is a good tip to use when writing 
            this type of rule.  Look at the "Cache list of conversations to track at startup" and "On exit write 
            back the cached list of messages to track" rules to see how this is done.

RULE:  When user deletes a message ask if the rest of the conversation should be deleted as 
well
Asks if you want to delete all the messages in a conversation whenever you delete a message in that 
conversation.  This rule is useful once you've received all the feedback or responses you expect for a 
conversation, or you'd like to clean up old topics in your mailbox.

If there are no remaining messages in the folder, this rule deletes the folder.  The rule also deletes the 
copy of the original message in the "System: Conversation" folder and removes the conversation id from 
the cached list of id's being tracked.

Note:  This rule will not delete messages filed in the tracking folder that are not part of the conversation.

RULE:  On exit write back the cached list of messages to track
Uses the Export Message action to write out the list of conversation id's being tracked to a file called 
CONVTRCK.SYS in your mailbox directory.  This list is used to make sure the same conversations are 
tracked every time you quit and re-enter BeyondMail. (See next rule)

RULE: Cache list of conversations to track at startup
Uses the Import Message action to initialize the conversation tracking rules' list of ids to track.


========================================================================
8.  RESPONSE TRACKING RULES

Platform:		DOS and Windows
Directory on Disk:	EXCEPT
Rule Set File:		EXCEPT.RUL
Rule Set Name:		Exception Reporting

This rule set lets you see who has who has or has not replied to your messages.  You can also see who has 
or has not read your messages.  Like the Conversation Tracking rules, this application creates a cached 
tracking list to speed performance.

REQUIREMENTS: 

*  Import the EXCEPT.RUL rule set into your mailbox (import -r a:\except\except.rul)
*  Create a folder called "Sent: Track Replies."

RULE: Track replies to this message
Adds a message you send to the list of messages you are tracking.  To fire this rule for a message you are 
about to send, you must turn on the "Keep Copy" handling option and select the "Sent: Track Replies" 
folder.

RULE: Who's replied, who hasn't? Drop Well in Icon Bar
RULE: Who's replied, who hasn't? Filed message version
Displays a list of the people from whom you've received a reply to your original message.  These two 
rules are basically the same, except one is triggered when you drop the kept copy of your original 
message on an icon bar drop well, while the other is triggered when you copy the kept copy of your 
original message to the "Replies: View Exceptions" folder.  The rule displays an alert box like:

     Replies received from: John Smith, Mary Maloney, Ted Tooney
     None received from: Fred Webster, Sue Sheraton, Ellen Ebowitz

Note:  Use the Window-Icon Bar-Configure menu item to add a rule drop well that fires the "Exception 
            Reporting" rule set's "Who's replied, who hasn't: Drop Well in Icon Bar" rule (See the 
            BeyondMail online help for more information). 

Caution:  Remember to Copy the message rather then drag it to the "Sent: Track Replies" folder because 
                  this method deletes the message after displaying the alert box.  If you make a mistake, you 
can 
                 still retrieve the message from the trash.

RULE: Who's read, who hasn't? Drop well in Icon Bar
RULE: Who's read, who hasn't? Filed Message version
Shows who has actually read your message by reporting exceptions based on the Return Receipt forms 
you receive from the recipients.  Displays an alert box similar to the one for "Who's replied" rules:

     Read By: Sue Smiley, John Smith
     Not Read By: Ted Turner, Mary Martin

You can either drop the kept copy of your sent message onto a rule well or copy the message to your 
"Receipts: View Exceptions" folder to initiate the message as explained for the reply rules above.

RULE: Update the tracking lists on the original message
Updates the [User List 1] and [User List 2] attributes on the kept copy in the "Sent: Track Replies" folder 
whenever you receive a new message whose [Conversation Id] attribute is included in the list of ids you 
are tracking.

RULE: When user deletes a message from the "Sent: Tracking Replies" folder remove from list
Removes the conversation id from the list being tracked when you delete a message in the "Sent: Track 
Replies" folder.  

RULE: On exit write back the cached list of messages to track
Uses the Export Message action to write out the list of conversation ids being tracked to a file called 
EXCEPT.SYS in your mailbox directory.  This makes sure that the same list of replies is tracked every 
time you quit and re-enter BeyondMail.

RULE: Replies Tracking rule: Startup cache list to track
Creates a list of conversation ids to track when you start BeyondMail and stores it in memory for fast 
performance.  The list is taken from a file named EXCEPT.SYS created by the "On exit write back the 
cached list of messages to track" rule the last time you exited BeyondMail.


========================================================================
9.  THE DOCUMENT/FILE COVER SHEET APPLICATION
Platform:		DOS and Windows
Directory on Disk:	CVRSHEET
Rule Set File:		CVRSHEET.RUL
Rule Set Name:		Cover Sheet
Form Definition File:	CVRSHEET.FRM

This simple application lets you send a file which appear to the recipient in its native application instead 
of as an attachment to a BeyondMail form.  For example, you might send an Excel spreadsheet that 
appears in the BeyondMail Inbox as a received message, but actually launches Excel and displays the 
spreadsheet when the receiver opens the message.  You must attach the file to the Cover Sheet form.

REQUIREMENTS: 

*  Load the Cover sheet form into the BeyondMail public forms database 
    (formadm -i a:\cvrsheet\cvrsheet.frm -b)
*  Load the Cover Sheet rule set for each user (import -r a:\cvrsheet\cvrsheet.rul)

RULE: Validate Attachment
Ensures there is an attachment on the message before it is sent.  If there isn't one, an alert notifies the user 
that an attachment is required.  This rule uses a When Sending event tied directly to the form.

RULE: Open Attachment
Automatically launches the attachment when the message is opened.  The BeyondMail Cover Sheet Form 
is never displayed, instead the application associated with the attachment is opened with the attachment 
displayed.  This rule uses a When Opening event tied directly to the form.


========================================================================
10.  STATUS REPORT CONSOLIDATION APPLICATION

Platform:		DOS and Windows
Directory on Disk:	STATUS
Rule Set File:		STATUS.RUL
Rule Set Name:		Status report consolidation

This application shows how you can consolidate the work of others on a regular basis.  Specifically, this 
application combines the weekly status reports of your direct reports in a single message, add the your 
summary, and forwards the message to your boss.

REQUIREMENTS:

*  Create a distribution list called "Direct Reports" in your private address book consisting of the
    usernames of your direct reports.
*  Create an alias "theboss" in your private address book for your boss's mail address.
*  Load the Status Report Consolidation rule set into your private rules database.
    (import -r a:\status\status.rul)
*  Create an empty text file in your INBOX directory named as today's date with a .TXT extension.
*  Create a text file in your INBOX directory named as today's date with a .SUM extension.  This 
    file should contain your summary of the weeks events to serve as an introduction to the attached
    weekly reports.


RULE:  Weekly reminder
Every Friday at 8:30 AM, this rule sends an urgent message to your direct reports reminding them to send 
you their status reports by 4:00 PM that day.

RULE:  Move status reports
Moves incoming status report messages (detected by "Status Report" in the subject line) into a folder 
named by the date appended to the string "Status Reports" (If it doesn't exist, the rule creates it).  Also 
appends each message to a consolidation file (date.TXT).  This rule uses builtin functions to explicitly 
build the date to match the date configured format.

RULE:  15-minute warning
Every Friday at 3:45 PM (15 minutes before the reports are due) this rule fires.  If the number of reports 
contained in the dated status reports folder is fewer than the number of people on the Direct Reports 
distribution list, the rule sends an urgent reprimand to the list telling the delinquents to act now.

RULE:  The consolidation
Every Friday at 4:05 PM (there's a grace period of five minutes), this rule fires.  It sends a message to 
your boss that includes your summary (date.SUM) followed by the individual status reports for the week 
(date.TXT), saving a copy in your Inbox.  The rule then deletes dated status reports folder (the original 
reports are included in this week's report in your Inbox).  This rule uses builtin functions to explicitly 
build the date to match the date configured format.


==============================================================
11.  THE PROXY APPLICATION

Platform:		DOS and Windows
Directory on Disk:	PROXY
Rule Set File:		PROXY.RUL
Rule Set Name:		Proxy
Form Definition File:	PROXY.FRM, PROXYREG.FRM

The proxy application allows one user (Proxy) to send mail in another person's name (Owner).  For 
example, a secretary (Proxy) could use this application to send mail as the boss (Owner).

REQUIREMENTS: 

*  Load the proxy application forms in the public forms database. (formadm a:\proxy\proxy.frm)
    repeat for proxyreg.frm)
*  Load the Proxy rule set in the private rule database of each participating user.
    (import -r a:\proxy.rul) 

SECURITY:
Before the Proxy can send mail as the Owner, the Owner must register the Proxy on his machine:

1.  Choose the Compose More... menu item, then pick the Proxy Registration form.

2.  Enter the Proxy's mail address in the Users field, then click the Save button.  The Proxy need not be
     in the same MHS workgroup or hub (group or organization for Vines users) as the Owner.

    A rule files this form in a folder named "Proxy."  (If it doesn't exist, the rule creates it)  You can enter 
    multiple names in the "Users" field, or create multiple Proxy forms to allow multiple Proxies. 

To modify an existing proxy registration, the Owner can select a Proxy Registration form from the 
"Proxy" folder summary, then choose Make into Draft and change the listed names.  Clicking the Save 
button will activate the changes.  Clicking the Delete button removes the proxy altogether.

SENDING MAIL BY PROXY
Once registered, the Proxy can send mail as the Owner.  To do so, choose the "Proxy Memo" form from 
the Compose menu, fill in all fields, and send the message.  This form has a required field at its top, 
Proxy, where the Proxy fills in the Owner's mail address.

When the Proxy Memo is sent, the to, cc, and bcc fields are ignored, and the message is delivered to the 
Owner's mailbox.  On arrival there, a rule confirms that the sender is registered as a Proxy for this Owner.  
If so, the rule turns the Proxy Memo into a regular memo, using the information from the Proxy Memo, 
and sends it from the Owner's account.


========================================================================
12.  PRODUCT LITERATURE REQUEST SERVER

Platform:		DOS and Windows
Directory on  Disk	PRODLIT
Rule Set File:		PRODLIT.RUL
Rule Set Name:		Product literature request

This application automatically faxes a copy of your product literature in response to a mail request.

REQUIREMENTS:

*  You must have an MHS-accessible fax gateway to use this application.
*  The Rule Server must be running on your mailbox.
*  Create a dedicated Literature Request Server mailbox for this application.
*  Import the Product Literature Request rule set into the server's private rule database
    (import -r a:\prodlit\prodlit.rul)
*  Create a text file named PRODLIT.TXT in the default data directory for the literature request server 
    which contains the sales literature you want to send out.
*  Create an alias or username for the Sales Administrator in your private or public address book.

RULE:  Service literature request
Creates a sales literature message to be faxed to the requester. The request must be sent to the literature 
request server as a new Phone message with "Lit request" and the requester's fax number in the message 
text.  This rule then extracts the fax number form the incoming message, attaches the PRODLIT.TXT 
text file, inserts a courtesy note in the message text, and the sends the message as a fax over a fax 
gateway.  The rule then moves the triggering message to the "Sales database" folder.

Edit the rule to reflect the correct fax gateway address and company name.

RULE:  Send contact notification to sales administrator
Sends a notification message to the sales administrator when a product literature request message is filed 
in the "Sales Database" folder.  The message identifies the company affiliation of the requester, the date 
literature was sent, and the fax number used to respond.  The filed message must have the words "Lit 
request" in the text.


========================================================================
13.  ISSUE TRACKER (PERSONAL)

Platform:		DOS and Windows
Directory on Disk:	ISSUETRK
Rule Set File:		ISSUES.RUL
Rule Set Name:		Issues

This rule set comprises personal filing rules to track messages distributed by the Issue Tracking server 
(see the next application).  If the rules that support the Issue Tracking server use keywords other than 
"Issue," modify your personal filing rules accordingly.

REQUIREMENTS:

*  Load the Issues rule set into the private rule database of each user (import -r a:\issuetrk\issues.rul)

RULE:  File current issues
Moves new message with the word "Issue" in the subject to the "Current Issues" folder.

RULE:  Issues I've sent
Moves messages filed in the "Sent" folder with the word "Issue" in the subject to the "Current Issues" 
folder.

RULE:  Autofile closed issue threads
Moves all the messages in a discussion thread to the "Issues - Closed" folder when you move any 
message in the thread to the "Issues - AutoCloser" folder.  Messages are identified by their common 
[Conversation id] attribute.


========================================================================
14.  ISSUE TRACKER (SERVER)

Platform:		DOS and Windows
Directory on Disk:	ISSUETRK
Rule Set File:		ISSUETRK.RUL
Rule Set Name:		Issue Tracker

This rule set allows you to create an issues server to initiate and track issues electronically.

REQUIREMENTS:

* Create a dedicated Issue Tracker mail user (TRACKER) for this application.
* Create a distribution list called "Participants" in the tracker's public or private address book, naming 
   contributors to the discussion.
* Users must include the issue tracker server (TRACKER) in the distribution list for discussion messages.

RULE:  Check for Issues folder existence
Checks for the  "Issues" folder on startup and creates it if it doesn't already exist.

RULE:  Move issue chatter
Moves messages with the word "issue" in the Subject to the "Issue Threads" folder.  Leaves all issue-
related messages archived in that folder for later reference.

RULE: Delete [From Agent] messages
Eliminates any extraneous issues-related messages forwarded by the Issue Tracker mailbox.

RULE:  New issue distribution
Introduces an issue to the forum.  The rule is triggered by filing a message in the "Issue Threads" folder.  
The message cannot be a reply or forward to an ongoing discussion.  Given that, the rule creates a new 
message that identifies the originator and original proposal, establishes a conversation thread, and sends 
the message to the Participants distribution list.  It also keeps a copy of the rule-created message in the 
"Issues" folder and deletes the triggering message.

RULE:  Issue request server
Provides a complete issue message history (based on conversation id) in response to an incoming 
message with "issue query" in the Subject.  For example, if you've forgotten the original proposal for 
issue 73, send a message to the Issue Tracker mailbox with "issue query 73" as the subject.  You'll get a 
copy of the original New Issue message distributed by the New Issue Distribution rule, and all related 
messages.  The query cannot be created by a rule.


========================================================================
15.  THE RULE SERVER MANAGER 

Platform:		Client - DOS and Windows; Agent - Windows only
Directory on Disk:	RULESERV
Rule Set File:		RULESERV.RUL
Rule Set Name:		The Rule Server Manager

This application automates maintenance of the rule server (BMWSERV.EXE) data file.  It allows users to 
start or stop rule server processing of their mail by sending a message to the Rule Server Manager 
(RuleServ) with a keyword in the subject line.  The recognized keywords are: "start", "run", and "add" for 
adding a name or "stop", "remove", and "delete" for removing a name.  Other keywords can be added by 
editing the rule.

REQUIREMENTS:

*  Create a BeyondMail user called "RuleServ" to serve as the Rule Server Manager.
*  Copy RULESERV.DLL from the RULSERV directory of the samples disk to your 
    BeyondMail PUBLIC\ADDIN directory.
*  Load the Rule Server Manager rule set into the RuleServ user's mailbox.
    (import -r a:\ruleserv\ruleserv.rul)
*  Copy the RSUSERS.DAT file from the sample applications disk to the BeyondMail PUBLIC 
directory.
    This is a rule server datafile loaded with the RuleServ user id for the Rule Server Manager.
*  Modify the 'RS_Data_File' variable in the "Initialize Rule Server Manager" rule to show the
    path to the RSUSERS.DAT file.

After you have completed the requirements, restart the rule server (BMWSERV.EXE) initialize it with 
the new files.


RULE: Initialize Rule Server Manager
Sets up a variable (RS_data_file) to point to the rule server data file.  This variable is used by the other 
rules to find the rule server data file.

RULE: Add User to Rule Server
Processes incoming requests to add users to the rule server, filing the message in a transactions folder 
after the addition is complete.  Text is added to the filed message to indicate the success or failure of the 
transaction for logging purposes.  A status message is returned to the requester.

RULE: Remove User from Rule Server
Processes incoming requests to remove users from the rule server, following the same logging process as 
above.  A status message is returned to the requester.

Note:  This application uses two add-in functions defined in RULESERV.DLL.  This file is a 
BeyondMail 
            addin, built with the BeyondMail Addin Toolkit.  The functions each take two arguments: 

          addMailboxToRuleServer ( mailbox, rule server data file)
          removeMailboxFromRuleServer ( mailbox, rule server data file)

          Possible error codes returned from the addin functions (in the system variable Result):

          0 - Success
          1 - I/O error
          4 - error accessing temp file
          5 - error accessing data file

          See Chapter 8 of the BeyondMail Rule Book for more information about addin functions.

OPTIONAL:
A custom BeyondMail form is supplied to provide cleaner access to the rule server.  You can import this 
form using the FORMADM utility (formadm -i a:\ruleserv\ruleserv.frm -b).  This form lets users add, 
remove, or request a status from the rule server by checking radio buttons, thereby eliminating problems 
caused by misspelled or forgotten keywords.  There is also an optional rule file (RSCLIENT.RUL) that 
provides a greater amount of information for the rule server to process when used in conjunction with the 
form.


========================================================================
16.  THE "SINGLE ITEM REQUEST" BUDGETING APPLICATION

Platform:		Windows only
Directory on Disk:	BUDGET
Rule Set File:		BUDGET.RUL
Rule Set Name:		Mr-Purch

This interpersonal application allows a manager to automatically validate purchase requests against their 
current budget spreadsheet and automatically updates the spreadsheet if the requested item is within the 
budget.

These rules work with a custom form, called the "Single Item Purchase Request".  An employee fills out 
the form and submits it to their manager, who is running the Budgeting application.  The application 
processes the request, and either rejects it based on lack of funds, or forwards it to purchasing for 
fulfillment.

This application demonstrates many of the features of DDE and custom form integration.

REQUIREMENTS:

*  Excel 3.0 or 4.0 must be available for the mailbox running the Budget application.
*  Load the "Single Item Purchase Request" form into BeyondMail public forms database.
    (formadm -i a:\budget\budget.frm -b)
*  Create a "Purchasing" entry in the manager's private address book which is an 
    aliases for the next approver in the purchase process.
*  Create a "Mr-Purch" entry in their private address book of each user which is a alias for their manager.
*  Import the Rule Server Manager rule set into the manager's mailbox (import a:\budget\budget.rul -r)
*  Modify the Launch Excel rule to specify the correct paths for Excel, the spreadsheet, and 
    the macro files on the workstation.  Also, change the name of the budget macro file and 
   macro name itself to reflect the version of Excel you are using (BUDGET30.XLM or 
   BUDGET40.XLM).

After you have completed the requirements, restart BeyondMail to fire the startup rules and initialize the 
Budget System.  Then, send a "Single Item Purchase Request" message with a requested item, cost 
(integer value) and quantity (integer value) to your address to activate the system.

RULE: Launch Excel
Launches Excel when BeyondMail starts up, and sets global variables for the purchasing application.

RULE: Initialize DDE connections for Mr-Purch
Executes after the Launch Excel rule, and sets up DDE connections.  Once the connections are made, the 
DDE Execute action is used to load the Budget spreadsheet and supporting macros into Excel.  This rule 
employs extensive error checking and reporting to alert the user of the status of the application.

RULE: Handle Updates of Monthly Budget Values
Acts on changes to the Total Budget and Total Spent cells in the spreadsheet to maintain the current 
budget balance for processing requests.

Spreadsheets can be very dynamic, and any successful application must access the latest information in 
its decision making.  The budget application sets up dynamic links to the Total Budget and Total Spent 
cells in the spreadsheet so BeyondMail can update the system automatically if they change. 

RULE: Move new purchase request
Moves purchase requests to the "New Purchase Requests" folder to initiate processing.

RULE: Process Single Item Purchase Request
Processes incoming purchase requests.  This rule determines if there is enough money in the budget for 
the request by checking the dynamic links to the spreadsheet.  If there is not enough money, a reply is 
sent to the requester informing them of the current available budget and that their request couldn't be 
processed. 

If there is enough money in the budget, a new line item is added to the spreadsheet by the DDE execution 
of an Excel macro.  The new purchase is "poked" into the line through DDE, and the spreadsheet 
recalculates and updates BeyondMail with the new available budget.  A message is sent to "Purchasing" 
authorizing the request, with a CC going to the requester for confirmation.

RULE: Close DDE Connection to Excel
Closes open DDE connections on shutdown to ensure a clean exit.


========================================================================
17.  THE SALES ORDER APPLICATION

Platform:		Windows Only
Directory on Disk:	SALESORD
Rule Set File:		SOCLIENT.RUL, SOAGENT.RUL
Rule Set Name:		Sales Order, Sales Order Processing Agent
Form Definition File:	SALESORD.FRM

The Sales Order application is an example of the tight integration possible between BeyondMail forms on 
the front end, and a database accessed transparently on the back end.  The client in this client/server 
application pulls information from a local database (possibly a summary of a larger database 
automatically mailed to the client), and uses it to complete a Sales Order form.  This form, once 
complete, is mailed to the server mailbox, which validates the information in the form, updates another 
database with the order, and sends a confirmation to the client.  This particular example uses a flat file 
database for the client, and has the server update a DBase database through the BeyondMail Q&E access 
layer.

REQUIREMENTS: 

*  The Q&E Database Library must be installed and in the DOS path on the agent's workstation. 
    (See the Q&E documentation for details)
*  Load the Sales Order form in the public forms database (formadm -i a:\salesord\salesord.frm -b)
*  Load the Sales Order rule set for each user (client) (import -r a:\salesord\soclient.rul),
    or install the rule set as house rules for all users (See the Administration Guide for details).
*  Copy the PICK.DLL and FILE.DLL files to the BeyondMail PUBIC\ADDIN directory.
*  Copy the SALESORD.DBF file to the BeyondMail PUBLIC directory
*  Copy the product data file (PRODUCTS.DAT) to each user's INBOX directory
*  Create a BeyondMail user to be the Sales Order Processing Agent. 
*  Load the Sales Order Processing rule set to the agent's private rules database
    (import -r ac:\salesord\user.soagent.rul)
*  Add an entry called "Sales Order Processing Agent" to the Public Address Book for the agent user.

RULE SET: Sales Order
RULE: Initialize Sales Order System
Sets global variables pointing to the location of the product data file and the Sales Order Processing 
Agent address for use by other rules.

RULE: Line x Completion
Provides button rules which load product descriptions and product numbers from the local data file and 
presents a pick list to the user when a line item button is pressed.  After a selection is made, the rule adds 
the line item to the form and totals the changes.

RULE: Validate and Send
Sets required message fields such as To and Subject, and re-calculates totals on the form before sending 
it.  This is a When Sending event rule.

RULE SET: Sales Order Processing Agent
RULE: Process new order
Validates the uniqueness of the PO number on received Sales Order forms, then adds each line item to 
the order tracking database via an SQL call.  Also, sends a confirmation to the submitting client.


========================================================================
18.  MICROSOFT EXCEL MACRO TEMPLATE: DDE Macros

Platform:		Windows only
Directory on Disk:	EXCEL
Rule Set File:		N/A
Rule Set Name:		N/A

Rather then BeyondMail rules-based applications, these are Excel .XLM files which mail-enable 
Microsoft Excel by using BeyondMail's DDE functionality.  BMEXCL30.XLM is for Excel 3.0.  
BMEXCL40.XLM is for Excel 4.0.

To use these macros all you do is open them.  They will hide themselves and add two lines to the Excel 
File menu: BeyondMail Memo and Phone Message.

To send a Memo or Phone Message just select the custom entries from the Excel File Menu and the 
appropriate BeyondMail form will pop up within your Excel window.  From the form, you can access the 
BeyondMail address books (public and private), attach files, and set handling options.

If BeyondMail is not already running on your Windows desktop, the DDE command tries to launch it.

Note:  BMAILW.EXE (usually in BMAIL\PROGRAM) must be in DOS search path or Windows will 
not 
            be able to find BeyondMail.

Warning:  If you try to attach the currently displayed spreadsheet to a message, the macro will fail with 
                  unpredictable results.  This is because the currently displayed file is "locked" and cannot be 
                  accessed by the DDE.

========================================================================
19.  MICROSOFT WORD FOR WINDOWS DOCUMENT TEMPLATE: DDE Macros

Platform:		Windows only
Directory on Disk:	WINWORD
Rule Set File:		N/A
Rule Set Name:		N/A

Rather then BeyondMail rules-based applications, these are Microsoft Word for Windows macros to 
mail-enable Word for Windows using BeyondMail's DDE functionality.  A pre-configured 
NORMAL.DOT file is supplied and a DOC file source for the macros which mail-enable Word via 
BeyondMail's DDE functionality.

To add these Word for Windows 2.0 macros to your NORMAL.DOT file, either:

Place the supplied NORMAL.DOT file in your WINWORD directory

Warning:  If you use this method, you will lose any customization you have made to your WinWord 
                  environment by editing your NORMAL.DOT style sheet.

Or, use the BMWORD.DOC file to copy the macros into your current NORMAL.DOT file:

  1.  Open BMWORD.DOC
  2.  Select the WinWord Tools Macro... menu item.
  3.  Click the Template Macros radio button.
  4.  Select the BMail macro, then click the Edit button.
  5.  Highlight the contents of the macro (in between "Sub MAIN" and "End Sub"), then select the Edit 
       Copy menu item.
  6.  Open NORMAL.DOT.
  7.  Select the Tools Macro... menu item.
  8.  Click the Global Macros radio button.
  9.  Type BMail in the edit box and click the Edit button.
10.  Place the cursor between the Sub MAIN and End Sub, then select the Edit Paste menu item.
11.  Save the NORMAL.DOT file with the changes.

Once you have installed the macros, you can send BeyondMail from Word for Windows using the Macro 
Run selection on the Tools menu.  Optionally, you can customize Word for Windows to include the mail 
macros as menu items or toolbar icons (Tools Options Menus and Tools Options Toolbar menu 
selections).  Refer to the Word for Window documentation or online help for details.

To send a BeyondMail message, select the macro, menu item or toolbar icon you configured. A popup 
dialog displays options for the message.  The options are:

* Send Memo Message
* Send Phone Message
* Send Memo with current document as attachment
* Send current document as message text
* Send current text as message text

Choose the desired option and a form pops up within your Word for Windows window.  From the form, 
you can access to the BeyondMail address books (public and private), attach files, and set handling 
options.  If BeyondMail is not already running on your Windows desktop, the DDE command tries to 
launch it.

Note:  The directory containing BMAILW.EXE must be in your DOS search path or Windows will not 
be 
            able to find BeyondMail.


========================================================================
20.  AMI PRO DDE MACROS

Platform:		Windows only
Directory on Disk:	AMIPRO
Rule Set File:		N/A
Rule Set Name:		N/A

Rather then BeyondMail rules-based applications, this is an AMI Pro macro to mail-enable AMI Pro 
using BeyondMail's DDE functionality.

To add this macro to AMI Pro:

*  Copy SUPPORT.SMM from the sample applications disk to C:\AMIPRO\MACROS.

Once the macro has been copied to the AMI Pro macros directory, you can access BeyondMail from AMI 
Pro by pressing Ctrl+2 then responding to the dialog boxes.  The first time you run the macro in your 
current AMI Pro session, a BeyondMail menu is added to your menu bar.  The menu allows you to send 
the current file by BeyondMail, or to remove the macro from memory and the menu bar.

Note:  1. BeyondMail must be running (can be minimized) on your desktop before using this macro.
            2. Although the form selection dialog box only names standard BeyondMail forms, you can
                send any BeyondMail form available at your site by entering its name in the following
                dialog box.


========================================================================
21.  WORD PERFECT FOR WINDOWS DDE MACROS

Platform:		Windows only
Directory on Disk:	WPWIN
Rule Set File:		N/A
Rule Set Name:		N/A

Rather then BeyondMail rules-based applications, this is an WordPerfect for Windows macro to mail-
enable WordPerfect for Windows using BeyondMail's DDE functionality.  This macro lets you send 
BeyondMail messages from WordPerfect for Windows version 5.2 and higher.

To load the macro 

*  Copy BEYOND.WCM from the sample applications disk to C:\WPWIN\MACROS.
*  Select the Macro menu in WordPerfect, and then click the Insert button.
*  Click the folder icon the right of the macro field, select BEYOND.WCM from the displayed list,
     and click the Select button.
*  Click OK to add the BeyondMail macro to your WordPerfect Macros menu.

Once the macro is installed, you can send BeyondMail from within WordPerfect by selecting the Beyond 
macro from the Macro menu.  When you do so, you are offered three choices:

*  Send a Memo message
*  Send a Phone message
*  Send a Memo message with current document attached

Each choice displays the appropriate BeyondMail form and gives you complete access to the BeyondMail 
address books and attachment selection features.

Note:  BeyondMail must be running (can be minimized) on your desktop before using this macro.


========================================================================
22.  BEYONDMAIL SUPPORT LOG APPLICATION

Platform:		DOS and Windows
Directory on Disk:	SUPPORT
Rule Set File:		SUPPORT.RUL
Rule Set Name:		Support Log Rules


This is a manual rule that collects information on a system experiencing a problem with BeyondMail, and 
stores it in a log file.  You do not need to run this rule unless asked to by Beyond Technical Support.

This rule runs under both BeyondMail for Windows 2.0 and BeyondMail for DOS 2.0.  When run under 
Windows, you must copy FILE.DLL from the Sample Applications Disk to the BMAIL\PUBLIC\ADDIN 
directory, and you may need to close some applications to allow BeyondMail to shell out to DOS.

REQUIREMENTS: 

*  (Windows users only) Copy the FILE.DLL from the Sample Applications Disk into the 
    BMAIL\PUBLIC\ADDIN directory.
*  Import the Support Log Rules set into your mailbox  (import a:\support\support.rul).

RULE: Support Log
This rule examines important information about your current BeyondMail environment and logs this 
information to a file called SUPPORT.LOG, in your BeyondMail INBOX directory.  This information 
includes BeyondMail configuration and log files, as well as system files of the workstation this rule is run 
from. This file can then be sent to Beyond Technical Support to help solve any problems you may 
encounter. The following files are accessed by this rule:

INSTALL.CFG, BEYOND.CFG, BMAIL.INI, CONFIG.SYS, AUTOEXEC.BAT WIN.INI, 
SYSTEM.INI, BMAIL.LOG, SETUP.LOG, BMWSERV.DAT, BMWSERV.LOG BMFILTER.INI, 
BMAILADM.LST, JOURNAL.DAT, REBUILD.LOG

In addition, the rule asks the user for a description of what they were doing when they encountered the 
problem.

Since this rule can create a very large file, a special feature allows you to specify files to exclude from 
the SUPPORT.LOG file.  This  feature is invoked by including the following parameter when asked for 
input:

          {bdx[x...]}

Where x is a single digit indicating a file to exclude from SUPPORT.LOG.

          1 - WIN.INI
          2 - SYSTEM.INI
          3 - BMAIL.LOG
          4 - SETUP.LOG
          5 - BMWSERV.DAT
          6 - BMWSERV.LOG
          7 - BMFILTER.INI
          8 - BMAILADM.LST
          9 - JOURNAL.DAT
          a - REBUILD.LOG
          * - Exclude all of the above files

Multiple digits or letters can be used to exclude multiple files.  For example, including {bd36a} when the 
rule asks "Please note anything important about this BeyondMail setup," excludes BMAIL.LOG, 
BMWSERV.LOG and REBUILD.LOG from SUPPORT.LOG.

This rule displays information about it's progress in the status line at the bottom of the BeyondMail 
screen. When it completes, it displays the location of the SUPPORT.LOG file just created.  After the 
SUPPORT.LOG file is created you are asked if you want to send it to someone.  If you answer yes, a 
Customer Support Form is created for you with the log file attached.  The default address is "SUPPORT 
@ BEYOND"; you can change this to a different address if you choose.


========================================================================
23.  SHARED FOLDERS APPLICATION

Platform:		Windows only
Directory on Disk:	SFOLDER
Rule Set File:		SFCLIENT.RUL, SFAGENT.RUL
Other Files:		SFOLDER.DLL
Rule Set Name:		N/A

This application allows users to access messages stored in one or more folders shared by multiple users.  
Users can add and delete shared folders, post messages to and delete messages from shared folders, view 
messages in shared folders, and reply to messages in shared folders.  All actions are integrated directly 
into the BeyondMail user interface through the icon bar.

This is a client-server application.  Each client (user) can access the database for read operations only.  
All write actions are handled by a central agent (server).  When the client wants to make an addition 
(new folder or message) or a deletion (delete a folder or message) to the database, the client rules 
package the transaction and send it to the shared folder agent.  

Administrators can modify the Agent rules to filter what is posted to the shared folder.  Administrators 
can also implement shared folders enterprise-wide, by having each server automatically resend 
transactions to other agents to keep folders on multiple servers synchronized.

REQUIREMENTS: 

The Shared Folders application consists of three parts:

1.  The shared folder database
2.  The agent rules used to process transactions for the shared folders (e.g., deletes and adds)
3.  The client rules required to accesses shared folders

1.  To set up the Shared Folder database:

*  Copy SFOLDER.DLL from the SFOLDER directory of the samples disk to your 
    BeyondMail PUBLIC\ADDIN directory.
*  Create a ..\BMAIL\PUBLIC\SFOLDER directory.

2.  To set up the Agent:

*  Create a new BeyondMail user (an "agent" mailbox) called "SFAGENT".  Give this user Read,
    Write, Create, and Delete access to the SFOLDER created above.
*  Import SFAGENT.RUL into the SFAGENT mailbox (import -r sfagent.rul).
*  Add SFAGENT to the BeyondMail rule server data file, so it will be continually processed.
    (See the BeyondMail Administration Guide for details).
*  Add the following entry to the BeyondMail Public Address Book:

   Name:		Shared Folder Agent
   Comment:	The Shared Folder Agent mailbox
   Address:	SFAGENT@workgroup

    Replace workgroup with the name of your local workgroup.

Note:  If you change the name of the agent to something other than "Shared Folder Agent,"
           you must edit the "Initialize Shared Folder System" rule in the Agent mailbox and each 
           Client mailbox to reflect the new name.


3.  To set up each Client

*  Import SFCLIENT.RUL into the user's BeyondMail mailbox (import -r sfclient.rul).
*  Add rule icons for the Get a Shared Folder Message and the Shared Folder Options rules to
    the user's icon bar (File-Configure-IconBar-Configure).
*  Optional.  Add a drop well icon for the Add a Message to a Shared Folder rule.

Note:  These steps must be performed for each user accessing the shared folders.

USING SHARED FOLDERS 

The user clicks the icon tied to the "Get a Shared Folder Message" rule to enter the Shared Folder system. 
Running this rule presents the user with a list of Shared Folders to choose from.  When the user selects a 
folder, a summary view of the folder's contents is displayed.  Once a message is selected, the message is 
displayed along with the following option buttons:

*  Previous to display the previous message in the folder.
*  Next to display the next message in the folder.
*  Reply post a reply to the message in the shared folder.
*  Delete to remove the message from the shared folder.

Clicking the icon tied to the "Shared Folder Options" rule, displays a list of shared folders and gives the 
user the options of adding or deleting Shared Folders.

The optional "Add a Message to a Shared Folder" rule icon gives the user the ability to add existing 
messages from their private folders to a Shared Folder by dragging the message and dropping it over the 
dropwell. The rule then prompts them to select a Shared Folder to add the message to, packages the 
message, and sends it to the agent for addition to the Shared Folder. 


Shared Folder Replication

The Shared Folder application can keep Shared Folder Agents synchronized across a Wide Area Network 
by means of transaction replication. Each time a client transaction is processed on the local agent, the 
transaction is sent to the other participating Agents to be replicated in those databases. 

The replication process is controlled by creating a distribution list called 'Shared Folder Participating 
Agents" in each agent's Private Address Book.  As each transaction is processed, this list is checked.  If 
the list exists, each transaction is resent to the all the Shared Folder Agents included in the list.


Options and Modifications

By default, the Shared Folder database uses the BeyondMail PUBLIC directory as it's root directory. You 
can be change the root directory by changing the sfRootDir variable in the "Initialize Shared Folder 
System" rule to point to another directory.  You must create an SFOLDER subdirectory under the 
directory you point to, and you must change the sfRootDir variable in both the Agent and each Client.

By default, the Shared Folder Agent saves each transaction message and it's status to a private logging 
folder named "Transaction Logging."  The information in this folder is useful for such things as providing 
load statistics and retrying failed transactions.  You can turn off logging by modifying the "Initialize 
Shared Folder System" rule in the Agent mailbox. to set the sfTransactionLogging variable to False.

You can restrict the ability to add and delete Shared Folders to only authorized personnel by not 
assigning an icon to the "Shared Folder Options" rule, or deleting the rule entirely.  The rule itself could 
be modified to only allow the Addition of Shared folders by changing the "alert3" call to an "alert2", for 
example.

The ability of the user to Delete a shared message can be restricted by editing the "Get a Shared Folder 
Message" rule to remove the processing of the delete selection.  The button itself can't be removed from 
the dialog, but the processing of the selection can be modified to display an appropriate alert message 
rather than actually delete the message.

Warning:  Be careful not to change the way the selections are processed beyond removing them entirely, 
                  as this may adversely affect the system. See below for details on the SFOLDER addin calls.

On the Agent side, filtering rules can be added to restrict transactions which match certain criteria.  For 
example, you could add a rule set called "Shared Folder Transaction Filters" and position it BEFORE the 
"Shared Folder Agent" rule set in the rule set list.  Then, add a rule to this new rule set which looks for 
socially unacceptable swear words in the [Text] or [Original Text] attributes of incoming messages and 
deletes the message if found.  This will keep such messages from being added to Shared Folders.

The remainder of this application documentation outlines the rules and functions used in the Shared 
Folder application.

Caution:  This information is provided for reference only.  The rules and functions in this application are 
                 highly interdependent.  You should not attempt to modify these programs beyond the options
                 listed above unless you are an expert level BeyondRules programmer.

RULE SET:  Shared Folder Agent
RULE:  Move Shared Folder Transaction Requests
Screens incoming mail for shared folder transaction requests and queues requests for processing.

RULE:  Add a Shared Folder
Processes requests to create a new shared folder.

RULE:  Delete a Shared Folder
Processes requests to delete a shared folder.

RULE:  Add a Shared Folder Message
Processes requests to add a message to an existing shared folder.

RULE:  Delete a Shared Folder Message
Processes requests to delete a message from an existing shared folder.

RULE:  Initialize a Shared Folder Message
Sets up variables used by the shared folder application.

RULE SET: Shared Folder Client
RULE:  Initialize Shared Folder System
Sets up various variables used by the shared folder application.

RULE:  Get  a Shared Folder Message
Sets up general client user interface for the shared folder application.

RULE:  Shared Folder Options
Sets up client user interface for adding and deleting folders.

RULE:  Add a Message to a Shared Folder
Accepts dropped message for addition to a hared folder.  Prompts for folder, then packages and sends the 
message appropriately.

RULE:  Package Message for Shared Folder Agent
Intercepts new messages being sent to the shared folder agent, prompts for a folder, then packages the 
message for inclusion in a shared folder and sends it.

DLL FUNCTION CALLS: 
In the function calls below:

- publicPath       is the root directory which contains the SFOLDER subdirectory, 
                           for example d:\BMAIL\PUBLIC.
- folderName     is the folder name as returned by a GetSFolder call, or, in the case of PutSFolder, 
                           a string denoting the name of the folder. 
- msgText          is the [Text] attribute of the message being added.
- msgOrigText   is the [Original Text] attribute of the message being added. 
- msgHeader     is a string built of attributes of the message to be added, as follows (using the caret as 
                           delimiter, and leaving a trailing delimiter):

                         Date^From^Subject^To^CC^

FUNCTION: SFOLDER.GETSFOLDER (publicPath)
Provides pick of all shared folders.  Returns a string containing name of the selected folder or an empty 
string if Canceled.

Returns one of the following status values in the result variable:

          ADN_STATUS_BAD_ARG_CNT
          ADN_STATUS_BAD_ARG_TYP
          SF_STATUS_ARG_OUT_OF_RANGE
          SF_STATUS_BAD_PATH
          SF_STATUS_MEM_ALLOC_ERR
          SF_STATUS_READ_ERR
          SF_STATUS_EMPTY_FILE
          SF_STATUS_OK


FUNCTION: SFOLDER.GETSFMESSAGE (publicPath, folderName)
Provides pick of messages in a folder.  Returns the empty string, a string for replies of the format:  
date^from^subject^to^cc^msgtxtpath^msgorigtxtpath^, or a string for deletes containing the tag of 
the message.

Returns one of the following status values in the result variable:

          ADN_STATUS_BAD_ARG_CNT
          ADN_STATUS_BAD_ARG_TYP
          SF_STATUS_ARG_OUT_OF_RANGE
          SF_STATUS_BAD_PATH
          SF_STATUS_ITEM_NOT_FOUND
          SF_STATUS_MEM_ALLOC_ERR
          SF_STATUS_READ_ERR
          SF_STATUS_EMPTY_FILE
          SF_ACTION_DELETE
          SF_ACTION_REPLY
          SF_STATUS_OK


FUNCTION: SFOLDER.PUTSFOLDER (publicPath, folderName)
Adds a shared folder.

Returns one of the following status values in the result variable:

          ADN_STATUS_BAD_ARG_CNT
          ADN_STATUS_BAD_ARG_TYP
          SF_STATUS_ARG_OUT_OF_RANGE
          SF_STATUS_FOLDER_EXISTS
          SF_STATUS_INDEX_GEN_ERR
          SF_STATUS_BAD_PATH
          SF_STATUS_ERR_TEMPFILE
          SF_STATUS_ERR_DATAFILE
          SF_STATUS_OK

FUNCTION: SFOLDER.PUTSFMESSAGE (publicPath, folderName,  msgHeader, msgText,
                   msgOrigText)
Adds a message to a shared folder.

Returns one of the following status values in the result variable:

          ADN_STATUS_BAD_ARG_CNT
          ADN_STATUS_BAD_ARG_TYP
          SF_STATUS_ARG_OUT_OF_RANGE
          SF_STATUS_BAD_PATH
          SF_STATUS_ITEM_NOT_FOUND
          SF_STATUS_INDEX_GEN_ERR
          SF_STATUS_ERR_TEMPFILE
          SF_STATUS_WRITE_ERR
          SF_STATUS_ERR_DATAFILE
          SF_STATUS_OK


FUNCTION: SFOLDER.DELETESFOLDER (publicPath, folderName)
Deletes a shared folder.

Returns one of the following status values in the result variable:

          ADN_STATUS_BAD_ARG_CNT
          ADN_STATUS_BAD_ARG_TYP
          SF_STATUS_ARG_OUT_OF_RANGE
          SF_STATUS_BAD_PATH
          SF_STATUS_ITEM_NOT_FOUND
          SF_STATUS_INDEX_GEN_ERR
          SF_STATUS_ERR_TEMPFILE
          SF_STATUS_ERR_DATAFILE
          SF_STATUS_OK


FUNCTION: SFOLDER.DELETESFMESSAGE (publicPath, folderName, msgTag)
Deletes a message from a shared folder.

Returns one of the following status values in the result variable:

          ADN_STATUS_BAD_ARG_CNT
          ADN_STATUS_BAD_ARG_TYP
          SF_STATUS_ARG_OUT_OF_RANGE
          SF_STATUS_BAD_PATH
          SF_STATUS_ITEM_NOT_FOUND
          SF_STATUS_READ_ERR
          SF_STATUS_INDEX_GEN_ERR
          SF_STATUS_ERR_TEMPFILE
          SF_STATUS_ERR_DATAFILE
          SF_STATUS_OK

SFOLDER addin function Error Codes are:

          SF_STATUS_OK				    0
          SF_STATUS_CANCEL			100
          SF_STATUS_ARG_OUT_OF_RANGE	101
          SF_STATUS_BAD_PATH		102
          SF_STATUS_READ_ERR		103
          SF_STATUS_WRITE_ERR		104
          SF_STATUS_FOLDER_EXISTS		105
          SF_STATUS_MESSAGE_EXISTS	106
          SF_STATUS_MEM_ALLOC_ERR	107
          SF_STATUS_EMPTY_FILE		108
          SF_STATUS_ITEM_NOT_FOUND	109
          SF_STATUS_INDEX_GEN_ERR		110
          SF_STATUS_ERR_TEMPFILE		111
          SF_STATUS_ERR_DATAFILE		112
          SF_STATUS_TOO_LONG		113
          SF_STATUS_SEEK_ERROR		114
          SF_STATUS_EOF			115
          SF_STATUS_ERR			116

          SF_ACTION_REPLY			    1
          SF_ACTION_DELETE			    2


========================================================================
24.  SAMPLE ADDIN FUNCTIONS

Platform:		Windows only
Directory on Disk:	ADDINS
Rule Set File:		N/A
Other Files:		N/A
Rule Set Name:		N/A

The Sample Applications disk also provides four sample add-in functions created with the BeyondMail 
Add-in Toolkit.  These DLLs are useful as is for developing BeyondMail applications, and also illustrate 
the type of functions that can be created with the Add-in Toolkit.  The sample functions are:

*  BMHELP.DLL for calling BeyondMail help from a rule.
*  BMSOUND.DLL for playing .WAV sound files from a rule.
*  FILE.DLL for accessing a DOS-level file from within a rule.
*  PICK.DLL for providing Windows pick lists from within a rule.

Each add-in function is explained in detail below

BMHELP.DLL

The BMHELP add-in provides Windows Context Sensitive Help for custom forms through rule buttons 
on the forms.  The BMHELP add-in provides two functions. 

FUNCTION: bmhelp.Help ("path", "index')
Starts the Windows Help system for the user.  Returns 0.

The pathname argument provides the path to the Windows help file the user wants to use.

The Index argument is aeither "0" or a positive integer. If  0, the Help File is displayed with the 
index/contents page visible.  If an integer is used, the Help File is displayed with the topic indexed by 
that integer visible.

Note:  If BeyondMail's help system is running when this function is called, BeyondMail help will be
            replaced by help file specified in the call.  The next time BeyondMail help is called, it will 
replace
           the form's help system.

FUNCTION: bmhelp.Quit ("path")
Exits the Windows Help system associated with BeyondMail.  Return values: 0

The path argument provides the path to the help file being closed.


BMSOUND.DLL
Plays a waveform sound file.  Return:  nothing.

FUNCTION:  bmsound.play(name)
Pays a waveform sound file.

The name argument provides the name of the .WAV file to be played.  This argument must contain the 
path to the file, or the file must be in the path specified in the [Sounds] section of WIN.INI.

Returns one of the following status values in the result variable:

          0 for success
          1 if unable to play the specified sound


FILE.DLL
Provides functions for manipulating DOS files from within a rule.

FUNCTION: file.open(path:string, access:string) : integer
Opens a file in the specified access mode.  When finished using the file, use file.close() to close it.  
Returns an "abstract" handle for the file, which can be passed to other functions in this FILE add-in.

The path argument specifies the file name and, if necessary, the path to the file.

The access argument specifies the access mode for file.  Can be one of the following:
          "r"      Read access; file must already exist.
          "w"    Write access.  Creates file or destroys existing file contents.
          "a"     Write access.  Opens or creates file with file pointer at end of file.
          "r+"    Like "r", but read/write access.
          "w+"  Like "w", but read/write access.
          "a+"   Like "a", but read/write access.

Example:   set taxfile to file.open("TAXES.DAT", "r");

Returns one of the following status values in the result variable:

          0  for success
          1 if unable to open file in given access mode.

FUNCTION:  file.read(handle:integer) : string
Reads and returns a single line from the open file.  Assumes the line is terminated with carriage return, 
carriage return followed by line feed, or the end-of-file.  Also assumes the line is at most 1024 characters 
long.  Returns the line read from the file, with carriage return and line feed (if any) removed.

The handle argument specifies the file handle returned by file.open().

Example:  set textline to file.read(taxfile);

Returns one of the following status values in the result variable:

          0 for success
          1 if unable to read from file.
          2 if input line is longer than 1024 characters.
          3 if no further input available from file.


FUNCTION:  file.write(handle:integer, value1, value2, ...) : integer
Writes any number of values to a single line in the open file followed by a single carriage return and line 
feed.  The values can be of any type.  Each value is converted to a string before being written to the file.  
If a file handle is supplied with no values, a blank line (just a carriage return and line feed) is written to 
the file.  Returns the total number of characters written to the file, including the trailing carriage return 
and line feed.

The handle argument specifies the file handle returned by file.open().

Example:  set count to file.write(taxfile, "Tax rate = ", taxrate, "%");

Returns one of the following status values in the result variable:

          0 for success
          1 if unable to write to file.


FUNCTION:  file.close(handle:integer) : nothing
Closes a file previously opened with file.open().  Returns nothing.

The handle argument specifies the file handle returned by file.open().

Example:   file.close(taxfile);

Returns one of the following status values in the result variable:

          0 for success
          1 if unable to close file.


FUNCTION:  file.delete(path:string) : nothing
Deletes the specified file.  Returns:  nothing.

The path argument specifies the file to be deleted.  Include the path name if necessary.

Example:   file.delete("TAXES.DAT");

Returns one of the following status values in the result variable:

          0 for success
          1 if unable to delete file.


PICK.DLL
Offers three functions for picking items from Windows a modal dialog box.

*  ListPick for picking from a list,
*  OpenFileName for picking an existing file, typically to be opened, copied, etc.
*  SaveFileName for picking a name and location for a new file, typically to be created.

FUNCTION: pick.ListPick (title: string, aList: list of strings, sort: Boolean, initial: string) : string

This function brings up a modal dialog with a list in it.  Arguments supply a title for the dialog, the list of 
values, an initial value to select in the list, and whether or not to sort the list's contents.  The interface is:

If no initial value is given, the first list element, if any, is selected.  If OK is clicked, the currently 
selected list element is returned.  If Cancel is clicked, an empty string is returned.

Example:

set aList to list("apple", "orange", "nectarine", "kiwi", "passion fruit", "persimmon", "plantain");
set aFruit to pick.ListPick("Fruits of the World", aList, true, "nectarine");

Displays a list picker dialog box titled "Fruits of the World" with "nectarine" selected as the default.


FUNCTION: pick.OpenFileName(initial: string, title: string, filter: string) : string
Displays a standard Windows 'Open a File' dialog box so the user can pick an existing file.  If OK is 
clicked, the currently specified file path is returned as the string-valued function result.  If Cancel is 
clicked, an empty string is returned.

The initial argument specifies a file name to suggest to the user.  Its drive and directory are used to prime 
the dialog's drive and directory controls.  It may be an empty string.  If no drive or directory is given, the 
current one is used.  If no file name is given, no default file is shown in the dialog box.

The title argument specifies a title for the dialog box.

The filter argument specifies file filters and their corresponding prompts in the "List Files of Type" 
dropdown list.  The filter argument must consist of pairs of prompts and filter wild card expressions, 
separated by the some other character.  Typically, the vertical bar "|" is used as the separator.

Example: set aFileName to pick.OpenFileName("c:\report.txt", "Pick a File", "Text files 
(*.TXT)|*.txt|All files (*.*)|*.*|");

Produces a dialog box titled, "Pick a File" with "report.txt" shown as the default in the File Name text 
box and "Text file (*.TXT)" as the default in the List File of Type dropdown list.  The dropdown list 
would also contain "All files (*.*)" if the user displays the list.

Note:  To use this function, you must be running Windows 3.1 or later, or instal the COMMDLG.DLL 
            library from Windows 3.1 into your Windows 3.0 system.


FUNCTION: pick.SaveFileName(initial: string, title: string, filter: string, defaultExtension: string) : 
string
Displays a standard Windows 'Open a File' dialog box so the user can enter a filename for saving a file.  
If the user supplies the name of an existing file, the function confirms with the user whether overwriting 
is acceptable.  If OK is clicked, the currently specified file path is returned as the string-valued function 
result.  If Cancel is clicked, an empty string is returned.

The initial argument specifies a file name to suggest to the user.  Its drive and directory are used to prime 
the dialog's drive and directory controls.  It may be an empty string.  If no drive or directory is given, the 
current one is used.  If no file name is given, no default file is shown in the dialog box.

The title argument specifies a title for the dialog box.

The filter argument specifies file filters and their corresponding prompts in the "List Files of Type" 
dropdown list.  The filter argument must consist of pairs of prompts and filter wild card expressions, 
separated by the some other character.  Typically, the vertical bar "|" is used as the separator.

The OpenFileName argument specifies a default file extension to use if the user does not enter one.

Note:  To use this function, you must be running Windows 3.1 or later, or instal the COMMDLG.DLL 
            library from Windows 3.1 into your Windows 3.0 system.

