SMTPSupport.mesa
Last Edited by: HGM, April 20, 1985 7:46:49 pm PST
Last Edited by: DCraft, December 16, 1983 10:26 am
Last Edited by: Taft, January 23, 1984 1:26:36 pm PST
DIRECTORY
BasicTime USING [GMT, nullGMT],
IO USING [STREAM],
Rope USING [ROPE],
SMTPDescr USING [Descr];
SMTPSupport: CEDAR DEFINITIONS = BEGIN
ROPE: TYPE = Rope.ROPE;
STREAM: TYPE = IO.STREAM;
Logging Information
A simple LOG facility is provided which will consider writing the given notes (along with the date) to the log viewer. Such consideration is based on the given priority. If this priority is greater than or equal to the currentLogAcceptPriority then the log entry is made. It is anticipated that the acceptance priority will normally be noteworthy or important (depending on the volume of mail traffic), and that verbose will be used primarily for debugging.
LogPriority: TYPE = {verbose, noteworthy, important, ATTENTION, CRITICAL};
logPriorityNames: ARRAY LogPriority OF ROPE -- = ["verbose", "noteworthy", "important", "ATTENTION", "CRITICAL"] -- ;
verbose: anything that anyone cares to tell
noteworthy: less detailed running comment on "what's happening"
important: something slightly unusual or fairly infrequent which might be of more interest
ATTENTION: something [probably] requiring a manager fix, but server can continue (e.g. corrupt item file)
CRITICAL: something requiring manager intervention before server can continue
Log: PROC [priority: LogPriority, note1, note2, note3, note4, note5, note6, note7, note8, note9, note10: ROPENIL];
currentLogAcceptPriority: LogPriority;
Housekeeping
AuthorizationCheck: PROC [sender: ROPE] RETURNS [ok: BOOLEAN];
CheckHeader: PROC [sender: ROPE, descr: SMTPDescr.Descr] RETURNS [ok: BOOLEAN];
Notification of Undeliverable Mail
NotifySender: PROC [descr: SMTPDescr.Descr, why1, why2, why3, why4, why5: ROPENIL];
Create and queue a new mail item from the given one to be returned to the sender (actually, the reverse path). Include the why text before the current message. It is the client's responsibility to remove the item from the queue system as appropriate. [For Grapevine mail with message body items referring to specific positions within the message text (e.g. Tioga formatting info?), inserting text could be a problem.]
HeaderParseError: PROC [recipList: LIST OF ROPE, descr: SMTPDescr.Descr];
Date/Time Conversion
Now: PROC [compressed: BOOLFALSE] RETURNS [rope: ROPE, gmt: BasicTime.GMT];
Date and time in SMTP format. Compressed form is suitable for filename component.
RFC822Date: PROC [gmt: BasicTime.GMT ← BasicTime.nullGMT] RETURNS [date: ROPE];
Subrange Streams
Subrange streams are layered input streams which allow the user to see only a specified subrange of the available [file]stream, raising EndOfStream if the end of that subrange is reached by GetChar, providing less than the requested number of bytes if the end of the subrange is reached by GetBlock, and raising Error[BadIndex] on attempts to SetIndex beyond the subrange. [The non-defaulted procs are GetChar, GetBlock, EndOf, GetLength, and SetIndex.]
data is origStream[min..max)
CreateSubrangeStream: PROC [origStream: STREAM, min, max: INT] RETURNS [STREAM];
RopeFromSubrange: PROC [origStream: STREAM, min, max: INT] RETURNS [ROPE];
END.