From: CRDGW2::CRDGW2::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX" 18-MAY-1989 17:52 To: MRGATE::"ARISIA::EVERHART" Subj: DOC Files for READMAIL and FILE_MAIL Received: From KL.SRI.COM by CRVAX.SRI.COM with TCP; Thu, 18 MAY 89 12:51:56 PDT Received: from SRI-NIC.ARPA by KL.SRI.COM with TCP; Thu, 18 May 89 12:31:15 PDT Received: from dsfvax.JPL.NASA.GOV by SRI-NIC.ARPA with TCP; Thu, 18 May 89 12:15:16 PDT Received: by dsfvax id <00000849031@dsfvax.JPL.NASA.GOV> ; Thu, 18 May 89 11:46:45 PDT Date: Thu, 18 May 89 11:45:52 PDT From: TENCATI@dsfvax.JPL.NASA.GOV Subject: DOC Files for READMAIL and FILE_MAIL To: info-vax%kl.sri.com@sri-nic.arpa X-Vms-Mail-To: EXOS%"info-vax%kl.sri.com@sri-nic.arpa",TENCATI Message-Id: <890518114552.00000849031@dsfvax.JPL.NASA.GOV> The following describes the VMS mail filer procedures FILE_MAIL and READ_MAIL. FILE_MAIL: This is run as a batch job. The function of this procedure is to: 1) Spawn a process that enters mail and then exits. This enters the newmail count into a file (if any new msgs exist) 2) Reads the output from 1) and if no messages exist, it exits. (Note that it resubmits itself prior to step 1 above). 3) If new messages exist, file all messages from NEWMAIL to a folder TEMP_MAIL, which is created new each time this step is run. 4) Invokes READMAIL.COM to process new messages. 5) Checks the time. If later than 18:00, executes command $CMAIL Which I have set to submit a command procedure that does the Following: $MAIL PURGE COMPRESS EXIT $LOGOFF --------------------------------------------------------------------------- READMAIL.COM: This procedure runs MAIL and extracts all messages from the folder TEMP_MAIL to a file. It then scans through the file reading each MAIL message and determining its type. It is tailored for my environment and currently recognizes the following message subjects and files them into folders accordingly: SPAN - Mail from other SPAN nodes JEMS - Mail from JPL's internal MAIL system RISK - Mail from RISKS digest TCPIP - Mail from TCP/IP mailing list LOCAL - Mail from users on my own node INFOVAX - Mail from the INFO-VAX mailing list SECURITY- Mail from the SECURITY mailing list All other messages are placed into a folder called MISC. Notes about INFOVAX: These messages are identified either by the string INFO-VAX or INFOVAX in the FROM line, or by the string INFO-VAX appearing in the REPLY-TO line of the header. Messages so identified are further parsed to determine if I really want to see the message. Currently, messages that contain the string "OS WAR" anywhere in any of the lines beginning with the FROM line and ending with the REPLY-TO line are automatically DELETED. With a little creative hacking, you can delete any unwanted messages that identify themselves by the subject line (or you can screen out a particular USER or HOST). As the procedure READMAIL.COM runs, it builds a third procedure FILER.COM, which contains the appropriate commands to MAIL to re-file the messages that FILE_MAIL had previously filed into the TEMP_MAIL folder. Every folder that READMAIL.COM might use MUST BE PRE-EXISTING in your MAIL.MAI file. Otherwise, it will really "fowl" things up. Granted, this is quick and dirty, but it's simple, it works, and it taught me how the SUBROUTINE and GOSUB features of DCL worked. I hope you get as much use out of them as I did. I make no warranties, but I'll be glad to answer questions. -------------------------------------------------------------------------------- Ron Tencati ARPA: TENCATI%JPLGP.SPAN@VLSI.JPL.NASA.GOV Jet Propulsion Laboratory ARPA: TENCATI@GPVAX.JPL.NASA.GOV Pasadena, Ca. 91109 SPAN: JPLGP::TENCATI (818) 354-8359 BitNet: TENCATI%GPVAX.JPL.NASA.GOV@HAMLET --------------------------------------------------------------------------------