-+-+-+-+-+-+-+-+ START OF PART 2 -+-+-+-+-+-+-+-+ X F - forward the message. The message is forwarded to the`013`010 X address specified by .`013`010 X W - forward the message using system privileges. This action`013`010 X is identical to action "F" above except that the "From:"`013`010 X field of the message header is set to match the name of`013`010 X the original sender instead of the name of the user. This`013`010 X action makes use of the DELIVER foreign mail interface in`013`010 X incoming mode which in turn requires that the user be`013`010 X fully privileged. General users should use action "F"`013`010 X instead. `013`010 X Q - quit; take no action and abort. If this action is taken`013`010 X DELIVER stops scanning the MAIL.DELIVERY file at this`013`010 X point. No subsequent directives will apply after this`013`010 X one. Use this directive with care; it is very easy to`013`010 X lose messages when this action is employed.`013`010 X`013`010 XFor example, suppose that BOB sends JIM a message. JIM has the`013`0 V10 Xfollowing (rather complex) MAIL.DELIVERY file:`013`010 X`013`010 X ! Messages with subject "Loopback" are returned to sender`013`010 X "JIM *" * "Loopback" T D`013`010 X * * "Loopback" O F """''F$ELEMENT(0,"" "",QFROM)'"""`013`010 X * * "Loopback" T Q`013`010 X ! All other messages are logged`013`010 X * * * A E @LOGALL.COM`013`010 X ! Just log messages from TERRY`013`010 X "TERRY *" * * T Q`013`010 X ! Just log archive messages from myself`013`010 X "JIM *" * "Archives" T Q`013`010 X ! Save messages from BOB in a special file`013`010 X "BOB *" * * T A BOB.LOG`013`010 X ! Then deliver anything that gets this far`013`010 X * * * A D`013`010 X`013`010 XJIM's LOGALL.COM contains the following commands:`013`010 X`013`010 X $ from == "From: " + from`013`010 X $ to == "To: " + to`013`010 X $ subject == "Subject: " + subject`013`010 X $ open/append/error=make_one x message.log`013`010 X $ next:`013`010 X $ write x ""`013`010 X $ write x from`013`010 X $ write x to`013`010 X $ write x subject`013`010 X $ write x ""`013`010 X $ close x`013`010 X $ append 'message_file' message.log`013`010 X $ exit`013`010 X $ !`013`010 X $ make_one:`013`010 X $ create message.log`013`010 X $ open/append x message.log`013`010 X $ goto next`013`010 X`013`010 XIf the subject line of BOB's message is not the string "Loopback", the`013`0 V10 Xmessage will be logged with a header in the file MESSAGE.LOG (located`013`0 V10 Xin JIM's SYS$LOGIN directory), appended to the file BOB.LOG without`013`0 V10 Xany header and delivered to JIM's NEWMAIL folder. If subject line is`013`0 V10 Xthe string "Loopback", JIM's MAIL.DELIVERY file will bounce the`013`0 V10 Xmessage right back to BOB.`013`010 X`013`010 XAs another example, if TERRY sends a message to BOB, the message is`013`0 V10 Xlogged only in BOB's MESSAGE.LOG file; BOB never receives any`013`0 V10 Xnotification that the message arrived. Apparently TERRY never says`013`0 V10 Xanything of importance to BOB.`013`010 X`013`010 XIt is clear that the ability to execute an arbitrary set of DCL`013`0 V10 Xcommands in response to a message is a very powerful tool. It must,`013`0 V10 Xhowever, be used with care, since processing is initiated whenever a`013`0 V10 Xmessage is received and operates in a completely unattended`013`0 V10 Xenvironment.`013`010 X2 Implementation`013`010 XWarning: The details in this section are technical in nature and are`013`0 V10 Xprobably of interest only to system managers or programers.`013`010 X`013`010 XDELIVER is implemented as foreign interface to VMS MAIL. DELIVER is`013`0 V10 Xactivated when a message addressed to "DELIVER%user" is sent. MAIL`013`0 V10 Xinvokes DELIVER by loading the DELIVER_MAILSHR shareable image and`013`0 V10 Xcalling a set of routines DELIVER provides to interface to MAIL.`013`0 V10 XDELIVER does the following:`013`010 X`013`010 X (1) The $GETUAI system service is used to validate the address.`013`0 V10 X DELIVER will signal an error if an attempt is made to deliver`013`0 V10 X mail to someone who does not exist. The recipient's default`013`0 V10 X directory is retrieved to use when opening the recipient's`013`0 V10 X MAIL.DELIVERY file.`013`010 X (2) DELIVER checks to see that the recipient has a MAIL.DELIVERY`013`0 V10 X file in his or her home directory. If this file does not`013`0 V10 X exist DELIVER signals an error. If the file exists it is`013`0 V10 X read and parsed.`013`010 X (3) DELIVER writes the body of the message to a temporary file in`013`0 V10 X the recipient's home directory.`013`010 X (4) A command file is constructed to complete the delivery`013`0 V10 X process. This file is also created in the recipient's home`013`0 V10 X directory. The directives previously read from the`013`0 V10 X MAIL.DELIVERY file are compared with the message. Any`013`0 V10 X directories that match cause commands to be written to the`013`0 V10 X command file that implement the requested action.`013`010 X (5) After the list of directives is exhausted DELIVER checks to`013`0 V10 X see that at least one directive caused an action to be taken.`013`0 V10 X If none did, DELIVER writes a default action command to`013`0 V10 X deliver the message normally into the command file. Commands`013`0 V10 X to delete the message file (unless the MESSAGE_DELETE flag is`013`0 V10 X set to "NO" by one of the actions) and the command file`013`0 V10 X itself are written to the command file and the command file`013`0 V10 X is closed.`013`010 X (6) The command file is queued to the batch queue MAIL$BATCH for`013`0 V10 X processing. (SYS$BATCH is used if MAIL$BATCH does not`013`0 V10 X exist.) The file is queued so that it will execute just as if`013`0 V10 X the recipient had submitted it for processing from his or her`013`0 V10 X own account. (Note: This requires CMKRNL privilege.) Once`013`0 V10 X the command file is submitted DELIVER tidies up, deallocating`013`0 V10 X any storage allocated for directive lists, and returns`013`0 V10 X control to MAIL.`013`010 X2 Sending_messages`013`010 XEvery foreign protocol interface to VMS MAIL has two parts -- one`013`0 V10 Xwhich deals with received messages (the outgoing part) and another`013`0 V10 Xwhich transfers messages to VMS MAIL (the incoming part). All the`013`0 V10 Xfunctions of DELIVER described up to this point are part of the`013`0 V10 Xoutgoing part. Rather than include a null incoming handler in`013`0 V10 XDELIVER, it was decided to add a general-purpose message queueing`013`0 V10 Xsystem that might be useful both as a simple interface to VMS MAIL and`013`0 V10 Xas an example of how this part of a foreign protocol interface is`013`0 V10 Xconstructed.`013`010 X`013`010 XThe message enqueueing part of DELIVER can be used only by fully`013`0 V10 Xprivileged users since it allows arbitrary settings of "From:"`013`0 V10 Xaddresses and so could violate MAIL security in the hands of general`013`0 V10 Xusers. Thus, this mechanism is of little interest to most users.`013`010 X`013`010 XA message is sent via DELIVER to VMS MAIL with a command of the form:`013`01 V0 X`013`010 X $ MAIL/PROTOCOL=DELIVER_MAILSHR -`013`010 X /SUBJECT="subject" message-file to-list`013`010 X`013`010 Xwhere "subject" is the subject line for the message, "message-file" is`013`0 V10 Xthe name of a file containing the text of the message and to-list is a`013`0 V10 Xlist of user names (delimited by commas) the message is to be sent to.`013`0 V10 XThe "From:" address for the message is not specified as part of the`013`0 V10 Xcommand line; it is obtained instead by translating the DCL symbol`013`0 V10 XFROM. No checking is done on the validity of the translation. This`013`0 V10 Xmode of MAIL operation roughly corresponds to the "trusted submit"`013`0 V10 Xmode available in MMDF-II.`013`010 X`013`010 XDELIVER sets two DCL symbols to indicate the success or failure of its`013`0 V10 Xattempt to deliver the message. The symbol DELIVER$STATUS will`013`0 V10 Xcontain the status code of the last error that occurs while the`013`0 V10 Xmessage is being sent. If DELIVER$STATUS indicates that some sort of`013`0 V10 Xfailure occurred, the symbol DELIVER$MESSAGE will contain the text`013`0 V10 Xform of the error message.`013`010 X`013`010 XIn the event of multiple errors while sending (e.g. two addresses in`013`0 V10 Xthe "to-list" are illegal) only the more recent error status`013`0 V10 Xinformation will be returned. This interface is somewhat crude but`013`0 V10 Xshould prove adequate for most applications.`013`010 X`013`010 XThe incoming side of DELIVER is used by the outgoing side to process`013`0 V10 Xthe "V" and "W" actions, which correspond to "privileged deliver" and`013`0 V10 X"privileged forward" operations respectively.`013`010 X2 Availability`013`010 XDELIVER is distributed as part of the PMDF-822, the Pascal Memo`013`0 V10 XDistribution Facility.`013`010 X`013`010 XPMDF-822 is distributed by CSNET to its members. Organizations who`013`0 V10 Xare not members of CSNET can obtain copies of PMDF-822 from:`013`010 X`013`010 X The Clearinghouse for Academic Software`013`010 X Computation Center`013`010 X 104 Computer Science Building`013`010 X Iowa State University`013`010 X Ames, Iowa 50011`013`010 X (515) 294-0323`013`010 X`013`010 XPMDF-822 can also be obtained from:`013`010 X`013`010 X Ned Freed (ned@ymir.bitnet)`013`010 X The PMDF Project`013`010 X Computing Services`013`010 X Harvey Mudd College`013`010 X Claremont, CA 91711`013`010 X (714) 621-8006`013`010 X2 Documentation`013`010 XThe file DELIVER.RNO contains the only documentation for DELIVER.`013`0 V10 X(You are reading a version of it right now.) DELIVER.RNO can be used`013`0 V10 Xeither to produce a printed document or a VMS help file entry. Use`013`0 V10 Xthe command`013`010 X`013`010 X $ RUNOFF/NOBOLD/NOUNDER/OUT=DELIVER.HLP DELIVER.RNO`013`010 X`013`010 Xto create the online help entry. DELIVER.HLP can be inserted into any`013`0 V10 XVMS help library. Use the command`013`010 X`013`010 X $ RUNOFF/OUT=DELIVER.MEM/VAR=MANUAL DELIVER.RNO`013`010 X`013`010 Xto create a document for printing.`013`010 X2 Bugs`013`010 XThere are no known bugs in DELIVER at this time. However, there are a`013`0 V10 Xfew minor nuisances which users should be aware of:`013`010 X`013`010 X (1) DELIVER changes the "From:" address of any message it`013`0 V10 X delivers or forwards to the address of the owner of the`013`0 V10 X MAIL.DELIVERY file. The original "From:" address is not lost`013`0 V10 X entirely -- it is merged into the subject line of the`013`0 V10 X message. This problem arises due to VMS MAIL's lack of`013`0 V10 X distinction between a transport address and a header address`013`0 V10 X -- DELIVER has to set the "From:" address to itself so that`013`0 V10 X authorization code in other mailers will see it. Privileged`013`0 V10 X users can circumvent this restriction by using the "V" and`013`0 V10 X "W" actions, but no such mechanism is available to general`013`0 V10 X users.`013`010 X (2) It is difficult to debug MAIL.DELIVERY files since there is`013`0 V10 X no way to watch deliver process the file except by enabling`013`0 V10 X debug code in DELIVER (which is not an option normal users`013`0 V10 X can exercise). Note that output from command files invoked`013`0 V10 X by DELIVER can be captured in a file by using the /OUTPUT`013`0 V10 X qualfier:`013`010 X`013`010 X ! Execute a command file with logging`013`010 X * * * A E @DO_SOMETHING.COM/OUTPUT=DO_SOMETHING.LOG`013`010 X`013`010 X DELIVER does watch for users sending messages to themselves`013`0 V10 X and then tries to be somewhat more informative about any`013`0 V10 X errors it finds in MAIL.DELIVERY files.`013`010 X (3) Enabling the COPY_SELF feature in MAIL while DELIVER is also`013`0 V10 X set to send messages to the user's mailbox may send MAIL into`013`0 V10 X an infinite loop. The COPY_SELF facility should not follow`013`0 V10 X forwarding addresses; unfortunately it does do this in the`013`0 V10 X present implementation. Thus a message is sent by DELIVER to`013`0 V10 X the user's mailbox, which in turn re-activates DELIVER, which`013`0 V10 X sends the message to the user's mailbox, and so on.`013`010 X (4) Lines in all files processed by DELIVER are limited to, at`013`0 V10 X most, 256 characters. Individual directive items as well as`013`0 V10 X message "From:", "To:" and "Subject:" lines are also limited`013`0 V10 X to 256 characters. DELIVER truncates these lines to this`013`0 V10 X length. This limit can be changed by altering the constant`013`0 V10 X PARAMETER_SIZE in DELIVER.PAS. However, these lines will`013`0 V10 X still be truncated in the DCL DELIVER produces since DCL is`013`0 V10 X also limited to lines containing no more than 256 characters.`013`0 V10 $ CALL UNPACK DELIVER.HLP;1 890519453 $ create/nolog 'f' X(* DELIVER.PAS - General MAIL delivery manager for VMS MAIL. X X Written by Ned Freed, 23-Sep-1985, modified 30-Apr-1986. X Mail dispatch interface originally written by Kevin Carosso. +-+-+-+-+-+-+-+- END OF PART 2 +-+-+-+-+-+-+-+-