M M A III L M M M M AAA I L M MMM M A A I L M M M A A I L M M AAAAAAA I L M M A A I L M M A A III LLLLLL MAIL - AN ONLINE MAIL SYSTEM FOR TSX+ INTRODUCTION Mail is on online message sending system designed to run under TSX-PLUS. It allows users to send messages to other users, and to read messages that have been sent to them. Mail can be run from a logon command file or as a keyboard command (MAIL). This release of MAIL (V1.13), fixes a few bugs in the previ- ous release (V1.4). It also adds some new options (M - number of messages, A - write to all, ALERT user of MAIL), as well as cle- aning up a few irritants of the origional release. MAIL - AN ON-LINE MAIL SYSTEM FOR TSX+ Page 2 Basically, MAIL is used for inter-user messages. The MAIL system consists of six files, listed below. MAIL.XXX Default system mail file (post office) POSTMN.TSX Postmaster program for maintenance and setup MAILX.SAV MAIL utility program for reading/sending mail MAIL.COM System command file for running mail MAIL.DOC This documentation MAIL.BLD COMMAND FILE to build the MAIL system The mail file, MAIL.XXX, is a common file, accessable by all users, that contains the list of current users, and any messages for each user. The maintenance program, POSTMN.TSX, allows the postmaster (system manager) to create a new mail file, add or delete users, and extend the mail file. The MAIL utility, MAILX.SAV, is the program for allowing users to read their mail, delete their mail, or send mail to another user. The system com- mand file, MAIL.COM, is used to tell the utility program if MAIL has been envoked from LOGON or by the user. MAIL - AN ON-LINE MAIL SYSTEM FOR TSX+ Page 3 MAIL.XXX This file is used to store USERNAMES, their addresses, and the messages for each user. Its initial size is determined by the number of users requested in the setup program (POSTMN.SAV), according to the formula: SIZE = ( USERS * 5 ) + 3 This format reserves 3 blocks for USERNAMES and ADDRESSES ( a type of directory ), and 5 blocks of messages for each user, with a default value of 19 and a maximun of 96 users. Therefore, the mail file is between 98 and 483 blocks in size. Note that although the mail file is similar in format and status (protected file), IT IS NOT A LD (logical device) DISK. Do not attempt to MOUNT or INITIALIZE it. The USERNAME is the same user name as in TSX, and is in the same format, UPPER CASE only, with twelve alpha-numeric characters maximum. Each USERNAME must be unique (no users may have the same USERNAME). The ADDRESS is an internal pointer into the mail file to in- dicate where each user's mail is stored. Its value should never be changed. Irreversible corruption of the mail file will be to the result. MAIL - AN ON-LINE MAIL SYSTEM FOR TSX+ Page 4 The 3 blocks of directory allows space to a maximum of 96 users, each having a unique USERNAME and ADDRESS (PO BOX). Each PO BOX is stored in 8 words, starting at location 0. That is, USER1 has their PO BOX at location 1, USER2 has their PO BOX at location 9, USER3 at location 17, etc. The first six words are the USERNAME (TSX format), word 7 is the ADDRESS, and word 8 is reserved. Each users mail file is 5 blocks in length. However, each message is limited to 1000 characters, including CR/LF, in length. Each message has a 10 word header, comprised of the MES- SAGE NUMBER, DATE SENT, TIME SENT, and the SENDING USER (TSX USERNAME). The message is next, and is terminated by 1 or 2 null bytes. Each message is stored in this format. Thus it should be possible for the file to hold at least 15 moderately sized mes- sages. Since this is a file used by all users, READ/WRITE ACCESS must be given to at least this file, as determined by the ACCESS command in the TSX startup file for each user. The default dev- ice and file name is SY:MAIL.XXX, although this can be changed (see MAILX.SAV). A word of caution. Since the file is R/W, a user can DELETE the mail file. The only protection is to protect the file. This is done by the POSTMN program. MAIL - AN ON-LINE MAIL SYSTEM FOR TSX+ Page 5 Some examples are given. ACCESS SY:/READ ! READ access to SY: ACCESS SY:MAIL.XXX ! Grant R/W access to MAIL.XXX on SY: ACCESS LD0:/READ,LD0:MAIL.XXX ! LD0: is READ-ONLY, LD0:MAIL.XXX is R/W ACCESS RK4: ! RK4: is R/W, MAIL.XXX on RK4: For TSX version 6, the mail program (MAILX.SAV) can be IN- STALLED with the BYPASS privilege, instead of using the ACCESS command. This way, users have R/W access to the mail file (MAIL.XXX) while running MAIL. An example that can be inserted in the system startup file (DETACH.TSX) is shown. (Thanks to Mark Mehl of IOWA STATE UNIVERSITY for suggesting this) INSTALL ADD SY:MAILX.SAV/PRIV=BYPASS MAIL - AN ON-LINE MAIL SYSTEM FOR TSX+ Page 6 POSTMN.TSX This program, which should only be used by the system man- ager, allows the user to setup and manage the mail system. Unauthorized users are prevented from running POSTMN.TSX. Note that it does not have to be on SY: POSTMN will initially create the mail file (MAIL.XXX), and permit addition and deletion of users. It will also list the current users entered on the mail system. The EXTEND command is not implemented. To extend the mail file for additional users, use the DUP /T command (DUP SY:MAIL.XXX=/T:n/Y) to add more mes- sage space. Note that there must be sufficient free space directly after MAIL.XXX in the directory. CREATE will make a new mailfile on the default device. It first asks if you want a new mailfile (Yes or No). If Yes, it asks for the number of users, (default of 19). It then asks if the new DEV:FILENAM.EXT of SIZE is correct. If Yes is entered, a new mail file is created, else the CREATE is aborted. ADD will insert new users into the mail file. It will prompt for the USERNAME, which must be the same as the TSX USER- NAME, and in UPPER CASE. It may be any printable character, ex- cept !, as long as it is a valid TSX USERNAME. Its length is limited to 12 characters. For ease of sending messages, the MAIL - AN ON-LINE MAIL SYSTEM FOR TSX+ Page 7 USERNAME should be only alpha-numeric characters. If the USER- NAME entered already exists in the mailfile, the name is reject- ed, and a message is printed. After creating a new mail file, the easiest way to enter all new users is to run TSAUTH, create a charge file (CHARGE.TSX), edit the file so it contains only the USERNAMES (remember to re- move the trailing spaces after the USERNAME), and then use this as a command file to input the names, as shown below. ^>R POSTMN.TSX A NAME1 A NAME2 A NAME3 ........ L Q where NAMEn are the USERNAMES from the edited charge file (CHARGE.TSX). DELETE will remove the requested USERNAME from the mail sys- tem. If the name is in the mail system, it will ask for verifi- cation to delete (Yes or No). If the name to delete does not exist, a message is printed. LIST will list, along with the address, the USERNAME of each user on the mail system. It will also give the total number of users. MAIL - AN ON-LINE MAIL SYSTEM FOR TSX+ Page 8 MAILX.SAV MAILX is the utility the allows reading/sending/deleting of messages. Using MAILX is almost idiot-proof, as everything is prompted, and its mode of operation is determined by the command file MAIL.COM. To read mail, the user simply enters MAIL. If the user has a mailbox on the system, it is cheked for mail, and they are ad- vised of such. They are then asked if they wish to read the mail. (YES or NO) The default is NO. If they enter YES, each message is listed and then are asked if this message is to be DELETED (D), PRINTED (P), or to LIST the next message. This is repeated until all messages are listed. If they responed NO to reading, they are asked if they wish to send a message. If there is no mail, they are immediatly asked if they wish to send mail. The PRINT MAIL option (P) will give the user a hard-copy of the current message. It is printed an the system printer ( LP: FORTRAN UNIT 6 ). This can be changed if you site does not have a device LP: (ASS LS LP). If the user does not have a mailbox, they are advised of such, and the program exits. Since mail operates on the TSX USERNAME, a user must have one to use the mail system. MAIL - AN ON-LINE MAIL SYSTEM FOR TSX+ Page 9 To send mail, the user simply responds YES to the send mail question. They are then prompted for the USERNAME to send mail to. Simply enter the TSX USERNAME, the same one as shown by the TSX W (SHOW JOBS) command. If the USERNAME exists in the direc- tory, they are then prompted for the message. The message can be any text string, each line having a maximum of 80 characters, and each message having a maximum of 1000 characters. The input of the message is terminated by entering a CTRL-D RET ( ^D ). The sender is then advised that the message has been send. This process takes at least 4 seconds. When the actual writing into the mail file is taking place, the user is prevented from ^C-ing out of the program. If your terminal does not like the ^D message terminator, you can change this with the system option "SET TT TRANSLATE=([new-terminator]=4), where [new-terminator] is the octal value of the character to replace the ^D. When a message is sent, you have the option of sending the receiving party a message that they have mail. Simply enter Y or N in response to the ALERT question. The receiving user, if they are logged on the system, will get the message "You have mail". An option has been included allowing a privileged user to send mail to all users. To use this, simply enter "MAIL A", and you will be asked to enter you message. MAIL - AN ON-LINE MAIL SYSTEM FOR TSX+ Page 10 To prevent messages from being lost, an access control is done on each individual mail box. That is, only one user may re- quest a write into a specific mail box at any one time. For ex- ample, if USER1 is sending a message to USER5, and USER3 wants to also send a message to USER5, only one user will have access to write into USER5's mailbox, while the other user will be advised of a short wait (usually a few seconds). This occurs only at the actual write into the mailbox, so the sending users can still enter their messages without any wait. Privacy is provided by allowing only a specific user to read only their mail, as determined by the USERNAME. Thus, USER2 may only read the messages in the mail box assigned to USER2, and not the mail boxes assigned to USER1 or USER9. However, this can be overcome is USER2 has SETNAME privilege (TSX V6.2) or by using the NAME program (DECUS RT SIG TAPE). If USER2 changes their USERNAME to USER6, they will be able to read USER6's messages. Security is provided by having the entire mailfile (MAIL.XXX) encrypted. Thus, dumping the file (DUMP/OUT:TT: SY:MAIL.XXX) will print only gibberish. MAIL - AN ON-LINE MAIL SYSTEM FOR TSX+ Page 11 Summarizing, MAIL may be run with the following options: COMMAND [OPTION] RESULT MAIL Envokes MAILX for READING or SENDING mail MAIL L Runs MAILX in LOGON mode (read mail only) MAIL R Runs MAILX for reading mail only MAIL S Runs MAILX for sending mail only MAIL M Runs MAILX for number of messages only MAIL A Runs MAILX for write to all users For long messages, MAILX can be envoked from a command file as follows: ^>MAIL S ! Run MAILX in SEND mode USERNAME ! USERNAME of receiving party MESSAGE ! BODY ... ! OF ... ! MESSAGE MESSAGE ! ^D ! ^D TERMINATOR [Y or N] ! ALERT user ? MAIL - AN ON-LINE MAIL SYSTEM FOR TSX+ Page 12 MAIL.COM The command file, MAIL.COM, controls the operation of MAILX.SAV. The file is simply R MAILX ^1 where it is envoked by typing MAIL ^1 (or @SY:MAIL.COM ^1), where ^1 is replaced by one of the optional commands given on the preceding page. Normal operation is "MAIL". This checks the USERNAME, then asks if reading or sending is requested. LOGON mode checks the USERNAME, checks for mail, and the asks if the user wishes to read the mail. This is usually done only in the TSX LOGON FILE by the command "@SY:MAIL.COM L". READ mode will bypass the ques- tions and start to list any messages. SEND mode will again bypass any questions and prompt for the username and then the message. SEND mode allows a user to send messages to many users directly. ^>MAIL S USERNAME 1 MESSAGE LINE 1 MESSAGE LINE 2 ........... MESSAGE LINE n ^D (CTRL-D message terminator) If a privileged user wishes to send mail to all users, he may use the A option, which functions as the write options (S), but does not prompt for a USERNAME. The user inputs a message, MAIL - AN ON-LINE MAIL SYSTEM FOR TSX+ Page 13 and it is sent to all users. The M option allows a user to check how many messages there are in their mailbox, without having to actually go through the entire mail file. MAIL - AN ON-LINE MAIL SYSTEM FOR TSX+ Page 14 MAIL SYSTEM The mailsystem is built by envoking the command file MAIL.BLD. The mail program also needs to be linked with TSXLIB (DECUS RT SIG TAPE). A copy of a runable MAILX.SAV and POSTMN.SAV with a default mailfile of SY:MAIL.XXX are included on the distribution, for sites that do not have a copy of TSXLIB. Before building the system, edit the line in FILE.FOR to define the device and filename for the system mail file. The defalt name is SY:MAIL.XXX (in RAD50). The programs are compiled with FORTRAN (not F77), and linked with SYSLIB and FORLIB (not F77LIB). Be sure that users of the mail system have R/W ACCESS to this file, either with the ACCESS command, or by INSTALLING MAILX with /PRIV=BYPASS DATA FNAME/3RSY ,3RMAI,3RL ,3RXXX/ The author would appreciate any comments or suggestion, by mail, at the address below, or by BITNET (path given below) M. P. (MIKE) MARAK LOYOLA EMC LAB Department of Electrical Engineering ROOM AD-532 LOYOLA CAMPUS / CONCORDIA UNIVERSITY 7141 SHERBROOKE ST. W. MONTREAL, CANADA (514) 848-3118 BITNET ADDRESS MUFFY@CONU1