PROGRAM MAILX C CCC TSX+ MAIL SYSTEM VERSION 2.14 CCC C**************************************************************************** CCC CCC LOYOLA EMC LAB CCC CONCORDIA UNIVERSITY CCC CCC This program may be copied / modified in any way by any TSX user. CCC The author would appreciate a copy of any changes or alterations CCC made to this program, either by sending an RX01/RX02 floppy or CCC by BITNET to the author at the address below. CCC C**************************************************************************** CCC CCC JAN /87 CCC CCC MIKE MARAK / (with help from DAVID GAUDINE) CCC LOYOLA EMC LAB CCC Dept. of Electrical and Computer Engineering CCC LOYOLA CAMPUS, CONCORDIA UNIVERSITY CCC AD-532 CCC 7141 SHERBROOKE ST. W. CCC MONTREAL, CANADA CCC CCC PHONE: (514) 848-3118 CCC BITNET ADDRESS (NETNORTH) : MUFFY@CONU1 CCC C**************************************************************************** CCC CCC (D) indicates distribution sent to DECUS CCC Bn indicates BUG number CCC C*************************************************************************** CCC CCC V2.14 Sep/29/88 (D) Change MENU to list priv. commands only to CCC priv.users. CCC V2.13 Sep/01/88 Change the MENU slightly to show all options. CCC V2.12 Jul/21/88 Allow user to specify the device to print CCC messages to. The filename is fixed as CCC MSG.nnn CCC Allow .d and .a, as well as .D and .A CCC V2.11 Jul/04/88 Allow a user to REPLY then DELETE a message CCC V2.10 May/31/88 Do not send "YOU HAVE MAIL" message to CCC AUTO-START lines. ie: lines with PPN=0,0 CCC V2.09 Feb/29/88 Put in CLOSE(UNIT=2) in GETFIL. The unit was CCC not closed if the file specified produced an CCC error. Therefore, subsequent tries produced CCC errors. CCC V2.08 Feb/16/88 Removed the N option, as the R[,username] is CCC more convenient. Changed the input option CCC checking from GETIN to SYSLIB GTLIN. CCC Added an 'ABORT MESSAGE'(.A) option and CCC .D to terminate messages. CCC V2.07 Feb/16/88 Fix a bug that if the system date is not set, CCC the message header was not fully printed when CCC reading mail. The default date is 1-Jan-72 CCC V2.06 Feb/16/88 If a null name is used with N, the name CCC defaults to the USERNAME. CCC Allow a priv. user to 'R[,username]' to read CCC the username's mail. CCC V2.05 Feb/15/88 Add N (name change) option. CCC V2.04 Feb/15/88 Fixed a bug the when the R (reply) option was CCC selected, and a message before was to be CCC deleted, the delete was not done. CCC Changed the method of deleting messages to CCC an array of deletes (IDEL) from the CCC 'MARK FOR DELETE'. CCC Put in a constant MAXMSG for the maximum CCC number of messages (30) that are allowed. CCC Changed the logic for deleting messages. Get CCC ACCESS after all messages are read. Cleared CCC flags when exiting routines. CCC V2.03 Feb/08/88 Allows sending messages from a file instead CCC of typing them in. Change the input buffer CCC size from 1000 bytes to 1026 bytes (2 blocks) CCC Fixed a bug in 'TEST' that continued to test CCC over 5 blocks of mail file if the particular CCC mail-file was full. CCC Put in a flag (FOUND) for the F command file. CCC V2.02 Feb/01/88 Fixed code in PRINT-MESSAGE option CCC V2.01 Jan/29/88 Always ALERT-USER of mail CCC V2.00 Nov/20/87 Add routine RWBLK to replace routines RDBLK CCC and WTBLK. Read/write is determined by a CCC paramater passed (1=READ,0=WRITE). CCC Add a REPLY-TO-MESSAGE option while reading CCC mail. CCC Discovered a bug in the WRITE-TO-ALL option. CCC Moved the CALL SCCA out of the loop to after CCC the channel is freed. CCC Moved code to CLOSE and FREE the opened file CCC from routine WMAIL to .MAIN. CCC Modified the ALERT routine to send a message CCC to all lines the user may be on, and not to CCC stop checking after the first line found. CCC Add an ABORT-READING-MAIL option while CCC reading mail. CCC Dec/ 2/87 Changed the PROGRAM statment name from MAIL to CCC MAILX. F77 does not like you to have variable CCC and program names the same. CCC Dec/ 2/87 Changed the FUNCTION calls for TSXLIB routines CCC to subroutine CALLS, thus allowing running CCC MAIL under F77 as well as FORTRAN. F77 gives CCC an odd address trap for TSXLIB functions. CCC Dec/ 4/87 Changed the ABORT-READING-MAIL option to CCC QUIT-READING-MAIL . CCC Dec/ 9/87 Does not exit if requested username does not CCC exist. Only gives a message and returns to CCC the menu. CCC Dec/16/87 Initialize MBUF in GETMSG as this buffer was CCC not cleared properly after a send message. CCC Dec/22/87 Fixed a bug in the WRITE-TO-ALL option. If an CCC un-privileged user selected option A, the CCC ALL flag was not properly cleared. CCC Jan/25/88 Put test version into release. Changed hello CCC message. CCC C*************************************************************************** CCC FINAL RELEASE OF V1. NO NORE UPDATES TO BE DONE. ALL NEW WORK ON V2. CCC CCC B3 V1.14 Nov/23/87 Change position of CALL SCCA CCC V1.13 Aug/18/87 (D) Add a PRINT MESSAGE option (print to unit 6). CCC V1.12 Aug/18/87 Fix up V1.11. Set JSW to UC for response. CCC Put ALERT message in a DATA statement. Get CCC rid of compiler warning message for WMAIL. CCC V1.11 Aug/13/87 Add an option to inform the destination user CCC (if logged on) that a message has just been CCC sent to him CCC V1.10 Aug/11/87 Change the output of the message date from CCC "11/ 8/87" to "11-Aug-87" CCC V1.9B Jun/18/87 Change the output of the message time from CCC " 9: 6: 6" to " 9:06:06" CCC V1.9A Jun/16/87 Allow only privileged users to use option 'A'. CCC V1.9 Jun/15/87 Add an option 'A' to allow sending messages CCC to ALL users. CCC V1.8 Jun/ 4/87 Add an option 'M' to allow users to only CCC see how many messages there are. CCC V1.7 Jun/ 2/87 If a user has mail, inform them how many CCC messages there are. CCC B2 V1.6 Apr/13/87 Clear the ACCESS byte in IOFSET(1) and the CCC MARK FOR DELETE bit (200) to allow a CCC user to read mail on a line when deleting on CCC another line. This will allow for only CCC 127 messages. CCC V1.5 Apr/ 4/87 Change MAIL SENT messages CCC B1 V1.4 Mar/19/87 (D) WUNAME initialized to NULLS in WMAIL CCC V1.3 FEB 87 (D) Change the logic for running from either CCC LOGON or COMMAND FILE. Now allows options on CCC command (MAIL [COMMAND] ) line CCC V1.2A FEB 87 Clean up of source file. Change TYPE to WRITE CCC V1.2 FEB 87 Put the directory in encrypted format CCC V1.1 FEB 87 Add encryption (IOFSET(J)=-IOFSET(J)) to CCC messages CCC V1.0 DEC 86 - FEB 87 First version C**************************************************************************** CCC CCC This program implements an online mail system under TSX+. CCC This program offers some security by only allowing users to read CCC mail in their own mailbox. (This can be bypassed by using the CCC NAME program) CCC Security is also provided by simple encryption (I=-I) of the mail CCC file (SY:MAIL.XXX), both directory and messages. CCC CCC The postoffice is a file (SY:MAIL.XXX) set up as follows CCC BLOCK 0 DIRECTORY CCC BLOCK 1 DIRECTORY CCC BLOCK 2 DIRECTORY CCC BLOCK 3 - 7 BOX 1 CCC BLOCK 8 - 12 BOX 2 CCC BLOCK 13 - 17 BOX 3 CCC BLOCK 18 - 22 BOX 4 CCC ........ CCC BLOCK 94 - 98 BOX 19 CCC CCC The directory is set up as: CCC USERNAME 12 BYTES ! 0 - 12 ASCII TSX USER NAME CCC OFFSET 1 WORD ! 14 *** NEVER ALTER THIS VALUE CCC EXTEND 1 WORD ! 16 RESERVED CCC CCC The mailfile should be created using POSTMN, which will also CCC ADD/LIST/DELETE USERNAMES. It will also create a proper sized CCC mailfile for the number of users requested CCC CCC Using this setup, there is enough space for 19 mailboxes, CCC although the directory has space for 96 entries. This setup CCC allows for easily extending the size of the mail file (MAIL.XXX). CCC Each user is allocated 5 blocks for their mail. CCC CCC Each message is limited to 1000 bytes, including many control char. CCC CCC USERNAMES MUST BE THE SAME FORMAT AS TSX LOGON NAMES CCC CCC A user whose USERNAME is not in the mail directory will be advised CCC of this when trying to read mail. However, writing mail will work, CCC provided the destination USERNAME exists in the directory. If not, CCC the user is informed of such. CCC CCC Only one user at a time may write (update/delete/add) to a specific CCC mailbox at one time. This provides some access control on each CCC mailbox. CCC CCC The occasions for running MAIL are: CCC 1 - On logging on to the system, MAIL checks for any CCC mail in the users mailbox. If there is mail, it CCC asks if the user wants to read the mail, else CCC the program exits. CCC 2 - If the user wants to send another user a message. The CCC program tests for mail. If there is any, it asks if CCC read or send. If there is no mail, it asks only if CCC send. CCC 3 - If the user wants to read and/or delete their messages, CCC the program tests for mail. If there is any, it asks CCC if read. If read, it lists and/or deletes the messages CCC 4 - If a user wants to see how many messages there are in CCC their mailbox. CCC CCC MAIL MUST BE RUN FROM A COMMAND FILE. Suppose the mail program is on CCC SY:MAILX.SAV. For LOGON, the STARTUP file should contain CCC CCC ^(@SY:MAIL.COM L CCC CCC The command file should be CCC CCC R MAILX CCC ^1 CCC CCC To envoke MAIL, the user simply types "MAIL [OPTIONAL COMMANDS]". If CCC no command is entered, MAIL executes normally, giving a menu of all CCC valid commands. If an optional command is entered, the operation is CCC done and then MAIL exits. CCC CCC The current options are: CCC MAIL Run MAIL in standard mode (menu driven) CCC MAIL R[,un] Read mail (assumes there is mail) CCC MAIL S Send mail to a user CCC MAIL L Run MAIL in LOGON mode CCC MAIL M[,un] Run MAIL to see how many messages CCC MAIL A[,F] Run MAIL to send a message to all users CCC MAIL F Run MAIL to read the message from a file