DIRECTORY BasicTime USING [GMT], Rope USING [ROPE], IO USING [STREAM]; SMTPDescr: CEDAR DEFINITIONS = BEGIN ROPE: TYPE = Rope.ROPE; STREAM: TYPE = IO.STREAM; Descr: TYPE = REF DescrRep; DescrRep: TYPE; Format: TYPE = {gv, arpa}; Create: PROC [ arpaReversePath: ROPE _ NIL, gvSender: ROPE _ NIL, rawRecipients: LIST OF ROPE, source: ROPE _ NIL, format: Format, msgStream: STREAM, precedeMsgText: ROPE _ NIL, returnPathLine: ROPE _ NIL] RETURNS [Descr]; GetUserHandle: PROC [self: Descr] RETURNS [INT]; GetFileName: PROC [self: Descr] RETURNS [ROPE]; -- should be called only by SMTPQueue.DeleteFromAll GetExpiryDate: PROC [self: Descr] RETURNS [BasicTime.GMT]; GetArpaReversePath: PROC [self: Descr] RETURNS [path: ROPE]; SetArpaReversePath: PROC [self: Descr, path: ROPE]; GetGvSender: PROC [self: Descr] RETURNS [rName: ROPE]; SetGvSender: PROC [self: Descr, rName: ROPE]; GetSource: PROC [self: Descr] RETURNS [ROPE]; EnumerateRawRecipients: PROC [self: Descr, proc: RawRecipProc, procData: REF ANY _ NIL]; RawRecipProc: TYPE = PROC [rawRecipient: ROPE, procData: REF ANY] RETURNS [continue: BOOL _ TRUE]; RemoveRawRecipients: PROC [self: Descr]; AddProcessedRecipient: PROC [self: Descr, hostName: ROPE, userName: ROPE, checkDuplicate: BOOL]; RemoveRecipientHost: PROC [self: Descr, hostName: ROPE]; EnumerateRecipientHosts: PROC [self: Descr, proc: HostProc, procData: REF ANY _ NIL]; HostProc: TYPE = PROC [hostName: ROPE, userNames: LIST OF ROPE, procData: REF ANY] RETURNS [continue: BOOL _ TRUE]; MoreRecipients: PROC [self: Descr] RETURNS [BOOL]; StoreItemInfo: PROC [descr: Descr]; GetFormat: PROC [self: Descr] RETURNS [Format]; GetPrecedeMsgText: PROC [self: Descr] RETURNS [ROPE]; SetPrecedeMsgText: PROC [self: Descr, new: ROPE]; GetReturnPathLine: PROC [self: Descr] RETURNS [ROPE]; RetrieveMsgStream: PROC [self: Descr] RETURNS [STREAM]; UniqueID: PROC [self: Descr] RETURNS [rope: ROPE]; Destroy: PROC [self: Descr]; Print: PROC [descr: Descr, out: STREAM, form: PrintForm _ long]; Unparse: PROC [descr: Descr, form: PrintForm _ short] RETURNS [ROPE]; PrintForm: TYPE = {short, long}; CopyForReturn: PROC [old: Descr, reason: ROPE] RETURNS [new: Descr]; ReadItemFile: PROC [fileName: ROPE] RETURNS [Descr]; Failed: ERROR [reason: ROPE]; EnumerateInitialItems: PROC [proc: InitialItemProc]; InitialItemProc: TYPE = PROC [descr: Descr]; CreateFailed, WrongState, PutOnBadQueue: ERROR; END. BSMTPDescr.mesa Last Edited by: HGM, April 29, 1984 3:37:08 am PDT Last Edited by: DCraft, December 21, 1983 8:40 pm Last Edited by: Taft, January 3, 1984 2:03 pm Hal Murray May 27, 1985 7:54:13 pm PDT Descriptors contain the information about mail items (name of message file, reverse-path, recipients, timeout, etc.). They are kept internally on Queues, and are partially backed up on the filestore. The intention is that, at start of day, the server will initialize its internal queues by requesting the existing descriptors from the filestore (those left over from before the crash or shutdown). The server will create new descriptors as mail items come in, move the descriptors through the queue system, and destroy the descriptors once the mail has been delivered. ! CreateFailed if unable to store on disk. This is used by the processing procs to convert raw recipients, one at a time, into processed host/user pairs which can then be added to the item with AddProcessedRecipient. ! WrongState ! WrongState Remove them all, item probably being returned to sender. Add the given host/user pair to the item descriptor. (StoreItemInfo should be called when processing is finished.) ! WrongState The item has been delivered to the given host so remove all recipients at this host from the recipient list. ! WrongState Enumerate the (processed) recipient hosts, giving the host name and all recipient users at that host for each. Returns whether there are any more recipients (either raw or processed). Should be checked before calling Destroy. The item descriptor is in a consistent state which should be backed up to the filestore. Get the format of the message body. Get the text which should precede the message body upon sending. Get the return path line which was assigned for incoming SMTP mail. (NIL for items with GV format) ! PutOnBadQueue Open the associated file and provide a subrange stream for the message body. Destroy the descriptor (basically, delete the file). Repeatable. Prints info from the given item descriptor on the given output stream. The short form includes only the handle and file name. The long form ends with a newline. Like Print, except returns the info as a rope. The long form is somewhat inefficient and shouldn't be used frequently. ! CreateFailed The given item is to be returned to the sender. Copy the old file, update the descriptor fields to return the item, and store the info changes to the new file, returning the new descriptor. ! Failed; Read the item file with the given name. Client should ensure there are no items in the queue system which already reference this file to ensure no duplicate items. This will be used only as a result of the user having edited an item file and requested it to be read. Scan the filestore directory for item files left from the previous run, creating a descriptor and calling proc for each. Κΰ– "cedar" style˜headšœ™Ibodyšœ2™2Lšœ1™1Lšœ-™-Icode™&LšœΈ™Έcode2šΟk ˜ Nšœ œœ˜Nšœœœ˜Nšœœœ˜——šœ œ œ˜Nš˜Nšœœœ˜Nšœœœœ˜NšœΟrΠkržŸž ˜Nšžœœ˜NšœŸœ˜šΟnœœ˜Nšœœœ˜Nšœ œœ˜Nšœœœœ˜Nšœœœ˜Nšœ˜Nšœ œ˜Nšœœœ˜Nšœœœ˜Nšœ ˜N™*—Nš  œœœœ˜0Nš   œœœœΟc3˜cNš  œœœ œ˜:Nš  žŸžœžŸžŸž˜