Better Control of large messages over a Router.

cc:Mail allows you, the admin, to set call list options that prohibit the sending of large messages during certain times of the day.  The problems with this system are:


The user does not know if the message is delayed.
	The message waits in the queue until it is release.

To get around the problem we have developed an alternative plan called the Email Agent.  This program allows the administrator to setup rules for delay and deletion of messages, along with user notification.

How does the cc:mail side work?  

In our example our Hub Post Office will be calling the subordinate Post Office JCONSULT over a dialup Modem connection.  Notice that we have setup 4 different entries for our call list:


1	During the peak weekday hours (8Am to 4PM )we are going to stop any mail over 100K in size.
2	During the off hours Monday to Friday we are going to stop any message over 1M in size.
3	During the peak weekend hours we will stop any message over 500K in size.
4	And finally on the off-peak weekend hours we will stop all mail over 2.5M in size.

In a small cc:Mail network, this would not put a big burden on the cc:Mail administrator.  Whenever they noticed a message stuck in the queue, they could log into the queue and delete the message.  But now consider a global organization with 5 or 6 Hubs and over 120 Post Offices.  This is now a n administrative nightmare.  Plus add in the fact that all these call list entries for each Post Office will quickly make the best of admins crazy.  

So we developed the Email Agent.  The idea of the program is to develop:

Delay limits allow you to determine what size cc:mail message will trigger the sending of an automated response back to the user explaining the delay. 
	Destroy limits are set to Delete all cc:Mail messages found in the queue over a certain size and send an automated message back to the sender explaining what happened.

This setup has one disadvantage as we can only setup a single layer for each limit, or we can not determine that 100K messages should be delayed till the weekend and then 500K message should be delayed until off hours.  We can only determine that 100K messages should be delayed.

The big advantages are:


We can setup each Post Office in it's own manner, and with it's own limits.
	We can send automated messages to both the senders and administrators telling them when a message is delayed or deleted.
	The settings can be changed with somewhat ease (2 steps) by anyone with rights to the Email Agent Directory. 
	Create a EAGENT directory as a subdirectory of your Router directory and copy all the EAGENT files into that directory.
	Make sure that either the ADMIN file directory is in your Path or IMPORT.EXE, EXPORT.EXE and ADMIN.RI are copied to the EAGENT directory.
	On your Desktop create an ICON for the BADMIN program, found in your EAGENT directory.
	Start up the new BADMIN program you just added to your desktop.

Time ---Pri-- Post Office / Person ---Exch--Min#-Size----Days---Hours-Con-Lst-
   Auto       | L | JCONSULT           |MDB___|   0|     100|_MTWTF_| 8-16|s/r|  1 |
   Auto       | L | JCONSULT           |MDB___|   0|   1000|_MTWTF_|17- 7|s/r|  1 |
  Auto/60   | L | JCONSULT           |MDB___|   0|   2500|S______S|17- 6|s/r|  1 |
  Auto/60   | L | JCONSULT           |MDB___|   0|     500|S______S| 8-16|s/r|  1 |


Change all the fields to resemble the information about your cc:Mail Post Office.
	These changes should include the name of the Post Office in which your Routers run on.  Also, that Post Office adminOs password and the path of that Post Office (Where CLANDATA lives) as the Router itself sees it.  Also, add in the top 4 administrators to this Post Office (You have to choose at least one).
	Select Manage, PO List
	Now add in each Post Office in which you will use Barrier. You will notice that the Post Office listed in your first screen will appear already.  You should not delete this Post Office.
	When adding a New Post Office you must fill in the following information:
	The Post Office password is the password of the HUB Post Office.  This can be confusing, so hang on.  What we are trying to do is look at the Post Office queue on your Hub Post Office (The one entered on the first screen).  So we need to enter this password for all the Post Offices we add.   

The Post Office path is used for looking at the connection dates of users.  If you do not care for this option or the Post Office is not connected via a LAN to the system, then type in NONE.
	Exit out of all the screens and choose File, Save from the main screen.  Then exit the program.
	Next we go to the admin program of your cc:Mail Hub and enter the call list.
	At this point we need to decide the limits we are going to set for our system.  At the beginning of this article we decided to connect to JCONSULT and delay all message over 100K during the day and delete all mail over 2.5MB.  
	You need to enter the call list entries for the Post Office which you are setting up with all the restrictions and place them down on a piece of paper so you can call them up a little later.  What we are looking for:

1.	Delay size
2.	Delay until
3.	Delete size.

Now we go back to the BADMIN program and select MANAGE, PO DATA.  You will notice that your Hub Post Office has a blank screen, compared to the one below.  If you select a Post Office we are calling, then the following screen will show up.
	For each Post Office we are going to enter the following information:

1	Queue Limit - If the queue backs up by so many messages, a message will be delivered to each admin listed on the front screen.
2	Delay Size Limit - Is the Delay Size we noted in our Call List.
3	Delete Size Limit - Is the Delete Size we noted in our Call List.
4	Max User Connection Days is used in the secondary article about Barrier (next Month) where we look at when users log into their Post Office and alert when they don't login after a certain amount of days.
5	Delay Time - This is the delay until that we noted in our Call List.
6	Maximum no Connection Time - If a connection to a Post Office extends past this number of minutes ,the administrator(s) will be notified.
7	Security Guard - If clicked this will let certain users (set in the security file) ignore these limits and send anything they want.   I call this the AdminOs back door.

The remaining bottom half of the screen will be filled with information from the last run of the program.  So you can go into this program, after it is running, and get information about what it has done or the last time it ran.

Now everything is ready to run and work.  First note is that up to this point the other side of the connection must be setup in the same way.  On that side you must setup everything as if you are calling the Hub Post Office.

The final step is to decide how you want the program to run.  In the installations I have done, there have been 3 ways of setting the program up.


Setup a Router to run EAGENT.EXE every 5 minutes and check all the Post Offices.  This means that there is a chance that a message may sneak through during those 5 minutes and clog the Router.

Setup a dedicated PC to run the program continually.  This would mean that the program would probably check each Post Office every 2 or so minutes and cut down on the chances of clogging a Router.

echo off
IF "%2" == "PRE" GOTO pre
IF "%2" == "MID" GOTO end
IF "%2" == "POST" GOTO Post
:pre
REM Run Barrier before connecting
cd \crouter\eagent
eagent
GOTO end
:Post
goto end
:end

Prepare a 3-CALL Batch file for each Post Office.  Problem is that this system only runs when one Post Office is being setup via Barrier.  If you use many Post Offices with Barrier, this system would run through each time you called one of the Post Offices.

